Skip to content
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

Fixing protobuf definitions on Linux. New protobuf requires C++17 #260

Open
gapisback opened this issue Jan 22, 2025 · 0 comments
Open

Fixing protobuf definitions on Linux. New protobuf requires C++17 #260

gapisback opened this issue Jan 22, 2025 · 0 comments

Comments

@gapisback
Copy link
Collaborator

@jlmucb reports this issue based on some of his work to get CFCC / protobuf working on a Linux implementation. (Raspberry PI? Get clarification.)

I just spent an incredibly frustrating day fixing protobuf on my Linux machine. The new protobuf requires C++17.

After I rebuilt gflags, googletest, abseil and protobuf under C++17, everything compiled but I got a load of undefined symbols. I was within 30 seconds of hitting my computer when I discovered a fix I don't quite understand. The earlier command is marked * and the working command (for the new protobuf only) is marked ** below. So, when you start using the new protobuf talk to me otherwise you might be moved to violence.

I discovered this in another project but I'll probably have to fix this in the certifier.

[ NOTE: P.S. It's not exactly clear what the code snippet below is trying to say. Figure out details from John and update issue. ]

ifndef NEWPROTOBUF
CFLAGS=$(INCLUDE) -O3 -g -Wall -std=c++11 -Wno-unused-variable -D X64
CFLAGS1=$(INCLUDE) -O1 -g -Wall -std=c++11 -Wno-unused-variable -D X64
else
CFLAGS=$(INCLUDE) -O3 -g -Wall -std=c++17 -Wno-unused-variable -D X64
CFLAGS1=$(INCLUDE) -O1 -g -Wall -std=c++17 -Wno-unused-variable -D X64
endif
CC=g++
LINK=g++
PROTO=protoc
AR=ar

# build the library later
tobj=   $(O)/acl.o $(O)/acl.pb.o $(O)/test_acl.o

ifdef NEWPROTOBUF
export LD_LIBRARY_PATH=/usr/local/lib
LDFLAGS= -L/usr/local/lib `pkg-config --cflags --libs protobuf` -lgtest -lgflags -lpthread
else
export LD_LIBRARY_PATH=/usr/local/lib
LDFLAGS= -L/usr/local/lib -lprotobuf -lgtest -lgflags -lpthread
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant