1

At linking time, I'm getting the following:

libMain.a(Object.o): In function `Object': 
Object.cpp(44): undefined reference to `Transform::MakeIdentity()'

It is definitely seen from using nm --defined-only libSystem.a

Transform.o:
00000000 T Transform::MakeIdentity()

Both libSystem.a and libMain.a are being input appropriately. Linker command line options:

-o "Game.so" -shared -Wl,-z,noexecstack "-lstdc++" "-lsupc++" "-lgnustl_static" "-lgcc" "libSystem.a" "libMain.a" -nostdlib -l"c" -l"m" -l"log" -l"gcc" -Wl,-soname,"libGame" -Wl,--no-undefined

Mike Weir
  • 3,094
  • 1
  • 30
  • 46

1 Answers1

4

The order in which you link static libraries matters. For a detailed discussion, see Why does the order in which libraries are linked sometimes cause errors in GCC?

Community
  • 1
  • 1
NPE
  • 486,780
  • 108
  • 951
  • 1,012