Board index FlightGear Support Compiling

undefined reference to symbol 'dlopen@@GLIBC_2.1'

Building FlightGear from source, and in the need for help?

undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby abassign » Thu Apr 18, 2013 10:38 pm

In Kubuntu / Ubuntu ("raring" - 13.4) I'm trying to compile with "sh download_and_compile.sh" script, but I always get an error:

Code: Select all
[ 34%] Building CXX object src/Main/CMakeFiles/fgfs.dir/__/Viewer/splash.cxx.o
Linking CXX executable fgfs
[ 94%] Built target fgfs
Linking CXX executable metar
[ 95%] Built target metar
[ 95%] Built target FGAdminUI
Linking CXX executable fgadmin
/usr/bin/ld: /usr/lib/i386-linux-gnu/libfltk.a(Fl_Preferences.o): undefined reference to symbol 'dlopen@@GLIBC_2.1'
/usr/bin/ld: note: 'dlopen@@GLIBC_2.1' is defined in DSO /lib/i386-linux-gnu/libdl.so.2 so try adding it to the linker command line
/lib/i386-linux-gnu/libdl.so.2: could not read symbols: Operazione non valida
collect2: error: ld returned 1 exit status
make[2]: *** [utils/fgadmin/src/fgadmin] Errore 1
make[1]: *** [utils/fgadmin/src/CMakeFiles/fgadmin.dir/all] Errore 2
make: *** [all] Errore 2


Can anyone help me ?
abassign
 
Posts: 847
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby Curtis » Fri Apr 19, 2013 12:22 am

it's better to use the classic way with "cmake" :

I suppose you have extracted the source code in /home/user/flightgear

just type :

Code: Select all
cd /home/user/flightgear/flightgear2.10.0
    mkdir fgbuild
    cd fgbuild
    cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local
    make install
Curtis
 
Posts: 152
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby abassign » Fri Apr 19, 2013 4:57 pm

Unfortunately, the problem is definitely not what the configuration of CMAKE, but something about libraries, when I installed the Kubuntu / Ubuntu 12.10 no problem, instead when I installed Kubuntu / Ubuntu 13.04 are no longer able to compile, I'd like to know if someone has experienced the same problem. :cry:
abassign
 
Posts: 847
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby Curtis » Fri Apr 19, 2013 6:48 pm

try to install libc6-dev package,

Code: Select all
sudo apt-get install libc6-dev


probably some "dev packages" are missing in your ubuntu, check what "dev packages" are available for your Ubuntu 13.04 and install them, sometimes there is a meta package "development" who installs all the required packages for software development,

you can also try this before compiling :

Code: Select all
export LDFLAGS="$LDFLAGS -ldl"
Curtis
 
Posts: 152
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby abassign » Sat Apr 20, 2013 4:44 am

The library "libc6-dev" was present in the system, and the command
"export LDFLAGS =" $ LDFLAGS-ldl "" did not give Nessu result.

Code: Select all
[  0%] Built target fgjs
[  0%] Built target js_demo
[  5%] Built target yasim
[ 11%] Built target yasim-proptest
[ 27%] Built target JSBSim
[ 94%] Built target fgfs
[ 95%] Built target metar
[ 95%] Built target FGAdminUI
Linking CXX executable fgadmin
/usr/bin/ld: /usr/lib/i386-linux-gnu/libfltk.a(Fl_Preferences.o): undefined reference to symbol 'dlopen@@GLIBC_2.1'
/usr/bin/ld: note: 'dlopen@@GLIBC_2.1' is defined in DSO /usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libdl.so so try adding it to the linker command line
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libdl.so: could not read symbols: Operazione non valida
collect2: error: ld returned 1 exit status
make[2]: *** [utils/fgadmin/src/fgadmin] Errore 1
make[1]: *** [utils/fgadmin/src/CMakeFiles/fgadmin.dir/all] Errore 2
make: *** [all] Errore 2


My impression is that there is a problem on some version in the library, but I do not understand on what library!

Code: Select all
/usr/bin/ld: /usr/lib/i386-linux-gnu/libfltk.a(Fl_Preferences.o): undefined reference to symbol 'dlopen@@GLIBC_2.1'
abassign
 
Posts: 847
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby Curtis » Sat Apr 20, 2013 5:59 am

abassign wrote in Sat Apr 20, 2013 4:44 am: the command
"export LDFLAGS =" $ LDFLAGS-ldl "" did not give Nessu result.


be careful with the syntax, it's :

export LDFLAGS="$LDFLAGS -ldl"

not "export LDFLAGS =" $ LDFLAGS-ldl "

try also :

export LDFLAGS="-ldl"

try also to compil another software in order to see if the same problem happens again, it may caused by a bad configuration of your environment variables for gcc,

ubuntu 13.04 is not again a stable version, some bugs like this may exist
Curtis
 
Posts: 152
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby abassign » Tue Apr 23, 2013 6:11 am

I could not resolve the error, I'd like to understand what the message of cmake! Someone can explain it to me?
abassign
 
Posts: 847
Joined: Mon Feb 27, 2012 5:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2018.3
OS: Linux Mint 19. x

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby Soitanen » Thu Apr 25, 2013 1:16 pm

Confirm error. Installed Ubuntu 13.04 (release) and get the same error. 12.10 worked correctly.
Boeing 737-300. Reworked cockpit, FDM, autopilot and much more. WIP.
Boeing 737-800. WIP. Canvas PFD and ND.
Antonov An-24B. Made from scratch. Very good FDM. 3D model by Adrian. WIP.
Project Russia (some cities, based on OSM with custom objects).
Soitanen
 
Posts: 489
Joined: Sat Jun 16, 2012 6:50 am
Location: Saint-Petersburg, Russia
Version: git
OS: Linux Mint 17

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby Soitanen » Sun Apr 28, 2013 2:19 pm

Now I have temporary solution of the problem:
you need to edit /dir-where-script-lives/fgfs/flightgear/utils/CMakeLists.txt and make comments instead of first 7 string:
Code: Select all
#if(FLTK_FOUND)
#    if (EXISTS ${FLTK_FLUID_EXECUTABLE})
#        add_subdirectory(fgadmin)
#    else ()
#        message(STATUS "fluid executable not found, disabling fgadmin")
#    endif ()
#endif()


FG compiles normally, but FGRun fails in compiling with the same error about 'DLOPEN@@GLIBC_2.1'.
Boeing 737-300. Reworked cockpit, FDM, autopilot and much more. WIP.
Boeing 737-800. WIP. Canvas PFD and ND.
Antonov An-24B. Made from scratch. Very good FDM. 3D model by Adrian. WIP.
Project Russia (some cities, based on OSM with custom objects).
Soitanen
 
Posts: 489
Joined: Sat Jun 16, 2012 6:50 am
Location: Saint-Petersburg, Russia
Version: git
OS: Linux Mint 17

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby Trez » Sun Apr 28, 2013 4:42 pm

Experiencing the exact same problem. Worked fine with Linux Mint 14 Cinnamon
User avatar
Trez
 
Posts: 434
Joined: Thu Jul 14, 2011 10:50 am
Location: Netherlands
Callsign: Trez
Version: 2.8 GIT
OS: OSX10.8, Mint 14

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby chris_blues » Tue Apr 30, 2013 3:28 pm

Same here!

The answer is here:
viewtopic.php?f=45&t=17504
Code: Select all
sudo apt-get remove libfltk1.3-dev

did the trick...

apparently, in order to compile fgrun, it needs to be installed again afterwards...
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian stable 64bit - i7 8x2.8GHz - 20GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1569
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian stable 64

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby Trez » Tue Apr 30, 2013 7:32 pm

Well,

I got Flightgear running somehow using Soitanen's solution. All you actually need is FGFS, FGDATA, OSG, FGX(or your favorite launcher) and SIMGEAR.

Happy Flying!
User avatar
Trez
 
Posts: 434
Joined: Thu Jul 14, 2011 10:50 am
Location: Netherlands
Callsign: Trez
Version: 2.8 GIT
OS: OSX10.8, Mint 14

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby chris_blues » Tue Apr 30, 2013 7:56 pm

Yea, but these are ugly workarounds. I wonder what the real trouble is here! Avoiding the problem by simply not compiling fgadmin is not really a sloution in my eyes. Mostly only few people use fgadmin, I almost never do. But installing the whole world scenery by hand would take days! :roll:
So, if anyone could provide some info, what is going on here, I would be very happy!

Cheers
chris
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian stable 64bit - i7 8x2.8GHz - 20GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1569
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian stable 64

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby callahanp » Mon May 13, 2013 12:51 am

The problem appears to be flaky behavior of the fltk cmake module.

Here's what we need to figure out what's really going on:

Someone who still has 12.10 installed: find the exact gcc command that your build uses to build fgrun and fgadmin.
This should include all the link libraries such as fltk etc.

Lets start there.

Other info is out there about this bug. We are not alone in this. Several other applications are also having the same trouble building.

libdl appears to be the library that is not showing up correctly when the linker is trying to link the executable.
This happesn for me on compiling FGRUN, during the cmake step. Cmake fails because it cannot compile the very short program that tests that a compile works under FLTK 1.3. It fails for the same reason as a full build of FGRUN. You can get the full build by removing the section of code from the FGRUN CMakeLists.txt.
callahanp
 
Posts: 11
Joined: Sat May 11, 2013 2:40 am
Callsign: pac1

Re: undefined reference to symbol 'dlopen@@GLIBC_2.1'

Postby callahanp » Sat May 18, 2013 8:22 pm

More information about this:

Workaround:

You can get fgrun to build by changing two sections of the FGRUN CMakeLists.txt, then rerun the FGRUN build without downloading updated sources. Not dowloading the sources preserves your change to CmakeLists.txt


Change 1: add to CmakeLists.txt, the line

list(APPEND FLTK_LIBRARIES -ldl)

about lines 204 to 207 should look like this:

if ( FLTK_FOUND )
list(APPEND FLTK_LIBRARIES -ldl)

if ( X11_Xinerama_FOUND )


Comment out the check for FLTK 1.3 it doesn't work with this change
Near Lines 220 through 230 should look like this:

# check_cxx_source_runs(
# "#include <FL/Fl.H>
# int main() {
# return Fl::version() >= 1.03 ? 0 : -1;
# }
# "
# HAVE_FLTK_1_3)
#
# if ( NOT HAVE_FLTK_1_3 )
# message( SEND_ERROR "FLTK 1.3 is required" )
# endif ( NOT HAVE_FLTK_1_3 )

next just run

./download_and_compile.sh -d n -p n FGRUN


Background info:

Below is the working link for FGRUN with -dl added in the list of fltk libraries. Without the fix, its broken.

Linking CXX executable fgrun
cd /home/pac1/work/dc1/patching/p1/build/fgrun/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/fgrun.dir/link.txt --verbose=1
/usr/bin/c++ -O3 -D__STDC_CONSTANT_MACROS -D_REENTRANT -DENABLE_NLS -O3 -DNDEBUG CMakeFiles/fgrun.dir/wizard_funcs.cxx.o CMakeFiles/fgrun.dir/advanced_funcs.cxx.o CMakeFiles/fgrun.dir/AirportBrowser.cxx.o CMakeFiles/fgrun.dir/AirportTable.cxx.o CMakeFiles/fgrun.dir/Fl_Table.cxx.o CMakeFiles/fgrun.dir/Fl_Table_Row.cxx.o CMakeFiles/fgrun.dir/Fl_OSG.cxx.o CMakeFiles/fgrun.dir/Fl_Heading_Dial.cxx.o CMakeFiles/fgrun.dir/main.cxx.o CMakeFiles/fgrun.dir/io.cxx.o CMakeFiles/fgrun.dir/fgfsrc.cxx.o CMakeFiles/fgrun.dir/logwin.cxx.o CMakeFiles/fgrun.dir/parkingloader.cxx.o CMakeFiles/fgrun.dir/settings.cxx.o CMakeFiles/fgrun.dir/util.cxx.o CMakeFiles/fgrun.dir/run_posix.cxx.o CMakeFiles/fgrun.dir/fgrun_pty.cxx.o -o fgrun -rdynamic libWizard.a libAdvanced.a /home/pac1/work/dc1/patching/p1/install/simgear/lib/i386-linux-gnu/libSimGearScene.a /home/pac1/work/dc1/patching/p1/install/simgear/lib/i386-linux-gnu/libSimGearCore.a /home/pac1/work/dc1/patching/p1/install/simgear/lib/i386-linux-gnu/libSimGearCore.a -lpthread -lz -lrt /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgText.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgDB.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgParticle.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgUtil.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgViewer.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgGA.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosg.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libOpenThreads.so /usr/lib/i386-linux-gnu/libfltk_images.a /usr/lib/i386-linux-gnu/libfltk_forms.a /usr/lib/i386-linux-gnu/libfltk_gl.a -lGL /usr/lib/i386-linux-gnu/libfltk.a -lSM -lICE -lX11 -lXext -lm -ldl -lXinerama -lXft -lz -lutil -lrt /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgText.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgDB.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgParticle.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgUtil.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgViewer.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosgGA.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libosg.so /home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib/libOpenThreads.so -lGL -lSM -lICE -lX11 -lXext -lm -ldl -lXinerama -lXft -lutil -lpng -lz -ljpeg -lXft -lfontconfig -lXinerama -lX11 -lm -lGLU -lGL -Wl,-rpath,/home/pac1/work/dc1/patching/p1/install/OpenSceneGraph/lib:
callahanp
 
Posts: 11
Joined: Sat May 11, 2013 2:40 am
Callsign: pac1

Next

Return to Compiling

Who is online

Users browsing this forum: No registered users and 1 guest