undefined-reference

undefined reference to symbol even when nm indicates that this symbol is present in the shared library 2

本秂侑毒 提交于 2019-12-23 06:04:07
问题 I found same question here but the answer doesn't help me. I'm writing test app to use nglib library. But when I try to compile it I get undefined references: $ g++ test1.cpp -L. -lnglib test1.cpp: In function ‘int main()’: /tmp/cchcKZfx.o:test1.cpp:function main: error: undefined reference to 'Ng_Init()' /tmp/cchcKZfx.o:test1.cpp:function main: error: undefined reference to 'Ng_NewMesh()' ... /tmp/cchcKZfx.o:test1.cpp:function main: error: undefined reference to 'Ng_Exit()' collect2: ld

undefined reference to symbol even when nm indicates that this symbol is present in the shared library 2

蓝咒 提交于 2019-12-23 06:03:58
问题 I found same question here but the answer doesn't help me. I'm writing test app to use nglib library. But when I try to compile it I get undefined references: $ g++ test1.cpp -L. -lnglib test1.cpp: In function ‘int main()’: /tmp/cchcKZfx.o:test1.cpp:function main: error: undefined reference to 'Ng_Init()' /tmp/cchcKZfx.o:test1.cpp:function main: error: undefined reference to 'Ng_NewMesh()' ... /tmp/cchcKZfx.o:test1.cpp:function main: error: undefined reference to 'Ng_Exit()' collect2: ld

Linking error “undefined reference” about boost static library during compiling

纵然是瞬间 提交于 2019-12-23 02:33:07
问题 I am trying to compile my C++ project on Linux x64 with boost libraries 1.57. This project is compiled with scons and I successfully compiled it on my Arch Linux, but this time failed on a Ubuntu machine. I added -lboost_coroutine flag for linking but the error "undefined reference" still existed. /usr/bin/g++ -o build/gcc.release/app -pthread -g build/gcc.release/src/han/unity/rpcx.o -lpthread -lz -lboost_coroutine -lboost_context -lboost_date_time build/gcc.release/src/han/unity/rpcx.o: In

Undefined reference to log10 function

戏子无情 提交于 2019-12-22 05:58:32
问题 I am building using Eclipse Kepler, and have included math.h . However, I am getting an error 'undefined reference to log10'. Also types uint8_t and unit32_t are not being resolved. I have included both stdint.h and inttypes.h , just to be sure, but wasn't successful. Can someone kindly help? 回答1: 'undefined reference to log10'. Because, the header file only provides the forward declaration of the function. The actual function definition is present in the ("math") library. You need to link

Undefined reference to SSL_library_init and SSL_load_error_strings

强颜欢笑 提交于 2019-12-22 03:43:08
问题 I am implementing a OpenSSL code and have already included required header files but still I am getting errors like * undefined reference to SSL_library_init I guess it's a linking error rather than a compilation error. I am implementing it in Linux box using slickeditor. 回答1: Link against libssl and libcrypto . Your LDFLAGS and LDLIBS would be as follows. Order matters for LDLIBS : LDFLAGS = -L/usr/local/ssl/lib LDLIBS = -lssl -lcrypto Don't worry about adding the "lib" in front of library

Cplex library gcc compilation link error

老子叫甜甜 提交于 2019-12-21 06:40:06
问题 gcc -I/opt/cplex-studio-125/cplex/include -lcplex -L/opt/cplex-studio-125/cplex/lib/x86-64_sles10_4.1/static_pic mipex1.c I'm trying to compile an example from cplex. -I option is fine. The -L option seems to be corrupt, since it can't find the function names. Where is the error? In the specifiec link there is a libcplex.a . /tmp/ccf5sKky.o: In function `main': mipex1.c:(.text+0x9f): undefined reference to `CPXopenCPLEX' mipex1.c:(.text+0xee): undefined reference to `CPXgeterrorstring' mipex1

gcc wont compile and run MySQL C libraries

徘徊边缘 提交于 2019-12-20 10:10:51
问题 #include <my_global.h> #include <mysql.h> int main(int argc, char **argv) { printf("MySQL client version: %s\n", mysql_get_client_info()); } ~$ gcc -o mysql-test MySQL-Test.c im trying to execute this test program from terminal but get the following error message: /tmp/cceEmI0I.o: In function main': MySQL-Test.c:(.text+0xa): undefined reference to mysql_get_client_info' what is wrong? my system is ubuntu 回答1: MySQL comes with a special script called mysql_config . It provides you with useful

compile opencv2.3.1 in ubuntu 11.10

我与影子孤独终老i 提交于 2019-12-20 03:46:09
问题 Here is the tutorial I followed:http://thebitbangtheory.wordpress.com/2011/10/23/how-to-install-opencv-2-3-1-in-ubuntu-11-10-oneiric-ocelot-with-python-support/ I think the problem is ffmpeg, the version I used is 0.8.10, and I installed it in /usr and enabled share, but when I complied opencv,the output was full of ./../lib/libopencv_highgui.so.2.3.1: undefined reference to av_codec_get_id' ../../lib/libopencv_highgui.so.2.3.1: undefined reference to av_seek_frame' ../../lib/libopencv

How to link curses.h in Cmake?

萝らか妹 提交于 2019-12-20 02:06:45
问题 I know that maybe this is a silly question but I can't see through it, I searched for other answers here, that are pretty close to mine, but, still, I didn't understand how to do it. The problem is that I can't compile a 'C' program that uses curses.h in Windows (I'm using Clion with MinGW), when I try to do it, it gives "undefined reference" for functions in curses.h (Such as 'initscr', 'clear', ...). Through MinGW Installation Manager I installed "mingw-32-libpdcurses" (There were two

Getting undefined reference to std::thread::_M_start_thread

主宰稳场 提交于 2019-12-19 08:28:34
问题 I'm building an app that uses a 3rd party lib (Box2D-MT) which I build from sources. When linking, I get this undefined reference error: b2Threading.cpp:(.text._ZNSt6threadC2IM12b2ThreadPoolFviEJPS1_iEEEOT_DpOT0_[_ZNSt6threadC5IM12b2ThreadPoolFviEJPS1_iEEEOT_DpOT0_]+0xa4): undefined reference to 'std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>, void (*)())' I am building with g++ and link with -lBox2D -lpthread -lrt -ldl -lstdc++ also, I am compiling with -std=c++11