-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sep 9, 2007, at 11:34 AM, Charles Connell wrote:

> On Sunday 09 September 2007 12:28, Michael Zanetti wrote:
>> Hello,
>>
>> I'm trying to port the OTR plugin to the new QT4/KDE4/Kopete-svn  
>> Interface.
>>
>> I used am2cmake to generate CMakeLists.txt. After some changes in  
>> this file
>> I started porting the code. It is now in a stage where it compiles  
>> fine
>> with the new API and cmake. But while linking, cmake cannot find  
>> any of the
>> Kopete's and KDE's libraries.
>>
>> src/CMakeLists.txt says:
>> link_directories( ${KDE4_LIB_DIR} ${KDE4_LIB_DIR}/kde4
>> ${CMAKE_CURRENT_BINARY_DIR} )
> change this to:
> link_directories( $KDE4_LIB_DIR ... ${CMAKE_CURRENT_BINARY_DIR}  
> kopete )
> this will add a -lkopete to the link command
>

Yes, I suppose that's what it will do, but that's not the right way  
to do it. link_directories is for specifying -L options to the  
compiler, not -l options (there is a difference)

> btw, I dont think all those link directories are necessary
>

no, they're not, in fact, ${KDE_LIB_DIR}/kde4 is wrong. You should  
remove that line. You shouldn't be linking to things in $ 
{KDE_LIB_DIR}/kde4

>>
>> build/CMakeFiles/kotr.dir/link.txt says:
>> /usr/bin/c++  -fPIC   -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef
>> -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat- 
>> security
>> -fno-exceptions -fno-check-new -fno-common -fvisibility=hidden -O2 -g
>> -Wl,--fatal-warnings -Wl,--no-undefined -lc  -shared
>> -Wl,-soname,libkotr.so.1 -o lib/libkotr.so.1.0.0
>> "CMakeFiles/kotr.dir/kotr_automoc.o"
>> "CMakeFiles/kotr.dir/otrlchatinterface.o"
>> "CMakeFiles/kotr.dir/otrlconfinterface.o" -L/usr/local/lib
>> -L/usr/kde/svn/lib -L/usr/kde/svn/lib/kde4
>> -L/home/dreadhead/Develop/4kopete_otr/kopete_otr/trunk/kopete_otr/ 
>> build
>> -L/usr/lib/qt4 -lQtCore -lpthread -lQtNetwork -lQtDBus -lQtXml - 
>> lutil -lz
>> -lresolv -lkdecore -lotr
>>
>> As you can see the directories "/usr/kde/svn/lib/" and
>> "/usr/kde/svn/lib/kde4" are included in the link-call and all KDE4  
>> and
>> Kopete-stuff is installed there. But when executing this command  
>> cmake
>> fails with hundreds of error messages like this:
>> undefined reference to `Kopete::ChatSession::members() const'
>> undefined reference to `Kopete::Contact::contactId() const'
>> ...
>>
>> Could anyone please help me solving this issue?
>>
>> Thanks!
>> Michael

You're missing an -lkopete line in your line command.
You should have a "target_link_libraries" function in your  
CMakeLists.txt file. Add a kopete entry to that list. It'll probably  
end up looking something like:

target_link_libraries( <target-name> <other-libs> kopete )

where <target-name> and <other-libs> is the name of the target and  
the additional libraries you're also linking to, respectively.

Hope this helps
- --
Matt


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)

iD8DBQFG5CTsA6Vv5rghv0cRAoKJAJ0aiqDKfho3cCkO52FP1DEjHXjm9wCfTULI
KPJJmViis5PoYQ/8OsgpOsE=
=Pifh
-----END PGP SIGNATURE-----
_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to