linkingerrors with g++ and libraries
Hartmut Prochaska
hartmut.prochaska at gmx.net
Sat Dec 29 17:58:34 GMT 2001
Hi,
I got a problem with libraries and g++.
Preconditions
- two directories with two objects, each with its own librarys
- the object wich will be created from the other object was inserted first
in the project
then the Makefile.am file in the maindirectory (where also the main.cpp file
is located) looks like this:
######## begin of Makefile.am #########
####### kdevelop will overwrite this part!!! (begin)##########
bin_PROGRAMS = knowledgebase
knowledgebase_SOURCES = main.cpp
knowledgebase_LDADD = ./network/libnetwork.a ./global/libglobal.a
# <<<<<<<< the above line is important
SUBDIRS = docs network global
EXTRA_DIST = main.cpp connect.h init.h central.h listen.h
####### kdevelop will overwrite this part!!! (end)###########
######### end of Makefile.am #########
If I compile the project with this settings, I get the following error:
./global/libglobal.a(master.o): In function
`master::initialize_net(basic_string<char, string_char_traits<char>,
__default_alloc_template<true, 0> >, unsigned int)':
master.o(.text+0x20e): undefined reference to `watchout::watchout(unsigned
int)'
If I change the sequence in the mentioned line to
knowledgebase_LDADD = ./global/libglobal.a ./network/libnetwork.a
everything works fine.
The problem is, that this line was created automatically by kdevelop. Is it
possible to introduce a check, so that kdevelop will reorder this lines to
prevent this error?
Cheers
Hartmut
--
"The spirit of resistance to government is so valuable on certain
occasions that I wish it to be always kept alive." --Thomas Jefferson
-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«
More information about the KDevelop
mailing list