C Protobuf with GCC

jbo@

Developer
I have a cross-platform project using devel/cmake and C++20. This project compiles fine under Windows, Linux and MacOS.

The project uses Google's protobuf library. On FreeBSD, I installed those from devel/protobuf.
The problem I'm facing is that the project requires lang/gcc11 as clang is missing some C++20 features at the moment. However, the /usr/lib/libprotobuf.so library was apparently compiled with devel/llvm which prevents GCC from successfully linking to it.

I can't imagine that I'm the first one running into this problem.
How would one deal with this situation?
 
I already built it myself using poudriere.

Two questions on this:
  • How do I specify which compiler poudriere should use to build a specific port (eg. devel/protobuf)
  • Is there a mechanism which allows me to still have devel/protobuf built using devel/llvm but also a version using lang/gcc11 and serve both via the repo?
 
I don't know about Poudriere but i meant to build it with GCC and use CMAKE to link to that version.

However, the /usr/lib/libprotobuf.so library was apparently compiled with devel/llvm which prevents GCC from successfully linking to it.
This is strange, i can't see a reason why GCC would not correctly link it.
 
I have a cross-platform project using devel/cmake and C++20.
If possible I would recommend putting a little bit of effort in to reduce the dependency on C++20 features.

Chasing standards and *needing* C++20 is generally a bad thing in programming. As you have seen it actually reduces cross-platform support. I most often see CompSci students making this mistake.

C++ versions are not like houses (or pizza). Bigger isn't necessarily better. ;)

(unless you are really just learning / playing with a feature, then ignore my noise!)
 
I don't know about Poudriere but i meant to build it with GCC and use CMAKE to link to that version.
I'll give that a shot!


(unless you are really just learning / playing with a feature, then ignore my noise!)
That is exactly the case with this project. It's nothing production ready/worthy. It's mainly a project to specifically play with / test the various C++20 features.
 
Back
Top