Linking errors

Archives Forums/Linux Discussion/Linking errors

Tricky(Posted 2012) [#1]
I have a bit of an odd error, but then again, trying to get Linux versions of ANY project of mine has been a nightmare for me.

I have to note, this error popped up by using Fedora Linux (in a VM environment).

I tried to build a random .bmx file of mine. The compiling gives no errors at all, but when the program has to link I get the next error.
Linking:DJCR.debug_Linux
/usr/bin/ld: /home/rachel/Public/BlitzMax Linux/BlitzMax/mod/maxgui.mod/fltkmaxgui.mod/fltkmaxgui.debug.linux.x86.a(Fl_Preferences.cxx.debug.linux.x86.o): undefined reference to symbol 'dlopen@@...'
/usr/bin/ld: note: 'dlopen@@...' is defined in DSO /lib/libdl.so.2 so try adding it to the linker command line
/lib/libdl.so.2: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
Build Error: Failed to link /media/PHANTASAR/Projects/JCR5/DJCR.debug_Linux
Process complete


I did run the script I saw somewhere on this very forum (in the stickies) to get all stuff installed BMax needs, and to prevent the compiler from overwriting my MacOS console builds I modified BMK to add the "_Linux" suffix to all Linux builds. The odd part is, compiling the modified BMK didn't turn any errors at all (I did compile bmk itself with the modified version of bmk too to make sure I did nothing wrong. Just double check). Second, the source-code used to make this build does NOT use MaxGui and I frameworked it out, so why the linker still wants it is beyond me. Both debug and release builds of this source show this error, and I tried it on more projects all with the same error.

I can also add that all the sources I tried for this produced correct working executables when being compiled in both Windows as MacOS.

Of course, the source of the above project, is an (already released) source of a project I put in the open source http://jcr5.sourceforge.net so if you want to try for yourself if you can get a working build, be my guest.