Bill Hoffman wrote:
So, it must be that the library is built with no soname. Brad will be
back in a few days, and should have a better idea of how to fix it.
This is probably the problem. You can confirm this by running
readelf -d /home/kchang/sandbox/thost/thostmduserapi.so |grep SONAME
Hi Bill,
I tried the same experiment with a boost .so and it worked. What's
interesting is that I can link with thostmduserapi.so if I do it
manually or just renamed it, and the application works, so it looks like
the file is a valid object. gcc/c++ doesn't complain about a bad object
Kenneth Chang wrote:
Hi Bill,
I tried the same experiment with a boost .so and it worked. What's
interesting is that I can link with thostmduserapi.so if I do it
manually or just renamed it, and the application works, so it looks like
the file is a valid object. gcc/c++ doesn't complain
Kenneth Chang wrote:
thx, yes, it's 64-bit linux.
So, Brad King is the person who is the expert in the elf linking in
CMake, and he is on vacation right now.
I did find this comment, which describes pretty much what is going on:
From cmComputeLinkInformation.cxx:
Tried this, ABCD_LIBRARY gets the correct path, but for some reason,
target_link_libraries likes to convert it to -Lxxx -lyyy on the link
line. (I've previously typed the name of the file directly into the
target_link_libraries() command too)
I'm seeing some of these properties like
What version of CMake are you using? Anything before 2.6 used to do
this, newer versions shouldn't.
Michael
On 14. Aug, 2009, at 18:23, Kenneth Chang wrote:
Tried this, ABCD_LIBRARY gets the correct path, but for some reason,
target_link_libraries likes to convert it to -Lxxx -lyyy on the
kch...@fiji:~$ cmake --version
cmake version 2.6-patch 2
Michael Wild wrote:
What version of CMake are you using? Anything before 2.6 used to do
this, newer versions shouldn't.
Michael
On 14. Aug, 2009, at 18:23, Kenneth Chang wrote:
Tried this, ABCD_LIBRARY gets the correct path, but for
Try latest!
BTW I am doing such tricks for annoying bad-named stuff:
SET_SOURCE_FILES_PROPERTIES(
${FLEXLM_OBJECTS}
PROPERTIES
EXTERNAL_OBJECT true # if it should be compiled or only linked
GENERATED false # if the
Just downloaded 2.6.4, same behavior.
Do I have to mark the .so extension so it's recognized as a linkable item?
Kenny
Dominik Szczerba wrote:
Try latest!
BTW I am doing such tricks for annoying bad-named stuff:
SET_SOURCE_FILES_PROPERTIES(
${FLEXLM_OBJECTS}
PROPERTIES
Kenneth Chang wrote:
Just downloaded 2.6.4, same behavior.
Do I have to mark the .so extension so it's recognized as a linkable item?
Why not use target_link_libraries with a full path to the .so?
-Bill
___
Powered by www.kitware.com
Visit other
I did, then cmake broke the .so down into its component paths and
library name, and used -Lpath -llibname, which caused the linker to
look for path/liblibname.so
-Kenny
Bill Hoffman wrote:
Kenneth Chang wrote:
Just downloaded 2.6.4, same behavior.
Do I have to mark the .so extension so
What does your cache entry say? When you did your testing, did you
always delete the cache? Otherwise you get strange effects...
Please show us the output of something like this in your CMakeLists.txt:
message( STATUS DEBUG: ABCD_LIBRARY = '${ABCD_LIBRARY}' )
and the link command you can see
Kenneth Chang wrote:
I did, then cmake broke the .so down into its component paths and
library name, and used -Lpath -llibname, which caused the linker to
look for path/liblibname.so
It should not do that in 2.6.4, it should use the full path Do you
have any policy warnings, or do you
I manufactured a simple setup to demonstrate what I have. I hope this
helps.
Thanks,
Kenny
CMakeLists.txt
~~
CMAKE_MINIMUM_REQUIRED( VERSION 2.6.4 )
ADD_EXECUTABLE( main
main.cc
)
SET( CMAKE_SHARED_LIBRARY_PREFIX_bak ${CMAKE_SHARED_LIBRARY_PREFIX} )
SET( CMAKE_SHARED_LIBRARY_PREFIX
On Fri, Aug 14, 2009 at 05:38:06PM -0400, Kenneth Chang wrote:
SET( CMAKE_SHARED_LIBRARY_PREFIX_bak ${CMAKE_SHARED_LIBRARY_PREFIX} )
SET( CMAKE_SHARED_LIBRARY_PREFIX )
FIND_LIBRARY( THOST_LIBRARY thostmduserapi.so
PATHS /home/kchang/sandbox/thost )
SET( CMAKE_SHARED_LIBRARY_PREFIX
Kenneth Chang wrote:
I manufactured a simple setup to demonstrate what I have. I hope this
helps.
...
Is /home/kchang/sandbox/thost/thostmduserapi.so a valid object? I was
able to reproduce what you had if I did this:
cmake_minimum_required(VERSION 2.6.4)
add_executable(foo foo.c)
Perhaps something like this:
set( CMAKE_SHARED_LIBRARY_PREFIX_bak ${CMAKE_SHARED_LIBRARY_PREFIX} )
set( CMAKE_SHARED_LIBRARY_PREFIX )
find_library( ABCD_LIBRARY abcd )
set( CMAKE_SHARED_LIBRARY_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX_bak} )
target_link_libraries( a.out ${ABCD_LIBRARY} )
17 matches
Mail list logo