Hi. I'm trying to compile a program and it fails in the linking phase.
The compile lines I use are:
g++ -g -O2 -D_REENTRANT -D_GNU_SOURCE -D_THREAD_DAFE -c
novraSG50_trap_app.cpp
g++ -L/usr/local/lib -ls50MgmtStatus -lccxx -lccstd -lccio -lpthread
-ldl -lz -ls50MgmtStatus -lccstd -lccxx -lccio -ldl -lz -lpthread
novraSG50_trap_app.o -o sg50trapapp
I get 'undefined reference' errors in the linking phase for functions,
objects etc. defined in the static library libs50MgmtStatus.a which I
link. I'm quite confident that the linking order is correct (that's why
I also link the libraries twice just in case) and the libraries are fine
(have been used before) and the lib path is specified. Does anybody have
an idea what the error might be? Any info/help would be greatly
appreciated. Thanks.
The linking output is:
novraSG50_trap_app.o: In function
`waitUntilNewStatusPacketReceived(unsigned&, S50MgmtStatus)':
/root/trap_apps_dir/novraSG50_trap_app.cpp:246: undefined reference to
`S50MgmtStatus::getCurrPktCount()'
/root/trap_apps_dir/novraSG50_trap_app.cpp:264: undefined reference to
`S50MgmtStatus::getCurrPktCount()'
/root/trap_apps_dir/novraSG50_trap_app.cpp:267: undefined reference to
`S50MgmtStatus::~S50MgmtStatus()'/root/trap_apps_dir/novraSG50_trap_app.cpp
undefined reference to
`S50MgmtStatus::~S50MgmtStatus()'novraSG50_trap_app.o: In function
`waitOnFirstStatusPacketRequest(unsigned&, S50MgmtStatus)':
/root/trap_apps_dir/novraSG50_trap_app.cpp:287: undefined reference to
`S50MgmtStatus::getCurrPktCount()'
/root/trap_apps_dir/novraSG50_trap_app.cpp:297: undefined reference to
`S50MgmtStatus::getCurrPktCount()'
/root/trap_apps_dir/novraSG50_trap_app.cpp:297: undefined reference to
`S50MgmtStatus::~S50MgmtStatus()'/root/trap_apps_dir/novraSG50_trap_app.cpp
undefined reference to
`S50MgmtStatus::~S50MgmtStatus()'novraSG50_trap_app.o: In function
`dataLockLossNotification_func(void*)':
/root/trap_apps_dir/novraSG50_trap_app.cpp:394: undefined reference to
`S50MgmtStatus::S50MgmtStatus(unsigned short, unsigned)'
/root/trap_apps_dir/novraSG50_trap_app.cpp:395: undefined reference to
`S50MgmtStatus::start()'
/root/trap_apps_dir/novraSG50_trap_app.cpp:452: undefined reference to
`S50MgmtStatus::isDataLocked()'
/root/trap_apps_dir/novraSG50_trap_app.cpp:468: undefined reference to
`S50MgmtStatus::~S50MgmtStatus()'collect2: ld returned 1 exit status