Bug 1282513 - Using clang++, linking a project with libprotobuf fails
Using clang++, linking a project with libprotobuf fails
Status: CLOSED DUPLICATE of bug 1282645
Product: Fedora
Classification: Fedora
Component: llvm (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Adam Jackson
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-16 11:15 EST by Florent Le Coz
Modified: 2016-06-05 10:28 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-05 10:28:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1488254 None None None 2016-06-05 09:38 EDT

  None (edit)
Description Florent Le Coz 2015-11-16 11:15:09 EST
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 05:07:29 EDT
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 10:28:36 EDT

*** 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.