I build the electron app with following scripts:
script/bootstrap.py -v --target_arch x64
script/create-dist.py
The first one ends successfully, but the second one throws this error (from TeamCity log):
...skipped log entries
[02:56:38][Step 2/2]
[1315/1328] SOLINK "Electron Framework.framework/Versions/A/Electron Framework", POSTBUILDS
[02:56:38][Step 2/2]
FAILED: ../../vendor/llvm-build/Release+Asserts/bin/clang++ -shared -ObjC -stdlib=libc++ -Wl,-dead_strip -mmacosx-version-min=10.9 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -arch x86_64 -L. -install_name #rpath/Electron\ Framework.framework/Electron\ Framework -Wl,-rpath,#loader_path/Libraries -F/Users/teamcity/buildAgent/work/e4f0eac9e33806e2/external_binaries -stdlib=libc++ -o "Electron Framework.framework/Versions/A/Electron Framework" #Electron_Framework.framework.rsp
[02:56:38][Step 2/2]
ld: warning: ignoring file /Users/teamcity/buildAgent/work/e4f0eac9e33806e2/vendor/brightray/vendor/download/libchromiumcontent/static_library/libwebkit.a, file was built for archive which is not the architecture being linked (x86_64): /Users/teamcity/buildAgent/work/e4f0eac9e33806e2/vendor/brightray/vendor/download/libchromiumcontent/static_library/libwebkit.a
[02:56:38][Step 2/2]
Undefined symbols for architecture x86_64:
"blink::WebCryptoKeyAlgorithm::createRsaHashed(blink::WebCryptoAlgorithmId,
unsigned int, unsigned char const*, unsigned int, blink::WebCryptoAlgorithmId)",
referenced from:
webcrypto::(anonymous namespace)::CreateRsaHashedKeyAlgorithm(
blink::WebCryptoAlgorithmId, blink::WebCryptoAlgorithmId, evp_pkey_st*,
blink::WebCryptoKeyAlgorithm*) in libcomponents.a(rsa.o)
"blink::WebCryptoAlgorithm::rsaHashedImportParams() const", referenced from:
webcrypto::RsaHashedAlgorithm::ImportKeyPkcs8(webcrypto::CryptoData const&,
blink::WebCryptoAlgorithm const&, bool, int, blink::WebCryptoKey*) const
in libcomponents.a(rsa.o)
skipped log entries...
It looks like the library and build machine are not compatible, but both of them are x64 platforms. What else can be wrong? I put here only part of the log, because it's really very long (thousands of lines). I used to use the same steps for building 1.2.3, 1.2.8 and 1.4.3 versions and there was no problem.
Try setting the ur valid architectures in xcode..
Related
The error clang: error: linker command failed with exit code 1 (use -v to see invocation)
on running the compile example, from http://quantlib.org/install/macosx.shtml,
g++ -I/opt/local/include/ -I/opt/local/include/boost BermudanSwaption.cpp \
-o bermudanswaption -L/opt/local/lib/ -lQuantLib
Error message is:
clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin16.1.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
/opt/local/include
/opt/local/include/boost
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.12.0 -o bermudanswaption -L/opt/local/lib/ /var/folders/m3/39_h4bg52xzfv8800_zrkvrh0000gn/T/BermudanSwaption-a73fac.o -lQuantLib -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
......
"QuantLib::detail::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, QuantLib::detail::percent_holder const&)", referenced from:
calibrateModel(boost::shared_ptr<QuantLib::ShortRateModel> const&, std::__1::vector<boost::shared_ptr<QuantLib::CalibrationHelper>, std::__1::allocator<boost::shared_ptr<QuantLib::CalibrationHelper> > > const&) in BermudanSwaption-a73fac.o
_main in BermudanSwaption-a73fac.o
"QuantLib::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, QuantLib::Date const&)", referenced from:
QuantLib::InterestRateIndex::valueDate(QuantLib::Date const&) const in BermudanSwaption-a73fac.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`
What does this mean and why is LLVM invoked? I'm using latest Xcode, Mac OSX 10.12.1, familiar with python but not command line installs or compilation....
The error is very simple. You only compiled BermudanSwaption.cpp but you also need to compile the entire QuantLib. Otherwise, the linker can't find the implementation.
I have tried building poco (poco-1.4.6p4) in several ways, all seem to build fine. However, when linking against it, all the different ways I have tried to build poco give error below. No matter what I choose, it appears that poco is being built with the clang++.
What is strange is that before I upgraded from Mountain Lion to Mavericks, none of this happened.
./configure --Darwin64 --shared
and
./configure --Darwin64-gcc --shared --no-tests
and
./configure --Darwin64-clang-libc++ --shared --no-tests
All the above seem to build fine.
But when I link against any of them, they all give the error below when linking against it.
Making all in compiler
/bin/sh ../libtool --tag=CXX --mode=link g++ -g -O2 -Wall -lfix8 -lPocoFoundation -lPocoNet -lPocoUtil -L../runtime -lz -o f8c f8c.o f8cutils.o f8precomp.o
libtool: link: g++ -g -O2 -Wall -o .libs/f8c f8c.o f8cutils.o f8precomp.o -Wl,-bind_at_load /Users/ivanfigueredo/Downloads/fix8/runtime/.libs/libfix8.dylib -lpthread -lPocoFoundation -lPocoNet -lPocoUtil -L../runtime -lz
Undefined symbols for architecture x86_64:
"Poco::RegularExpression::RegularExpression(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, bool)", referenced from:
FIX8::RegExp::RegExp(char const*, int) in f8c.o
"Poco::RegularExpression::match(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, std::vector<Poco::RegularExpression::Match, std::allocator<Poco::RegularExpression::Match> >&, int) const", referenced from:
_main in f8c.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [f8c] Error 1
make: *** [all-recursive] Error 1
Configure generally will pay attention to CC and CXX environment variables to allow you to change compilers the software will build with. Try and adjust these settings.
I built the i386 flavor of OpenCV locally on my Macbook running Lion, by using
cmake -G "Unix Makefiles" -D CMAKE_OSX_ARCHITECTURES=i386 -D CMAKE_C_FLAGS=-m32 -D CMAKE_CXX_FLAGS=-m32 ..
make -j8
sudo make install
Libraries built and published fine, and I've added them to my xcode project.
However, there are link errors when building my test app, and they seem to be name mangling issues.
Undefined symbols for architecture i386:
"cv::namedWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
_main in main.o
"cv::imread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
_main in main.o
"cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)", referenced from:
_main in main.o
Taking cv::imread as an example, it is exported from libopencv_highgui.dylib with the name:
00007510 (__TEXT,__text) external __ZN2cv6imreadERKSsi
while main.o is referencing the symbol
U __ZN2cv6imreadERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEi
On the other hand, function __ZN2cv7waitKeyEi from the same dylib links fine.
Both the test app and the framework are for i386 arch.
Any ideas what might be causing this issue?
I've had the same problem. I think the issue could be that if you have used the MacPorts to compile your OpenCV libraries, they probably got built by the GCC according to it's Portfile. I switched the compiler used in the XCode (Apple LLVM 4.1) to the LLVM GCC 4.2 and now it works.
Hope it helps.
I just had the same problem and fixed it by using libstdc++ as the C++ standard library. It was defaulted to libc++
Under Project Build settings -> APPLE LLVM compiler 4.2 - Language -> C++ Standard Library
Have anyone used to do with Awesomium framework on Mac OSX? I try to create a sample project and add code in main.m, but it has error
Undefined symbols for architecture i386:
"Awesomium::WebCoreConfig::setCustomCSS(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Do you have any ideas for this error?
main.m is an Objective-C source file and std::__1::basic_string, std::__1::allocator > const& is a C++ class.
Change the name of main.m to main.mm, making it a Objective-C++ source file and try again.
Awesomium is 32 bit only (a current limitation of chromium) while Apple's compiler defaults to 64 bits these days.
You have to compile your app using -m32 (or if using Xcode setting the architecture to 32 bit only as in the link the OP posted)
Example:
clang -m32 awe_test.cpp -o test -framework Awesomium -F$(DIR_WHERE_I_HAVE_AWESOMIUM) -I$(DIR_WHERE_I_HAVE_AWESOMIUM)
I'm working with FFMPEG on Mac OSX, my Mac version is 10.6.8 (i386).
When I try to compile my C++ code linking a dynamic library:
g++ sdk.cpp -rpath /usr/local/lib/libinsight.dylib -o sdk
I get the following error:
Undefined symbols for architecture x86_64:
"_main", referenced from:
start in crt1.10.6.o
"av_open_input_file(AVFormatContext**, char const*, AVInputFormat*, int, AVFormatParameters*)", referenced from:
ffmpeg_open(AVFormatContext**, char const*, int*)in ccCkx9dd.o
(so forth fo every FFMPEG call)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
Without linking dylib I have no problem. What's the matter?
P.S. ffmpeg version is Mach-O 64-bit executable x86_64
g++ sdk.cpp -rpath /usr/local/lib/libinsight.dylib -o sdk
Shouldn't you be linking to libffmpeg somewhere? Try adding -lffmpeg to your link command line.