我不能用C++编译Xcode库
I can not compile the Xcode library with C++
问题是,我需要用之前在windows中编译的macos上的makefile编译库,该库在Ubuntu上进行了测试(在那里,它与macos(编译(形成了对比(当我将makefile添加到xcodeporject并尝试构建该项目时,我得到了这个错误Xcode构建
所以我不能用这个makefile在Xcode中构建这个库。但如果我在终端的帮助下尝试这个(有相同的源文件、相同的目录、相同的make文件(它正在构建,我实际上不知道是如何构建的,但它可以工作,但当我开始运行测试时(也在终端中(它给了我这个试运行终端我是macOS和makefiles编译的新手,我知道发生了什么,请帮忙!
这是Xcode中的错误文本:Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
"_xmlCheckVersion", referenced from:
ADA::GCGxmlIO::OpenImpl(std::__1::basic_istream<char, std::__1::char_traits<char> >*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, ADA::GCGFile&) in GCGxmlIO.o
ADA::GCGxmlIO::SaveImpl(ADA::GCGxmlIO::IDeferredOstream*, ADA::GCGFile const&) in GCGxmlIO.o
"_xmlDocGetRootElement", referenced from:
ADA::GCGxmlIO::OpenImpl(std::__1::basic_istream<char, std::__1::char_traits<char> >*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, ADA::GCGFile&) in GCGxmlIO.o
"_xmlFree", referenced from:
以及运行测试时的终端错误:MacBook-Pro-Artem:gcc artem$ g++ -m32 -g -pipe -O3 -DNDEBUG -I../../../src -I/usr/include -I/usr/local/include -o ../../bin/common-wdi/apaEncode.xcodeproj ../../bin/common-wdi/obj/PDFAPI/apaEncode/encode.o ../../../bin/common-wdi/lib/PDFAPI.a ../../../bin/common-wdi/lib/ELib.a -lz
'Undefined symbols for architecture i386:'
APA::PDPage::PAGE_SIZE_LETTER", referenced from:
APA::PDPageTree::NewPage(unsigned long) in PDFAPI.a(PDPageTree.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
已经解决了,问题出现在依赖项和源代码中
- SFML在使用Xcode 11和macOS Catalina(zsh)编译后崩溃
- 我不能用C++编译Xcode库
- 将XCode升级到verison 11.1后,C++编译失败
- 某些C++标头在放入 Xcode 前缀/预编译标头时会中断构建
- C 11模板代码 - 无法在XCode中编译
- 尝试在终端(MacOSX)中编译两个.cpp文件(来自XCode)时"Duplicate symbol"
- XCode预编译标头中的C 语言的预处理器定义了什么?
- Xcode - 如何使用"-fexhaustive-register-search"进行编译 - 链接器崩溃需要
- C++静态库未在 Mac 上的 Xcode 中编译
- 如果标头位于预编译标头 xcode 中,则找不到默认模板参数
- 编译 c++ 代码时 xcode 上的线程
- 由于 LLVM 错误,Xcode 无法编译
- 在 xcode 中编译和链接 OpenCV 3.0.0 时出现问题
- 我可以在 Android Studio 中使用用 Xcode 编译的 C++ 静态库吗?
- 我可以在 BlackBerry 10 中使用 Xcode 编译的 armv7/armv7s .so 库吗?
- 从命令行编译时"error: expected expression",但不从 Xcode 编译时
- Xcode 编译C++代码,但 Eclipse 不会
- 使用XCode编译时期望的类名与类名相同的c++
- Xcode:编译而不运行
- 通过xcode编译我的代码在OSX中使用mongodb c驱动程序