the ".a" library and it's functions not recognized after being added to project
-
Hello to all fellow community members
i've just added a ".a" library made out of a cpp file to my project . the library is created within my project using these lines:
//=================
TEMPLATE = lib
CONFIG += staticlib
//=================then i tried to add this library to the same project and the functions of library are NOT recognized, causing errors like undefined reference to functions.
in .pro file, these lines are added to locate and define the library (done by "add library" wizard)
//===================================================================================
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../Calibration/release/ -lCalibration
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../Calibration/debug/ -lCalibration
else:unix: LIBS += -L$$OUT_PWD/../Calibration/ -lCalibrationINCLUDEPATH += $$PWD/../Calibration
DEPENDPATH += $$PWD/../Calibrationwin32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../Calibration/release/libCalibration.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../Calibration/debug/libCalibration.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../Calibration/release/Calibration.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../Calibration/debug/Calibration.lib
else:unix: PRE_TARGETDEPS += $$OUT_PWD/../Calibration/libCalibration.a
//===================================================================================what am i doing wrong?
feel free to ask for more info.Regards
Seyed -
Hi and welcome to devnet,
Just to be sure I understand correctly, are you using a SUBDIRS based project ?
If so, are you sure you are building them in the correct order ?
-
Hi and welcome to devnet,
Just to be sure I understand correctly, are you using a SUBDIRS based project ?
If so, are you sure you are building them in the correct order ?
@SGaist thanks for reply
the project tree looks like this:
each subdirectory has it's own .pro , source and headers folder.
there are some cpp files in "api" section which i'm trying to convert them to "one" library to avoid exposing some sources and use that library in "example" files. there are classes, functions in the "api" .and i didn't quite understand. you meant the correct order of creating subdirs or the library?
-
Solved. i just didn't placed all the required ".h" headers in the new project.
-
Glad you found out :-)
Please mark the thread as solved so other forum users may know a solution has been found :-)
-
-
Glad you found out :-)
Please mark the thread as solved so other forum users may know a solution has been found :-)
@SGaist done