3

I'm trying to compile my application to link to a static library (.a file)

The command I use to build is this:

gcc -DUNIX -maix32 -o Release/bin/testApp Release/obj/main.o -ltestLib

When I build I get the following errors:

ld: 0711-317 ERROR: Undefined symbol: .test
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.

Where test is a method in libtestLib.a

Also if I try and build with a dynamic lib then it is successful.

gcc -DUNIX -maix32 -o Release/bin/testApp Release/obj/main.o libtestLib.so

Can you see where I am going wrong?

Dunc
  • 7,688
  • 10
  • 31
  • 38

1 Answers1

1

Can you try specifying a path to the archive file, rather than -ltestLib?

gcc -DUNIX -maix32 /path/to/testLib.a -o Release/bin/testApp Release/obj/main.o
Garrett
  • 47,045
  • 6
  • 61
  • 50