Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22015

Linker not recognizing symbols present in library [duplicate]

$
0
0

I've got an object file which I'm trying to link. It references symbols defined in a .so file which I created. My command is (something like)

gcc -L$(PWD)/some_dir -lmylibrary -o program program.o

where libmylibrary.so is found in $(PWD)/some_dir.

program.o was created with

gcc -std=gnu99 -g -O3 -c program.c -I$(SOME_DIR)

I get a linker error that the following symbols could not be found: nodeSplitSize, yyparse, programTree

However, running

nm -gD some_dir/libmylibrary.so

yields

...0000000000004d90 T nodeSplitSize...0000000000005610 T yyparse...000000000021eaa0 B programTree...

If it helps, nodeSplitSize and yyparse are functions whereas programTree is a global, uninitiated variable.


Viewing all articles
Browse latest Browse all 22015

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>