I’m attempting to write an Oxygene Linux Island app that calls functions in a C shared library. I’ve created libgpio.fx successfully using an import project. But when I attempt to use libgpio.fx, I get the following errors:
C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello>make
"C:/Program Files (x86)/RemObjects Software/Elements/Bin/EBuild" "test_hello.elements" --configuration:Release
RemObjects EBuild. An open source build engine for Elements and beyond.
Copyright RemObjects Software 2016-2019. All Rights Reserved. Created by marc hoffman.
Version 10.0.0.2437 (develop) built on bajor, 20190906-114556. Commit e1dfdd2.
Reference 'libgpio' was resolved to 'C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libgpio.fx' via 'HintPath' for target 'Island-Linux'.
Reference 'libgpio' was resolved to 'C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libgpio.fx' for target 'Island-Linux' (x86_64).
Reference 'rtl' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\Island\SDKs\Linux\Ubuntu 2.19\x86_64\rtl.fx' for target 'Island-Linux'.
Reference 'rtl' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\Island\SDKs\Linux\Ubuntu 2.19\x86_64\rtl.fx' for target 'Island-Linux' (x86_64).
Reference 'gc' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\Island\SDKs\Linux\Ubuntu 2.19\x86_64\gc.fx' for target 'Island-Linux'.
Reference 'gc' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\Island\SDKs\Linux\Ubuntu 2.19\x86_64\gc.fx' for target 'Island-Linux' (x86_64).
Reference 'Island' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Ubuntu\x86_64\Island.fx' for target 'Island-Linux'.
Reference 'Island' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Ubuntu\x86_64\Island.fx' for target 'Island-Linux' (x86_64).
RemObjects Elements (Oxygene, C#, Swift and Java) Compiler for .NET, Cocoa, Java and Island.
Version 10.0.0.2437 (develop) built on bajor, 20190906-114556. Commit e1dfdd2.
Copyright 2003-2019 RemObjects Software, LLC. All rights reserved.
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to strncpy
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to __xpg_strerror_r
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to __h_errno_location
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to inet_ntoa
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to system
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to tcflush
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to snprintf
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to lseek
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to __assert_fail
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to htonl
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to epoll_ctl
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to gethostbyname2
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to getpwnam
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to fprintf
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to syslog
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to daemon
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to cfmakeraw
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to ntohs
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to epoll_wait
E: C:\Users\pmunts\src\experimental\elements\linux\programs\test_hello\libsimpleio.so: undefined reference to poll
E: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
Project 'test_hello' failed to build.
Solution 'test_hello' failed to build all projects.
C:/Users/pmunts/src/libsimpleio/elements/include/elements.mk:43: recipe for target 'elements_mk_build' failed
make: *** [elements_mk_build] Error 1
These appear to be all of the symbols in glibc that the code in the shared library references.
The application project including the .fx and .so files is attached.test_hello.zip (29.1 KB)
Addendum: The above is from trying to build on Windows.
Building on Linux yields a completely different error; perhaps it is getting further along:
pmunts@builder:~/src/experimental/elements/linux/programs/test_hello$ make
"/usr/local/bin/ebuild" "test_hello.elements" --configuration:Release
RemObjects EBuild. An open source build engine for Elements and beyond.
Copyright RemObjects Software 2016-2019. All Rights Reserved. Created by marc hoffman.
Version 10.0.0.2437 (develop) built on bajor, 20190906-114556. Commit e1dfdd2.
Reference 'libgpio' was resolved to '/home/pmunts/src/experimental/elements/linux/bindings/libgpio.fx' via 'HintPath' for target 'Island-Linux'.
Reference 'libgpio' was resolved to '/home/pmunts/src/experimental/elements/linux/bindings/libgpio.fx' for target 'Island-Linux' (x86_64).
Reference 'rtl' was resolved to '/usr/local/lib/elements/Island SDKs/Linux/Ubuntu 2.19/x86_64/rtl.fx' for target 'Island-Linux'.
Reference 'rtl' was resolved to '/usr/local/lib/elements/Island SDKs/Linux/Ubuntu 2.19/x86_64/rtl.fx' for target 'Island-Linux' (x86_64).
Reference 'gc' was resolved to '/usr/local/lib/elements/Island SDKs/Linux/Ubuntu 2.19/x86_64/gc.fx' for target 'Island-Linux'.
Reference 'gc' was resolved to '/usr/local/lib/elements/Island SDKs/Linux/Ubuntu 2.19/x86_64/gc.fx' for target 'Island-Linux' (x86_64).
Reference 'Island' was resolved to '/usr/local/lib/elements/References/Island/Ubuntu/x86_64/Island.fx' for target 'Island-Linux'.
Reference 'Island' was resolved to '/usr/local/lib/elements/References/Island/Ubuntu/x86_64/Island.fx' for target 'Island-Linux' (x86_64).
RemObjects Elements (Oxygene, C#, Swift and Java) Compiler for .NET, Cocoa, Java and Island.
Version 10.0.0.2437 (develop) built on bajor, 20190906-114556. Commit e1dfdd2.
Copyright 2003-2019 RemObjects Software, LLC. All rights reserved.
E:
Internal error: System.DllNotFoundException: RemObjects.Elements.LLVM.dll assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) LLVM.Interop.LLVMInterop.LLVMInitializeAll()
at RemObjects.Elements.Island.IslandOutput..cctor () [0x001a9] in <a364d32ff0b94ca4803a6ba08ed6eb73>:0
Project 'test_hello' failed to build.
Solution 'test_hello' failed to build all projects.
make: *** [/usr/local/share/libsimpleio/elements/include/elements.mk:43: elements_mk_build] Error 1