OK, I think I found the solution.

On Aug 16, 11:40 am, Doug Coburn <dougco...@gmail.com> wrote:
>
> #########################################
> # Build instructions
> ########################################
>
> > mkdir generated
> > protoc --cpp_out=./generated *.proto
> > g++ -c generated/base.pb.cc -o generated/base.pb.cc.o
> > g++ -c generated/extension.pb.cc -o generated/extension.pb.cc.o
> > g++ -c generated/glue.pb.cc -o generated/glue.pb.cc.o
> > ar cr protocollection.a generated/*.cc.o
> > g++ main.cpp protocollection.a -o app -lprotobuf -lpthread

This should be :
      g++ main.cpp -Wl,-whole-archive protocollection.a -Wl,-no-whole-
archive -o app -lprotobuf -lpthread

Which will force the linker to include all of the object files in the
archive rather than just the ones it thinks it needs.

>
> #########################################
> # Results
> ########################################
>
> > ./app
>
> Initializing extension type: extension

It appears that there is nothing you can do in the protobuf sources to
fix this as the linker is not even including the compiled object
files.  This is a g++ issue.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to