Libtool vs ar to create a static library (xcode linker)

Creating a static library on Mac 10.5 using xcode via libtool, and using ar via the command line generate the libMainProject.a file, however when I try to use one of them using libtool to link to the xcode application, I get a few messages like

"vtable for referenced project1: _ZTV27project1 $ non _lazy _ ptr in libMainProject.a (project1.o)"

Using ar is exactly and correctly linked. I tried adding the -c option to libtool when linking, but this does not seem to have an effect. So, I assume that I have 2 options

1) Find out what causes the character differences between the ar and libtool versions and makes libtool generate the same information.

2) Make xcode use ar instead of libtool to create static libs.

Any ideas or suggestions would be appreciated.

Thanks in advance.

+3
source share
1 answer

I suggest unlocking the static library with ar. As a result, you get the files *.o. Then use gobjdump(you may have to install it yourself from MacPorts / fink / homebrew) to find out what's inside the files *.oand compare the two versions.

+1
source

Source: https://habr.com/ru/post/1720512/


All Articles