When I tried to add a precompiled third-party library OpenNetVM to my CMakelists.txt of a current project, I met an issue to call the functions of the third library. The third-party library has only Makefile and it generates .a files after make. Can someone tell me what something else I missed or is there anything wrong?
Here is my CMakelists.txt code to link the library.
There is no issue when I cmake, but an issue when I build.
[ 25%] Linking CXX executable OLAS
/usr/bin/ld: CMakeFiles/OLAS.dir/main.cpp.o: in function main': main.cpp:(.text+0x18): undefined reference to onvm_nflib_stats_summary_output(unsigned short)’
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/OLAS.dir/build.make:86: OLAS] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/OLAS.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
I used an very simple CMakeLists.txt to link luajit but still have the issue to call the function. The issue is very similar to my original question.
Here are my CMakeLists.txt