在64位osx中编译32位dylib

时间:2014-10-07 05:16:05

标签: osx-mavericks llvm-gcc

我正在尝试在Mac OS X Mavericks中编译动态库,但是当我尝试链接它时,它说:

Undefined symbols for architecture i386:
  "operator new(unsigned long, int, char const*, int)", referenced from:
     ...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我使用的编译标志:

Wall -Wextra -m32 -march=pentium4 -arch i386 -fvisibility=hidden

尝试了

-stdlib=libc++ -lstdc++ -lc++

没有帮助。

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

请帮忙!

修改

好的,缺乏关注:

ld: symbol(s) not found for architecture i386

所以,想通了这只发生在-g标志出现时:)

对于发布版本,没有错误。

出现的问题是为什么MacOS X上没有用于libc ++(operator new)的调试信息符号。有线索吗?

0 个答案:

没有答案