On 06/16/2011 11:56 PM, David Doria wrote:
> I added a simple:
> 
> target_link_libraries(myprogram geotiff)
> 
> to my CMakeLists.txt file. I have a libgeotiff.so in a directory on my
> LD_LIBRARY_PATH. The code compiled, but when I tried to run it, I got
> an error that I was missing libgeotiff.so.2. I made a symlink from
> libgeotiff.so.2 to libgeotiff.so, and then everything worked. Why was
> this .2 introduced? Is there either 1) a way to stop it from getting
> introduced or 2) a way to tell it "just use the closest file" so it
> would use the libgeotiff.so without me needing to make a symlink?
> 
> Thanks,
> 
> David

This is not the fault of CMake. The file should actually be called
libgeotif.so.2, and the symlink should be called libgeotif.so and point
to libgeotif.so.2. The symlink is only used for linking, while the real
file, libgeotif.so.2, will be used at runtime. This is to make it
possible to have multiple versions of libgeotif installed, but only one
version will be used for linking.

See here for more info:
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

HTH

Michael
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to