-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compile problem #331
Comments
errors as like this: |
All .so and headers of wokflow and srpc are already located in their _lib and _include. This error is because libprotobuf.so cannot be found. You need to specify the default location which installed protobuf in your environment, usually in /usr/local. |
thank you for your infomation,but what I want to know is when cross compile,where can I find the target temp so? /usr/local that is local compile and install can find. |
交叉环境在使用bin时,如下库也是需要:libz.so libworkflow.so libprotobuf.so,但是编译产物里面没有,这个请问我需要一个个模块单独编译么? |
其实一共需要:workflow lz4 snappy zlib protobuf openssl 先前我们recursive拉的代码,包含了前三个,可以在普通环境下make完看看:
|
多谢哈,我理解为应该是依赖模块都需要交叉编译,除非系统自带某些库。我试一下各个模块交叉编译吧。 |
我发现我直接从官方拉snappy代码,可以编译过,用srpc目录下面的snnappy编译,有如下错误 |
inline void Start() {
#ifdef WIN32
QueryPerformanceCounter(&start_);
#else
::gettimeofday(&start_, nullptr);
#endif
} 这里对于非windows的话都用gettimeofday的话,在嵌入式环境下会有问题。 你拉的snappy应该是适合你的环境的包,应该以你从官方拉下来的snappy为准就好~ |
压缩这些库感觉某些场景也不太需要,以前是觉得库比较小、系统自带,不费事。 我今天晚点加一个编译选项,让srpc编译可选不需要压缩库,也许交叉编译这种场景可以方便一点。 |
太酷啦,点赞点赞。 |
还有个问题请教哈,我编译出来的./srpcserver,执行的时候为啥去找libsrpc.so.0,我理解为最终生成一个so即可,其他的so都是软连接的,所以我把libsrpc.so.0.10.0重命名为libsrpc.so应该可以,但是发现执行的时候还是去找libsrpc.so.0,不太明白。 |
是因为链接的时候,如果是采用动态链接,-lsrpc,系统会使用版本号标识不同的.so。可以通过
解决办法有两个:
|
先不用去压缩了,目前我在嵌入式Linux跑起来了,后续Android系统的有可能还需要请教您哈。 |
太厉害啦~如果有空的时候可以帮写一下步骤分享给后面需要的小伙伴就太好了。 好的,压缩有空了慢慢改~有其他问题随时交流 |
we can use g++ -o server server.cc example.pb.cc -std=c++11 -lsrpc -lworkflow -lsnappy -lz -lprotobuf to compile example.
but if I do not install srpc and workflow and protobuf, How can I compile? I know we can use -L ,but where is the generated so?
can you move all the needed so to _lib and include to _include?
The text was updated successfully, but these errors were encountered: