-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Linking error with on Ubuntu 18.04, Works on 20.04 #8107
Comments
So today I did try to build my code on Ubuntu 18.04. I did build protobuf 3.14.0 (static libs) on this system and it was installed to /usr/local. I followed the same procedure on Ubuntu 20.04 since I am using my small bash script to automate builds. Both were build using cmake. One thing I noticed is that I did build protobuf forcing c++17 vs default c++11. Below linking looks like complains about c++11? Here is a linking error from 18.04
I also stumbled on this issue that was resolved #4799 The remaining linking errors are Looks like these symbols are in both files which I am using both to link to
Anyone experienced this and know what might be the problem? I will try in the meantime rebuild with c++11 EDIT: Forgot to mention versions of compilers |
So I just rebuild of 3.14.0 again skipping c++17. So it should be c++11 which is what is default in cmake file Still having same linking errors in my application |
Next I did rebuild protobuf 3.14.0 with |
seems unlikely to be a protoc bug but reopen if it is. For questions or troubleshooting, please see the protobuf mailing list: https://groups.google.com/forum/#!forum/protobuf or Stack Overflow https://stackoverflow.com/questions/tagged/protocol-buffers |
Having the exact same linker errors (even same symbols) when using i686-w64-mingw32-g++-posix from Ubuntu 21.10 |
@JoelLinn what version of protobuf are you tryied to build? |
What version of protobuf and what language are you using?
Version: 3.14.0
Language: C++
What operating system (Linux, Windows, ...) and version?
Android
Linux localhost 3.18.20-dev+ #31 SMP PREEMPT Sat Oct 17 10:49:56 PDT 2020 aarch64 Android
What runtime / compiler are you using (e.g., python version or gcc version)
clang version 8.0.0 (tags/RELEASE_800/final)
Target: aarch64-unknown-linux-android
Thread model: posix
What did you do?
protobuf 3.14.0 was build from source using cmake on Ubutnu 20.04 and Android phone.
Steps to reproduce the behavior:
Here linker parameters used
What did you expect to see
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment
If I build protobuf on Android phone with shared libraries vs default static I can link just fine. Above linking is only related if protobuf was build static libs only.
On Ubuntu desktop my cmake project can link to both shared and static protobuf libs
Building with static (linking problem)
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_CXX_FLAGS="-Wno-sign-conversion" -DCMAKE_INSTALL_PREFIX=/usr/local
Building with shared (NO linking problem)
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_CXX_FLAGS="-Wno-sign-conversion" -DBUILD_SHARED_LIBS=ON LDFLAGS="-llog" -DCMAKE_INSTALL_PREFIX=/usr/local
The text was updated successfully, but these errors were encountered: