简体   繁体   中英

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

so I can't build this library in Xcode with this makefile. 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!

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:

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

'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)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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