1

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.

Daniel Walker
  • 6,380
  • 5
  • 22
  • 45

0 Answers0