Linking problem with C static Library
-
Hi,
I'm trying to use the classicladder plc as a library in my sample application. Classicladder is developed using the C programming language.
But when i trying to compile , i got the linking undefined reference error , please help me guys,
@g++ -Wl,-O1 -Wl,-rpath,/opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib -o checkClassicLadder2 main.o checkclassicladder2.o moc_checkclassicladder2.o -L/opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib -L../../../Downloads/classicladder -lladder -lQtGui -L/opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib -L/usr/X11R6/lib -lQtCore -lpthread
checkclassicladder2.o: In functioncheckClassicLadder2::checkClassicLadder2(QWidget*)': checkclassicladder2.cpp:(.text+0x112): undefined reference to
ClassicLadder_AllocAll()'
checkclassicladder2.o: In functioncheckClassicLadder2::checkClassicLadder2(QWidget*)': checkclassicladder2.cpp:(.text+0x3c2): undefined reference to
ClassicLadder_AllocAll()'
collect2: ld returned 1 exit status
make: *** [checkClassicLadder2] Error 1
@thanks
-
sorry for the late reply
yes i did add the library which contains the ClassicLadder_AllocAll(). But in the library it declared with the extern keyword