[CMake] Problem linking to shared library (inside project) after upgrade to cmake 2.6

Yogesh Marwaha yogeshm.007 at gmail.com
Sat Jul 12 10:44:18 EDT 2008


I'm building from fresh folder.

Regards,

Yogesh M

2008/7/12 John Doe <ufnoise at gmail.com>:
> I am not sure what the compiler differences are between your projects,
> but you may want to make sure you start with a completely clean cmake
> build directory.  If the ABI changed between C++ compilers during your
> OS upgrade, some of the symbols in your library may not be recognized
> by the new compiler.
>
> Regards,
>
> Juan
>
> On Sat, Jul 12, 2008 at 7:34 AM, Philip Lowman <philip at yhbt.com> wrote:
>> On Sat, Jul 12, 2008 at 7:21 AM, Yogesh Marwaha <yogeshm.007 at gmail.com>
>> wrote:
>>>
>>> Hello, can someone figure out what I'm doing wrong.
>>> Here is the output I get when I attempt to compile: -
>>> =================================
>>> yogesh at linux-sm3q:~/gravity/New> make
>>> Scanning dependencies of target GravityCore
>>> [ 91%] Built target GravityCore
>>> Scanning dependencies of target Gravity
>>> Linking CXX executable Gravity
>>> CMakeFiles/Gravity.dir/main.o: In function `main':
>>> /home/yogesh/gravity/app/main.cpp:10: undefined reference to
>>> `GApplication::GApplication()'
>>> /home/yogesh/gravity/app/main.cpp:12: undefined reference to
>>> `Gravity::self()'
>>> /home/yogesh/gravity/app/main.cpp:12: undefined reference to
>>> `Gravity::gUIInterfaceManager() const'
>>> /home/yogesh/gravity/app/main.cpp:13: undefined reference to
>>> `GApplication::~GApplication()'
>>> collect2: ld returned 1 exit status
>>> make[2]: *** [app/Gravity] Error 1
>>> make[1]: *** [app/CMakeFiles/Gravity.dir/all] Error 2
>>> make: *** [all] Error 2
>>> =================================
>>
>> I would do a "make VERBOSE=1" and verify that CMake is linking your
>> executable against what you think it should be linking against.
>>
>> If that was not the problem, I'd have a second look at your library
>> implementations and double check that you're compiling and linking what you
>> think you're compiling and linking.  You can use "nm" or some other tool to
>> inspect the generated shared libraries and ensure that the proper symbols
>> are defined (or not defined).
>>
>> --
>> Philip Lowman
>> _______________________________________________
>> CMake mailing list
>> CMake at cmake.org
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>


More information about the CMake mailing list