You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/08/11 16:11:22 UTC
[jira] [Commented] (PROTON-1281) Odd link error when optimisation
level is -O2 or -O3 when compiling with libc++ (clang C++ library)
[ https://issues.apache.org/jira/browse/PROTON-1281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15417505#comment-15417505 ]
ASF subversion and git services commented on PROTON-1281:
---------------------------------------------------------
Commit 5afa455a5982eab0e5a4e6e6cf01fe12605870d9 in qpid-proton's branch refs/heads/master from [~astitcher]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=5afa455 ]
PROTON-1281: [C++ Binding] Missed #include <ostream>
- This was causing a difficult to find link error on FreeBSD/clang++
The code in question was using ostream& << std::string("whatever");
but only including <string> which only declares the operator<< used.
However you need <ostream> to define the necessary template instantiation.
If you don't include <ostream> then it becomes an unknown symbol.
This only happens when compiling with -O2 or -O3. I think this is
because these options inline the template instantiation in other
places so that the symbol is not available in the library anymore.
> Odd link error when optimisation level is -O2 or -O3 when compiling with libc++ (clang C++ library)
> ---------------------------------------------------------------------------------------------------
>
> Key: PROTON-1281
> URL: https://issues.apache.org/jira/browse/PROTON-1281
> Project: Qpid Proton
> Issue Type: Bug
> Components: cpp-binding
> Affects Versions: 0.12.0
> Environment: FreeBSD 10
> Reporter: Andrew Stitcher
> Assignee: Andrew Stitcher
>
> Building in the RelWithDebInfo or Release configurations on FreeBSD fails to build executables that use the C++ binding with a link error which is effectively this demangled symbol not found:
> std::ostream& operator<<(std::ostream&, std::string)
> [But it's much longer in real life because it's massively templated]
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org