Bug 1282513 - Using clang++, linking a project with libprotobuf fails
Summary: Using clang++, linking a project with libprotobuf fails
Keywords:
Status: CLOSED DUPLICATE of bug 1282645
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Adam Jackson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-16 16:15 UTC by Florent Le Coz
Modified: 2016-06-05 14:28 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-06-05 14:28:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1488254 0 None None None 2016-06-05 13:38:13 UTC

Description Florent Le Coz 2015-11-16 16:15:09 UTC
Description of problem:
Compiling a simple C++ file, linked with -lprotobuf fails, while doing the exact same thing works with g++.
This used to work in previous versions (don’t know if this is caused by something in the f23 rebuild, or the 3.7 version).

Version-Release number of selected component (if applicable):
clang-3.7.0-1.fc23
protobuf-devel-2.6.1-2.fc23.x86_64


Steps to Reproduce:
1. echo "message Test{required bool val = 1;}" > test.proto
2. protoc test.proto --cpp_out=.
3. echo '#include "test.pb.h"\nint main(){ Test t; return t.ShortDebugString().size(); }' > main.cpp
4. clang++ main.cpp test.pb.cc -lprotobuf 


Actual results:
main.cpp:(.text+0x28): undefined reference to `google::protobuf::Message::ShortDebugString() const'
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Expected results:
Should compile (just like using g++ does) without any error.

Comment 1 Côme David 2016-05-14 09:07:29 UTC
My guess is that Protobof inside the official Fedora packages have been compiled with g++, not with clang. Try to compile libprotof yourself with clang++ and see if it links.

Comment 2 Jan Včelák 2016-06-05 14:28:36 UTC

*** This bug has been marked as a duplicate of bug 1282645 ***


Note You need to log in before you can comment on or make changes to this bug.