[MacPorts] #40515: codeblocks: fails to compile with libc++
#40515: codeblocks: fails to compile with libc++ ---------------------+------------------------ Reporter: mojca@… | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Keywords: | Port: codeblocks ---------------------+------------------------ (Reported by Jeremy.) If you set "`cxx_stdlib libc++`" in `macports.conf` as discussed on `macports-dev`, you get the following error: {{{ /usr/bin/clang++ -DHAVE_CONFIG_H -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8/lib/wx/include/gtk2 -unicode-release-2.8 -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxGTK/2.8/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -I../../src/include -I../../src/include -I../../src/sdk/wxscintilla/include -I../../src/include/tinyxml -I../../src/include/scripting/include -I../../src/include/scripting/sqplus -I../../src/include/mozilla_chardet -I/opt/local/include -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -pipe -Os -arch x86_64 -stdlib=libc++ -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -o sdk_precomp.h.gch -xc++-header ./sdk_precomp.h In file included from ./sdk_precomp.h:13: In file included from ../../src/include/sdk_common.h:43: ../../src/include/prep.h:409:10: fatal error: 'tr1/memory' file not found #include <tr1/memory> ^ 1 error generated. }}} -- Ticket URL: <https://trac.macports.org/ticket/40515> MacPorts <http://www.macports.org/> Ports system for OS X
#40515: codeblocks: fails to compile with libc++ -------------------------+--------------------- Reporter: mojca@… | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: codeblocks | -------------------------+--------------------- Comment (by mojca@…): Dear Jeremy, I'm afraid that this is more in your field of the expertise. I have {{{ /usr/include/c++/4.2.1/tr1/memory }}} here as well as a bunch of files like {{{ /opt/local/include/gcc48/c++/tr1/memory }}} but I don't have a clue yet about how {{{libc++}}} affects the search paths of headers and what this particular {{{tr1}}} means (other than what can be found on http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch03s02.html or https://en.wikipedia.org/wiki/C%2B%2B_Technical_Report_1). There is a tiny chance that this is related to precompiled headers (#40513). -- Ticket URL: <https://trac.macports.org/ticket/40515#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#40515: codeblocks: fails to compile with libc++ -------------------------+--------------------- Reporter: mojca@… | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: codeblocks | -------------------------+--------------------- Comment (by egall@…): Darn it my finger slipped and I accidentally double-clicked the "Cc Me!" button... -- Ticket URL: <https://trac.macports.org/ticket/40515#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#40515: codeblocks: fails to compile with libc++ -------------------------+--------------------- Reporter: mojca@… | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: codeblocks | -------------------------+--------------------- Comment (by jeremyhu@…): It's not related to precompiled headers. You just need to update the source to not use tr1. -- Ticket URL: <https://trac.macports.org/ticket/40515#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#40515: codeblocks: fails to compile with libc++ -------------------------+--------------------- Reporter: mojca@… | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: codeblocks | -------------------------+--------------------- Comment (by mojca@…): Do you want to say that the solution is to use {{{ #include <memory> }}} instead of {{{ #include <tr1/memory> }}} ? -- Ticket URL: <https://trac.macports.org/ticket/40515#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#40515: codeblocks: fails to compile with libc++ -------------------------+--------------------- Reporter: mojca@… | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: codeblocks | -------------------------+--------------------- Comment (by jeremyhu@…): That is likely part of the fix, yes. You'll also need to cleanup the namespacing. See this article for a bit more reference: http://bit.ly/18P27wr Depending on how much of tr1 is used, you can probably just get away with something like: {{{ reinplace "s:tr1/::" ${file} reinplace "s/tr1:://" ${file} }}} -- Ticket URL: <https://trac.macports.org/ticket/40515#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#40515: codeblocks: fails to compile with libc++ -------------------------+--------------------- Reporter: mojca@… | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: codeblocks | -------------------------+--------------------- Comment (by mojca@…): Thank you for the explanation. I submitted a bug report upstream: * http://developer.berlios.de/bugs/?func=detailbug&bug_id=19125&group_id=5358 The `tr1` seems to appear just here: {{{ ./src/include/prep.h:#include <tr1/memory> ./src/include/prep.h: using std::tr1::shared_ptr; ./src/include/prep.h: using std::tr1::static_pointer_cast; ./src/include/prep.h: using std::tr1::weak_ptr; }}} so it doesn't seem like much work. It also appears here, but for a different purpose: {{{ ./src/plugins/codecompletion/cctest/cctest.cpp: Tokenizer::SetReplacementString(_T("_GLIBCXX_BEGIN_NAMESPACE_TR1"), _T("namespace tr1 {")); ./src/plugins/codecompletion/codecompletion.cpp: repl[_T("_GLIBCXX_BEGIN_NAMESPACE_TR1")] = _T("namespace tr1 {"); }}} I believe I need to use {{{ #if __cplusplus >= 201103L ... #else ... #endif }}} right? Just a note to myself: play with `-std=c++11` and [http://nadeausoftware.com/articles/2011/12/c_c_tip_how_list_compiler_predefi... use these options] to inspect the value of `__cplusplus`, for example: {{{ clang++ -std=c++11 -dM -E -x c++ /dev/null }}} -- Ticket URL: <https://trac.macports.org/ticket/40515#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#40515: codeblocks: fails to compile with libc++ -------------------------+--------------------- Reporter: mojca@… | Owner: mojca@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: codeblocks | -------------------------+--------------------- Comment (by mojca@…): I'm unable to attach the patch (there seem to be problems with trac at the moment), but I committed a blind patch in r111426. Please confirm that it works now. -- Ticket URL: <https://trac.macports.org/ticket/40515#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#40515: codeblocks: fails to compile with libc++ -------------------------+--------------------- Reporter: mojca@… | Owner: mojca@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: Port: codeblocks | -------------------------+--------------------- Changes (by jeremyhu@…): * status: new => closed * resolution: => fixed Comment: That doesn't fix the issue when using clang++ -stdlib=libc++ (without -std=c++11) ... Fixed in r111440 -- Ticket URL: <https://trac.macports.org/ticket/40515#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
#40515: codeblocks: fails to compile with libc++ -------------------------+--------------------- Reporter: mojca@… | Owner: mojca@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: Port: codeblocks | -------------------------+--------------------- Comment (by mojca@…): Thank you very much for fixing this. Do you want to say that compilation also works for 10.9 now? -- Ticket URL: <https://trac.macports.org/ticket/40515#comment:11> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts