From: Grzegorz J. <ja...@ac...> - 2004-07-14 15:21:14
|
Grigorenko Dmitriy wrote: > Hi > > >>Congratulations, very nice workaround. > > Thank`s > > >>That very well may be. However, I would also check if by any chance >>dynamic linker is not picking another version of libltdl installed >>somewhere else on your system. On my Linux there is 'ldd' utility for >>this purpose, I am not sure about Cygwin. > > I checked that it does not compile without ltdt libs. One think is if it compiles, another is how it is linked at runtime. In most Linux distros libltdl package has dev and non-dev versions. If you have non-dev version installed system-wide, then you have /lib/libltdl.so, but not /include/ltdl.h . Thus OpenC++ will not compile without bundled libltdl; when you point bundled libltdl to OpenC++ it will pick opencxx/libltdl/ltdl.h at compilation time and at linking time it will see opencxx/libltdl/libltdl.so and will be satisfied. However, at loadtime, the dynamic loader may pick your system-wide /lib/libltdl.so and if the versions do not match, your executable may crash (at least I believe so; there may be some version control mechanism built into libtool libraries that is supposed to prevent it, but I am no expert). Do you have (or can install) 'ldd' utility? On Linux it works like this: $ ldd occ libltdl.so.3 => /home/jakacki/tmp/opencxx/libltdl/.libs/libltdl.so.3 (0x40018000) libdl.so.2 => /lib/libdl.so.2 (0x4002c000) libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4002f000) libm.so.6 => /lib/libm.so.6 (0x400e8000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4010a000) libc.so.6 => /lib/libc.so.6 (0x40112000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) As you can see in this particular config dynamic linker will pick my local version of libltdl. And this is the output I am getting after linking libltdl statically by hand: $ ldd occ libdl.so.2 => /lib/libdl.so.2 (0x40024000) libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40028000) libm.so.6 => /lib/libm.so.6 (0x400e1000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40103000) libc.so.6 => /lib/libc.so.6 (0x4010b000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) As you can see libltdl does not occur at all --- it is linked statically. If you could run ldd in your setup we could see if the correct libltdl.so is picked. Best regards Grzegorz > > |