简体   繁体   English

我无法使用C ++编译Xcode库

[英]I can not compile the Xcode library with C++

the problem is that I need to compile the library with the makefile on macos which was compiled before in windows, the library was tested on Ubuntu (there it worked in contrast to the macOS (compiled)) When I add the makefile to xcodeporject, and try to build this project I get this error Xcode building 问题是我需要在macos上使用makefile编译该库,该文件在Windows之前已经编译过,该库已在Ubuntu上进行了测试(与macOS(已编译)相反),当我将makefile添加到xcodeporject时,并且尝试建立这个项目,我得到这个错误的Xcode建立

so I can't build this library in Xcode with this makefile. 所以我不能用这个makefile在Xcode中建立这个库。 But if I trying this with the help of terminal ( have the same source files , same directories , same make file ) it is building , I don't know actually how , but it works,but when I start running tests ( also in terminal ) it gives me this test running terminal I'm new in compiling for macOS and in makefiles , idk whats going on, help please! 但是,如果我在构建的终端(具有相同的源文件,相同的目录,相同的make文件)的帮助下尝试此操作,我实际上并不知道如何运行,但是它有效,但是当我开始运行测试时(也在终端中) )它为我提供了这个测试运行终端,我是macOS和makefile编译的新手,idk发生了什么事,请帮忙!

here is the text of errors in 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: 这是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:

and the terminal error while running tests : 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 和运行测试时出现的终端错误: 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)

已经解决了,问题出在依赖和源代码中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM