引用静态库出现Undefined symbols for architecture arm64

Undefined symbols for architecture arm64:

"CvSVM::CvSVM()", referenced from:

  DumbbellRecognize::DumbbellRecognize() in libend.a(dumrecognize.o)

"CvSVM::~CvSVM()", referenced from:
DumbbellRecognize::DumbbellRecognize() in libend.a(dumrecognize.o)
DumbbellRecognize::~DumbbellRecognize() in libend.a(dumrecognize.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
在xcode中编写iOS程序,想试一下自己编的静态库能不能用,但是一旦引用了静态库的接口就出错,在试了网上的很多方法都不行,有没有大佬知道问题出在opencv的静态链接还是哪?

ios

1个回答

not found for architecture arm64
你引用的这个库不支持arm64架构吧

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Undefined symbols for architecture x86_64

请大神帮忙看看,用Xcode里的C++自己写了扩展的队列数据结构出现Undefined symbols for architecture x86_64 问题 第一次尝试写类模板 不知道是什么原因出现这种问题 请大神帮忙看看 ![![![图片说明](https://img-ask.csdn.net/upload/201503/18/1426665647_558607.png)图片说明](https://img-ask.csdn.net/upload/201503/18/1426665686_207792.png)图片说明](https://img-ask.csdn.net/upload/201503/18/1426665680_265907.png)

IOS - Undefined symbols for architecture x86_64

如下图所示: ![图片说明](https://img-ask.csdn.net/upload/201710/18/1508334977_676191.png) 不知道故障该如何排查,请各位大神不吝指导。

指令集与错误Undefined symbols for architecture arm64

先说环境:xcode7.3.1,真机9.3.2版本、真机8.4版本 第三方使用cocoaPods管理。 报错如下图: ![图片说明](https://img-ask.csdn.net/upload/201606/14/1465913646_511109.png) 我在模拟器上设置 Build Active Architecture Only的debug为yes,release为NO。 Valid architectures添加arm64 模拟器和真机9.3.2版本正常。 真机8.4上报错16个错误。 设置Build Active Architecture Only全NO,Valid architectures添加arm64报错同上。 设置Build Active Architecture Only的debug为yes,release为NO, Valid architectures移除arm64只报错一个。 设置设置Build Active Architecture Only全NO Valid architectures移除arm64 真机8.4版本正常。 这种临时解决方法能提交AppStore吗? 为什么会这么报错,有什么方法彻底解决? 在终端使用命令: find . -name *.a -exec lipo -info "{}" \;查看第三方是否支持arm64 结果如下: Architectures in the fat file: ./Pods/JPush/lib/libjpush-ios-2.1.7.a are: armv7 armv7s i386 x86_64 arm64 Architectures in the fat file: ./xinetong/Ctrls/OfficeCtrl/AdOfficeCtrl/TempCode0525/Schedule/AgoraSDK/libagora_fat.a are: armv7 i386 x86_64 arm64 Architectures in the fat file: ./xinetong/Ctrls/OfficeCtrl/AdOfficeCtrl/TempCode0525/Schedule/AgoraSDK/libagoradep_fat.a are: armv7 i386 x86_64 arm64 Architectures in the fat file: ./xinetong/Ctrls/OfficeCtrl/AdOfficeCtrl/TempCode0525/Schedule/AgoraSDK/libCrasheye.a are: armv7 i386 x86_64 arm64 备注:已经爬贴50+才问的。

undefined symbols for architecture x86_64

求解 谢谢大大 ![图片说明](https://img-ask.csdn.net/upload/201605/19/1463670474_33846.jpg)

Error on Xcode10, Undefined symbols for architecture armv64

当我使用xcode10编译从unity输出的示例项目时,我得到了一个下面的错误,示例项目可以在xcode9.4.1上编译,但是使用xcode10会产生错误 我已经导入了libiPhone-lib.a在Libraries,但仍然有同样的错误,我该怎么去解决这个问题?

mac编译C语言出现symbol not found for architecture x86_64

我是在mac电脑的终端直接make all的,有makefile文件 Undefined symbols for architecture x86_64: "_test_yylex_internal", referenced from: _main in test_yylex-23b473.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 求问大神怎么解决啊?在学校的电脑上是可以运行的

2 duplicate symbols for architecture arm64

![图片说明](https://img-ask.csdn.net/upload/201610/10/1476085149_114563.png) 求助大神给看看这是什么原因

Mac symbol(s) not found for architecture x86_64 ?

Mac编译 symbol(s) not found for architecture x86_64 ?修改 uname Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64 gcc -lncurses -o "veto_mq_server" ./src/veto_mq_server.o Undefined symbols for architecture x86_64: "_zmq_bind", referenced from: _main in veto_mq_server.o "_zmq_ctx_new", referenced from: _main in veto_mq_server.o "_zmq_recv", referenced from: _main in veto_mq_server.o "_zmq_send", referenced from: _main in veto_mq_server.o "_zmq_socket", referenced from: _main in veto_mq_server.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 引用了第三方库ZMQ /usr/local/include/ -rw-r--r--@ 1 root admin 844 Mar 10 15:00 zmq_utils.h -rw-r--r--@ 1 root admin 16613 Mar 10 15:00 zmq.h /usr/local/lib/ lrwxr-xr-x 1 yanrui admin 43 Mar 18 2015 libzmq.4.dylib -> ../Cellar/zeromq/4.0.5_2/lib/libzmq.4.dylib -rwxr-xr-x 1 root admin 958 Mar 10 15:00 libzmq.la lrwxr-xr-x 1 root admin 14 Mar 10 15:00 libzmq.dylib -> libzmq.5.dylib -rw-r--r-- 1 root admin 23545352 Mar 10 15:00 libzmq.a -rwxr-xr-x 1 root admin 602308 Mar 10 15:00 libzmq.5.dylib ![图片说明](https://img-ask.csdn.net/upload/201603/11/1457661164_327576.png)

xcode architecture x86_64问题

Undefined symbols for architecture x86_64: "_crc32", referenced from: -[ZipArchive addFileToZip:newname:] in ZipArchive.o _zipWriteInFileInZip in zip.o _unzReadCurrentFile in unzip.o "_deflate", referenced from: _zipWriteInFileInZip in zip.o _zipCloseFileInZipRaw in zip.o "_deflateEnd", referenced from: _zipCloseFileInZipRaw in zip.o "_deflateInit2_", referenced from: _zipOpenNewFileInZip3 in zip.o "_get_crc_table", referenced from: _zipOpenNewFileInZip3 in zip.o _unzOpenCurrentFile3 in unzip.o "_inflate", referenced from: _unzReadCurrentFile in unzip.o "_inflateEnd", referenced from: _unzCloseCurrentFile in unzip.o "_inflateInit2_", referenced from: _unzOpenCurrentFile3 in unzip.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

xcode编写c++求助 architecture x86_64

本人小白,http://blog.sina.com.cn/s/blog_470740c80100y45c.html 按照此方法并没有解决,求助各位前辈![图片说明](https://img-ask.csdn.net/upload/201605/13/1463102768_226183.png)![图片说明](https://img-ask.csdn.net/upload/201605/13/1463102797_376180.png)

在macOS Sierra上使用cgo的库的“架构x86_64的未定义符号:”

<div class="post-text" itemprop="text"> <p>I am trying to make use of a library, <a href="https://github.com/go-steem/rpc" rel="nofollow noreferrer">https://github.com/go-steem/rpc</a>, that makes use of some C code, which references a library.</p> <p>The C library can be found here, <a href="https://github.com/bitcoin-core/secp256k1" rel="nofollow noreferrer">https://github.com/bitcoin-core/secp256k1</a></p> <p>I followed the steps to get that installed</p> <pre><code>$ ./autogen.sh $ ./configure $ make $ ./tests $ sudo make install # optional </code></pre> <p>And have this output;</p> <pre><code>$ sudo make install Password: CC src/libsecp256k1_la-secp256k1.lo CCLD libsecp256k1.la CC src/tests-tests.o CCLD tests CC src/exhaustive_tests-tests_exhaustive.o CCLD exhaustive_tests build-aux/install-sh -c -d '/usr/local/lib' /bin/sh ./libtool --mode=install /usr/bin/install -c libsecp256k1.la '/usr/local/lib' libtool: install: /usr/bin/install -c .libs/libsecp256k1.0.dylib /usr/local/lib/libsecp256k1.0.dylib libtool: install: (cd /usr/local/lib &amp;&amp; { ln -s -f libsecp256k1.0.dylib libsecp256k1.dylib || { rm -f libsecp256k1.dylib &amp;&amp; ln -s libsecp256k1.0.dylib libsecp256k1.dylib; }; }) libtool: install: /usr/bin/install -c .libs/libsecp256k1.lai /usr/local/lib/libsecp256k1.la libtool: install: /usr/bin/install -c .libs/libsecp256k1.a /usr/local/lib/libsecp256k1.a libtool: install: chmod 644 /usr/local/lib/libsecp256k1.a libtool: install: /usr/bin/ranlib /usr/local/lib/libsecp256k1.a build-aux/install-sh -c -d '/usr/local/include' /usr/bin/install -c -m 644 include/secp256k1.h '/usr/local/include' build-aux/install-sh -c -d '/usr/local/lib/pkgconfig' /usr/bin/install -c -m 644 libsecp256k1.pc '/usr/local/lib/pkgconfig' </code></pre> <p>I try to run the upvote example from that Go library, go-steem/rpc/examples/upvote/ and get the following output;</p> <pre><code>$ go run main.go # github.com/go-steem/rpc/transactions ../../transactions/signing.c:5:10: fatal error: 'secp256k1.h' file not found </code></pre> <p>Already it feels as though the wheels are falling off...</p> <p>Please bear with me as I do not develop in C, so I get a bit hack-y.</p> <p>After much reading, and googling I decide to copy the files from the 'include' directory where I compiled libsecp256k1 into the same directory as the error is originating from.</p> <p>You can see the files are not there;</p> <pre><code>$ ls -la ../../transactions/ total 48 drwxr-xr-x 8 shaunmorrow staff 272 May 8 18:09 . drwxr-xr-x 15 shaunmorrow staff 510 May 8 18:09 .. -rw-r--r-- 1 shaunmorrow staff 256 Apr 27 17:53 chains.go -rw-r--r-- 1 shaunmorrow staff 3731 May 8 18:09 signed_transaction.go -rw-r--r-- 1 shaunmorrow staff 1849 May 8 18:09 signed_transaction_test.go -rw-r--r-- 1 shaunmorrow staff 3075 Apr 27 17:53 signing.c -rw-r--r-- 1 shaunmorrow staff 408 Apr 27 17:53 signing.h -rw-r--r-- 1 shaunmorrow staff 1049 May 8 18:09 transactions.go </code></pre> <p>and after the copy;</p> <pre><code>$ ls -la ../../transactions/ total 128 drwxr-xr-x 11 shaunmorrow staff 374 Jul 18 19:08 . drwxr-xr-x 15 shaunmorrow staff 510 May 8 18:09 .. -rw-r--r-- 1 shaunmorrow staff 256 Apr 27 17:53 chains.go -rw-r--r-- 1 shaunmorrow staff 27071 Jul 18 19:08 secp256k1.h -rw-r--r-- 1 shaunmorrow staff 1014 Jul 18 19:08 secp256k1_ecdh.h -rw-r--r-- 1 shaunmorrow staff 4700 Jul 18 19:08 secp256k1_recovery.h -rw-r--r-- 1 shaunmorrow staff 3731 Jul 18 19:05 signed_transaction.go -rw-r--r-- 1 shaunmorrow staff 1849 May 8 18:09 signed_transaction_test.go -rw-r--r-- 1 shaunmorrow staff 3075 Apr 27 17:53 signing.c -rw-r--r-- 1 shaunmorrow staff 408 Apr 27 17:53 signing.h -rw-r--r-- 1 shaunmorrow staff 1049 May 8 18:09 transactions.go </code></pre> <p>Now I get a new error;</p> <pre><code>$ go run main.go # github.com/go-steem/rpc/transactions ld: library not found for -lsecp256k1 clang: error: linker command failed with exit code 1 (use -v to see invocation) </code></pre> <p>This has me reading and googling some more,</p> <p>Finally I get even more hack-y and change transactions.go;</p> <pre><code>// #cgo LDFLAGS: -lsecp256k1 // #include &lt;stdlib.h&gt; // #include "signing.h" import "C" </code></pre> <p>becomes</p> <pre><code>// #cgo LDFLAGS: -L/usr/local/lib // #include &lt;stdlib.h&gt; // #include "signing.h" import "C" </code></pre> <p>which fails, output on that later</p> <p>I also try;</p> <pre><code>// #cgo LDFLAGS: -L/usr/local/lib -I/usr/local/include // #include &lt;stdlib.h&gt; // #include "signing.h" import "C" </code></pre> <p>and copy the .h files into the /usr/local/include directory.</p> <p>None of this works and now I am stuck with an error like this</p> <pre><code>$ go run main.go # github.com/go-steem/rpc/transactions ld: library not found for -lsecp256k1 clang: error: linker command failed with exit code 1 (use -v to see invocation) ShaunsSePc-2:upvote shaunmorrow$ go run main.go # github.com/go-steem/rpc/transactions Undefined symbols for architecture x86_64: "_secp256k1_context_create", referenced from: _sign_transaction in signing.o _verify_recoverable_signature in signing.o "_secp256k1_context_destroy", referenced from: _sign_transaction in signing.o _verify_recoverable_signature in signing.o "_secp256k1_ec_pubkey_serialize", referenced from: _verify_recoverable_signature in signing.o "_secp256k1_ecdsa_recover", referenced from: _verify_recoverable_signature in signing.o "_secp256k1_ecdsa_recoverable_signature_convert", referenced from: _verify_recoverable_signature in signing.o "_secp256k1_ecdsa_recoverable_signature_parse_compact", referenced from: _verify_recoverable_signature in signing.o "_secp256k1_ecdsa_recoverable_signature_serialize_compact", referenced from: _sign_transaction in signing.o "_secp256k1_ecdsa_sign_recoverable", referenced from: _sign_transaction in signing.o "_secp256k1_ecdsa_verify", referenced from: _verify_recoverable_signature in signing.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) </code></pre> <p>At this point I really have no idea how to continue.</p> <p>As you can see I am not experienced in C at all and have no idea how to test if the library <code>libsecp256k1</code> is even installed properly!</p> <p>This is where I ended up, but it's highly likely I took a wrong turn early in my journey, I would appreciate any help given as I have been struggling with this for a few nights already now :( </p> <p>Not sure whats needed so here some env variables</p> <pre><code>$ go env GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/shaunmorrow/Work/go/" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/86/hlqptn5101z5bcydjz05qy8m0000gn/T/go-build689438019=/tmp/go-build -gno-record-gcc-switches -fno-common" CXX="clang++" CGO_ENABLED="1" PKG_CONFIG="pkg-config" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" </code></pre> <p>Version is <strong>go version go1.8.3 darwin/amd64</strong> with no old versions lying around.</p> <p>Thanks!</p> </div>

前往:构建时如何显式链接到OS X框架?

<div class="post-text" itemprop="text"> <p>When trying to get and build goose on OS X 10.10.3 using <code>go get bitbucket.org/liamstask/goose/cmd/goose</code> I get this error:</p> <pre><code>Undefined symbols for architecture x86_64: "_SecKeychainItemExport", referenced from: _FetchPEMRoots in 000001.o "_SecTrustCopyAnchorCertificates", referenced from: _FetchPEMRoots in 000001.o ld: symbol(s) not found for architecture x86_64 </code></pre> <p>I figure this error being due to the Security framework in OS X not being linked. Some possibly related info here: <a href="https://github.com/golang/go/issues/11258" rel="nofollow">https://github.com/golang/go/issues/11258</a></p> <p>So, how can I link to this library explicitly? Or is there something else I am missing?</p> <p>Thankful for help!</p> </div>

使用Golang进行Mac交叉编译(或替代)

<div class="post-text" itemprop="text"> <p>Ok so I'm trying to compile my <a href="http://www.awesomium.com/" rel="nofollow">Awesomium</a> go <a href="https://github.com/hydroflame/gosomium" rel="nofollow">wrapper</a> on my mac (everything works fine on linux). My problem is, when I try to compile I get</p> <blockquote> <p>ld: warning: ignoring file /Library/Frameworks//Awesomium.framework/Awesomium, file was built for i386 which is not the architecture being linked (x86_64): /Library/Frameworks//Awesomium.framework/Awesomium Undefined symbols for architecture x86_64:</p> </blockquote> <p>Fine. But that raises a few questions. First, I didn't have the option to download a x86_64 version for Mac, it was "the mac version" no architecture. Second, I checked a few other libraries and it seems like nothing is built x86_64.<br> Now I thought maybe I could make a i386 version just for osx but it seems it's extremely difficult, some say impossible, to cross compile cgo. </p> <p>What are my options?</p> </div>

关于XCODE添加AFNetWorking和ASIHttpRequest库的问题

按照网上的流程添加库文件和框架,compile sources对相关.m文件添加了-fno-objc-orc,link Binary with library相关库也添加了,可就是报错“undefined symbols for architecture i386:"-[ASIHTTPRequest attemptToApplyProxyCredentialsAndResume] in ASIHTTPRequest.o...”,65个错误。 添加AFNetWorking时也是报错“Undefined symbols for architecture i386:"_SecCertificateCopyData",referenced from:-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o 求大神指点

使用FFmpeg一直出错,求解决

之前找不到文件,那些东西都处理完了以后就一直报这些错 Undefined symbols for architecture x86_64: "_av_frame_get_best_effort_timestamp", referenced from: -[KxMovieDecoder handleVideoFrame] in KxMovieDecoder.o -[KxMovieDecoder handleAudioFrame] in KxMovieDecoder.o "_av_frame_get_pkt_duration", referenced from: -[KxMovieDecoder handleVideoFrame] in KxMovieDecoder.o -[KxMovieDecoder handleAudioFrame] in KxMovieDecoder.o "_swr_alloc_set_opts", referenced from: -[KxMovieDecoder openAudioStream:] in KxMovieDecoder.o "_swr_convert", referenced from: -[KxMovieDecoder handleAudioFrame] in KxMovieDecoder.o "_swr_free", referenced from: -[KxMovieDecoder openAudioStream:] in KxMovieDecoder.o -[KxMovieDecoder closeAudioStream] in KxMovieDecoder.o "_swr_init", referenced from: -[KxMovieDecoder openAudioStream:] in KxMovieDecoder.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Linux下将静态库编译成动态库的问题

使用JNI技术时,需要将第三方提供的静态库编译成动态库,在编译过程中遇到问题,使用gcc进行编译链接: gcc -I/home/jichenxiao/java/jdk1.8.0_11/include -I/home/jichenxiao/java/jdk1.8.0_11/include/linux -fPIC -shared -o libAir.so AirConditioner.c -L. -Wl,--whole-archive -lBLNetwork-linux-64 -Wl,--no-whole-archive -lpthread -lrt -lm 其中/home/jichenxiao/java/jdk1.8.0_11/include和/home/jichenxiao/java/jdk1.8.0_11/include/linux为jni.h和jni_md.h的路径,libAir.so为输出的动态库,AirConditioner.c为要一起编译的c程序,-lBLNetwork-linux-64为要编译成动态库的静态库文件libBLNetwork-linux-64.a。编译时报的错误为: /usr/bin/ld: ./libBLNetwork-linux-64.a(aes.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC ./libBLNetwork-linux-64.a(aes.o): error adding symbols: Bad value collect2: error: ld returned 1 exit status 我不懂编译原理,请教大家,希望大家能给出解决方案,谢谢!

什么报错?怎么解决?编译原理

Undefined symbols for architecture x86_64: "_semantic_Analysis0", referenced from: _yyparse in parser-987681.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

GDB远程调试warning: Could not load shared library symbols for /lib/libc.so.6.

问题描述: DGB不能远程调试。 * 使用的交叉编译工具:gcc 版本 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) * C代码: 简单的HelloWorld! #include <stdio.h> int main(){ printf("Hello World!"); return 0; } * 编译: arm-linux-gnueabihf-gcc -g main.c -o remote_debug * 将编译好的二进制文件remote_debug拷贝到ARM下,尝试运行程序:./remote_debug,没有问题。启动调试 :gdbserver :6666 remote_debug,到这里一切正常,ARM板提示监听6666端口。 * Ubnutu下启动GDB客户端:arm-linux-gnueabihf-gdb remote_debug * 下面是GDB操作过程: GNU gdb (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) 7.5-2012.12 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf". For bug reporting instructions, please see: <https://bugs.launchpad.net/gcc-linaro>... Reading symbols from /home/wgco/qtwork/remote_debug/remote_debug...done. # (gdb) target remote 192.168.0.200:6666 Remote debugging using 192.168.0.200:6666 Reading symbols from /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.3...(no debugging symbols found)...done. Loaded symbols for /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.3 0x40000c80 in ?? () from /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.3 # (gdb) c Continuing. warning: Could not load shared library symbols for /lib/libc.so.6. Do you need "set solib-search-path" or "set sysroot"? Program received signal SIGILL, Illegal instruction. 0x4000270c in ?? () from /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.3 # (gdb) q A debugging session is active. Inferior 1 [process 906] will be killed. Quit anyway? (y or n) y * 根据以上信息,有一条警告warning: Could not load shared library symbols for /lib/libc.so.6. 。但是在ARM板的/lib/目录下是有libc.so.6这个文件的,不知道为什么调试的时候不能加载?

在cgo库中链接第三方静态库

<div class="post-text" itemprop="text"> <p>I have a Go library that provides bindings for the C++ <a href="https://github.com/OpenImageIO/oiio" rel="nofollow">OpenImageIO</a> library (<a href="https://github.com/justinfx/openimageigo" rel="nofollow">OpenImageiGO</a>). I've been happily building my bindings via the standard dynamic linking to libOpenImageIO, but am now trying to link statically. I'm running into an issue where no matter which combination of flags I try, the external linker fails with a ton of "undefined reference" errors. I seem to recall seeing this issue raised in the past, saying that there was an issue regarding the order in which the linker saw the symbols. But I can't seem to find this information again.</p> <p>Here is a brief example of my most recent build attempt, trying to get it to link against static builds of boost, OpenColorIO, and OpenImageIO :</p> <pre><code>$ export CGO_CPPFLAGS="\ -I/path/to/boost/include \ -I/path/to/OpenColorIO/include \ -I/path/to/OpenImageIO/include" $ export CGO_LDFLAGS="\ -L/path/to/boost/lib -lboost_thread_static -lboost_system_static \ -L/path/to/OpenColorIO/lib -lopencolorio \ -L/path/to/OpenImageIO/lib -lOpenImageIO" $ go build -v -x --ldflags '-extldflags "-static"' github.com/justinfx/openimageigo ... CGO_LDFLAGS="/path/to/boost/lib/libboost_system_static.a" "/path/to/boost/lib/libboost_thread_static.a" "/path/to/OpenColorIO/lib/libopencolorio.a" "/path/to/OpenImageIO/lib/libOpenImageIO.a" "-lstdc++" /vol/apps/go/1.3.0/pkg/tool/linux_amd64/cgo -objdir $WORK/github.com/justinfx/openimageigo/_obj/ -- -I/path/to/boost/include -I/path/to/OpenColorIO/include -I/path/to/OpenImageIO/include -I./cpp -I $WORK/github.com/justinfx/openimageigo/_obj/ -I/path/to/boost/include -I/path/to/OpenColorIO/include -I/path/to/OpenImageIO/include color.go imagebuf.go imagebufalgo.go imagecache.go imageinput.go imageoutput.go imagespec.go oiio.go roi.go ... /usr/bin/g++ -I . -fPIC -m64 -pthread -fmessage-length=0 -I/path/to/boost/include -I/path/to/OpenColorIO/include -I/path/to/OpenImageIO/include -I./cpp -I $WORK/github.com/justinfx/openimageigo/_obj/ -g -O2 -o $WORK/github.com/justinfx/openimageigo/_obj/all.cpp.o -c ./all.cpp /usr/bin/g++ -I . -fPIC -m64 -pthread -fmessage-length=0 -o $WORK/github.com/justinfx/openimageigo/_obj/_cgo_.o $WORK/github.com/justinfx/openimageigo/_obj/_cgo_main.o $WORK/github.com/justinfx/openimageigo/_obj/_cgo_export.o $WORK/github.com/justinfx/openimageigo/_obj/color.cgo2.o $WORK/github.com/justinfx/openimageigo/_obj/imagebuf.cgo2.o $WORK/github.com/justinfx/openimageigo/_obj/imagebufalgo.cgo2.o $WORK/github.com/justinfx/openimageigo/_obj/imagecache.cgo2.o $WORK/github.com/justinfx/openimageigo/_obj/imageinput.cgo2.o $WORK/github.com/justinfx/openimageigo/_obj/imageoutput.cgo2.o $WORK/github.com/justinfx/openimageigo/_obj/imagespec.cgo2.o $WORK/github.com/justinfx/openimageigo/_obj/oiio.cgo2.o $WORK/github.com/justinfx/openimageigo/_obj/roi.cgo2.o $WORK/github.com/justinfx/openimageigo/_obj/all.cpp.o /path/to/boost/lib/libboost_system_static.a /path/to/boost/lib/libboost_thread_static.a /path/to/OpenColorIO/lib/libopencolorio.a /path/to/OpenImageIO/lib/libOpenImageIO.a -lstdc++ </code></pre> <p>And here are some of the cherry-picked errors, since it was a very long bit of output:</p> <pre><code>/path/to/OpenImageIO/lib/libOpenImageIO.a(OpenImageIO_dist^src^libOpenImageIO^color_ocio.cpp.o): In function `ColorConfig': /path/to/OpenImageIO/OpenImageIO_dist/src/libOpenImageIO/color_ocio.cpp:141: undefined reference to `OpenColorIO::v1::SetLoggingLevel(OpenColorIO::v1::LoggingLevel)' ... /path/to/OpenImageIO/lib/libOpenImageIO.a(OpenImageIO_dist^src^libOpenImageIO^imagebufalgo_copy.cpp.o): In function `boost::shared_mutex::lock()': /path/to/boost/include/boost/thread/pthread/shared_mutex.hpp:138: undefined reference to `boost::this_thread::disable_interruption::~disable_interruption()' </code></pre> <p>OpenImageIO can't seem to find references for OpenColorIO. And, OpenImageIO can't seem to find references for boost. It appears like the order in which things are happening during the linking isn't making the OpenColorIO or boost symbols available to OpenImageIO, so I get a bunch of symbol errors.</p> <p>I'm hoping I am doing something simple and stupid that can be corrected in my build process. But the cgo static linking with external libs does seem a touch more complicated than the default dynamic linking approach. </p> <h2>Update #1</h2> <p>The answer given by @james-henstridge was right on, and I am almost fully built, except for one last hiccup. I'm getting failing references for <code>yaml-cpp</code>, needed by <code>OpenColorIO</code>, even though it seems I have the correct order.</p> <p>Here is my latest env, where I have worked through all of the explicit static libs that had to be added:</p> <pre><code>$ export CGO_CPPFLAGS="-I/usr/local/include -I/usr/include" $ export CGO_LDFLAGS="\ -L/usr/local/lib \ -L/usr/lib \ -L/usr/lib/x86_64-linux-gnu \ -lOpenImageIO \ -lHalf -lIex -lfreetype -lIlmThread -lImath -lIlmImf -lIlmThread \ -lOpenColorIO \ -lyaml-cpp -ltinyxml \ -lboost_regex -lboost_filesystem -lboost_thread -lboost_system \ -ltiff -lgif -lpng -ljpeg -lz \ -lrt -ldl" $ go test -v -x --ldflags '-extldflags "-static"' github.com/justinfx/openimageigo ... /home/justin/src/OpenColorIO/src/core/OCIOYaml.cpp:329: undefined reference to `YAML::Node::begin() const' ... /home/justin/src/OpenColorIO/build/ext/dist/include/yaml-cpp/nodereadimpl.h:79: undefined reference to `YAML::Node::GetScalar(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;&amp;) const' ... /usr/local/lib/libOpenColorIO.a(OCIOYaml.cpp.o): In function `_FindFromNodeAtIndex': /home/justin/src/OpenColorIO/build/ext/dist/include/yaml-cpp/nodeutil.h:53: undefined reference to `YAML::Node::FindAtIndex(unsigned long) const' collect2: ld returned 1 exit status </code></pre> <h2>Update #2</h2> <p>Nevermind about update #1. It was specifically related to <code>OpenColorIO</code> and not a general issue.</p> </div>

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Linux 会成为主流桌面操作系统吗?

整理 |屠敏出品 | CSDN(ID:CSDNnews)2020 年 1 月 14 日,微软正式停止了 Windows 7 系统的扩展支持,这意味着服役十年的 Windows 7,属于...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

学习总结之HTML5剑指前端(建议收藏,图文并茂)

前言学习《HTML5与CSS3权威指南》这本书很不错,学完之后我颇有感触,觉得web的世界开明了许多。这本书是需要有一定基础的web前端开发工程师。这本书主要学习HTML5和css3,看...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

新一代神器STM32CubeMonitor介绍、下载、安装和使用教程

关注、星标公众号,不错过精彩内容作者:黄工公众号:strongerHuang最近ST官网悄悄新上线了一款比较强大的工具:STM32CubeMonitor V1.0.0。经过我研究和使用之...

记一次腾讯面试,我挂在了最熟悉不过的队列上……

腾讯后台面试,面试官问:如何自己实现队列?

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

冒泡排序动画(基于python pygame实现)

本项目效果初始截图如下 动画见本人b站投稿:https://www.bilibili.com/video/av95491382 本项目对应github地址:https://github.com/BigShuang python版本:3.6,pygame版本:1.9.3。(python版本一致应该就没什么问题) 样例gif如下 ======================= 大爽歌作,mad

Redis核心原理与应用实践

Redis核心原理与应用实践 在很多场景下都会使用Redis,但是到了深层次的时候就了解的不是那么深刻,以至于在面试的时候经常会遇到卡壳的现象,学习知识要做到系统和深入,不要把Redis想象的过于复杂,和Mysql一样,是个读取数据的软件。 有一个理解是Redis是key value缓存服务器,更多的优点在于对value的操作更加丰富。 安装 yum install redis #yum安装 b...

现代的 “Hello, World”,可不仅仅是几行代码而已

作者 |Charles R. Martin译者 | 弯月,责编 | 夕颜头图 |付费下载自视觉中国出品 | CSDN(ID:CSDNnews)新手...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

程序员毕业去大公司好还是小公司好?

虽然大公司并不是人人都能进,但我仍建议还未毕业的同学,尽力地通过校招向大公司挤,但凡挤进去,你这一生会容易很多。 大公司哪里好?没能进大公司怎么办?答案都在这里了,记得帮我点赞哦。 目录: 技术氛围 内部晋升与跳槽 啥也没学会,公司倒闭了? 不同的人脉圈,注定会有不同的结果 没能去大厂怎么办? 一、技术氛围 纵观整个程序员技术领域,哪个在行业有所名气的大牛,不是在大厂? 而且众所...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

立即提问
相关内容推荐