undefined-reference

Undefined reference to 'dlsym' and 'dlopen'

寵の児 提交于 2019-12-04 04:19:25
I am compiling using arm-linux-gnueabi-g++ version 4.7.3. I have the arm-linux-gnueabi libraries installed at location: /usr/arm-linux-gnueabi/lib, it contains libdl.a, libdl.so, libdl.so.2, and libdl-2.19.so. libdl.so links to libdl.so.2 which links to libdl-2.19.so. I am trying to link against the dl library (see command string below), but I always get the undefined reference errors. arm-linux-gnueabi-g++ -I. -I../ -I../Comms/Linux -Wall -DLINUX -fpic -o ../../work/MyProgram main.o -L../../work -L/usr/arm-linux-gnueabi/lib -lComms -lConsole -lUtilities -ldl ../../work/libUtilities.so:

Undefined reference to 'imp____glewEnableVertexAttribArray'

两盒软妹~` 提交于 2019-12-04 02:35:08
问题 I'm trying to compile a program I am doing from a tutorial which is written in C++ and open gl 2.1. However, I don't like FreeGLUT so I decided to change the windowing program to SFML. My problem is however when I try to build the program I get these errors: obj\Debug\main.o||In function `Z6renderv':| C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|36|undefined reference to `_imp____glewUseProgram'| C:\Users\Jordanh\Documents\Code Blocks\GL_2-Lesson-1\main.cpp|37|undefined

undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5

时光怂恿深爱的人放手 提交于 2019-12-04 01:31:14
I'm trying to make a file in Ubuntu and when i make i keep getting this error: /usr/bin/ld: ../../gtest-1.7.0/libgtest.a(gtest-all.cc.o): undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5' /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[2]: *** [src/tests/run_tests] Error 1 make[1]: *** [src/tests/CMakeFiles/run_tests.dir/all] Error 2 make: *** [all] Error 2 I saw someone mentioning to go into Makefile and adding '-L /lib64 -l pthread' to the variable LDFLAGS but how do you do that? Totally

Cplex library gcc compilation link error

天大地大妈咪最大 提交于 2019-12-03 21:53:26
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.c:(.text+0x125): undefined reference to `CPXsetintparam' mipex1.c:(.text+0x222): undefined reference

Is there a sequence point between these assignments?

喜你入骨 提交于 2019-12-03 10:37:17
Is there a sequence point between the two assignments in the following code: f(f(x=1,1),x=2); The relevant quote from the (draft) standard [6.5.2.2, 10] is: The order of evaluation of the function designator, the actual arguments, and subexpressions within the actual arguments is unspecified, but there is a sequence point before the actual call. So for your expression, the first argument (in particular the call to f ) could be evaluated before the second argument; e.g.: (x = 1, 1), f <sp> call, (x = 2), f <sp> call Or, it could be evaluated after the second argument; e.g.: (x = 2), (x = 1, 1),

“undefined reference” to Virtual Base class destructor [duplicate]

泄露秘密 提交于 2019-12-03 10:31:24
This question already has answers here : What is an undefined reference/unresolved external symbol error and how do I fix it? (32 answers) Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I fix it? I have some experience with Java, and am now doing a C++ course. I wanted to try writing an interface, but I have run into some trouble with destructors which I have not been able to resolve, even with the help on the Internet... Here's my code: class Force { public: virtual ~Force(); virtual VECTOR eval(VECTOR x, double t); }; class InvSquare : public

C header issue: #include and “undefined reference”

孤人 提交于 2019-12-03 07:42:22
问题 Alright, I've been trying to work with this for the longest time, and I simply can't seem to get it to work right. I have three files, main.c , hello_world.c , and hello_world.h . For whatever reason they don't seem to compile nicely, and I really just can't figure out why... Here are my source files. First hello_world.c: #include <stdio.h> #include "hello_world.h" int hello_world(void) { printf("Hello, Stack Overflow!\n"); return 0; } Then hello_world.h, simple: int hello_world(void); And

C header issue: #include and “undefined reference”

不想你离开。 提交于 2019-12-02 22:26:05
Alright, I've been trying to work with this for the longest time, and I simply can't seem to get it to work right. I have three files, main.c , hello_world.c , and hello_world.h . For whatever reason they don't seem to compile nicely, and I really just can't figure out why... Here are my source files. First hello_world.c: #include <stdio.h> #include "hello_world.h" int hello_world(void) { printf("Hello, Stack Overflow!\n"); return 0; } Then hello_world.h, simple: int hello_world(void); And then finally main.c: #include "hello_world.h" int main() { hello_world(); return 0; } When I put it into

gcc wont compile and run MySQL C libraries

微笑、不失礼 提交于 2019-12-02 21:13:35
#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 MySQL comes with a special script called mysql_config . It provides you with useful information for compiling your MySQL client and connecting it to MySQL database server. Pass --libs option -

Is there a way to cope with undefined reference error for template functions without implementing them in header?

这一生的挚爱 提交于 2019-12-02 07:37:28
问题 I hope the problem is clear. Is there an alternative way not to get undefined reference error without implementing template functions in header files? Thanks in advance. 回答1: Marshall Cline's C++-FAQ already deals with this. One way is to use export but I don't really recommend using it because not all compilers support it really! In fact C++0x Committee has voted out export out of the next C++ Standard. 回答2: If you know in advance which all instantiations you will need, you can instantiate