Opened 10 years ago

Closed 6 years ago

#45287 closed defect (fixed)

OpenSceneGraph build against libstdc++ (should be libc++)

Reported by: hartmut@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.1
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: OpenSceneGraph

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Seems OpenSceneGraph is being built with gcc or for some other reason linked against libstdc++

otool against libosg.dylib reveals:

Load command 13
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libstdc++.6.dylib (offset 24)

Hence, mixing with other libraries (such as OpenCV) is not possible. This is on Mavericks without any modifications (fresh MacPorts install).

Change History (6)

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Port: OpenSceneGraph added; openscenegraph removed

comment:2 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

I do see the line in CMakeLists.txt that says:

            set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")

So I can see why that would be the case.

Nevertheless, when building on 10.10, it gets built with libc++. I'm not sure how.

comment:3 Changed 10 years ago by hartmut@…

Oh, I see. I would guess its worthwhile to report this upstream? Thoughts?

comment:4 Changed 9 years ago by mamoll (Mark Moll)

If I comment out these lines everything still compiles fine:

set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++98")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -stdlib=libstdc++ -Wno-overloaded-virtual -Wno-conversion")

Is there any downside to this? With the port as it is now, I'm having some trouble compiling some other code that depends on OpenSceneGraph and various other libraries. Somehow, linking against both libstdc++ and libc++ doesn't seem to work well.

comment:5 Changed 6 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: MarcusCalhoun-Lopez added

comment:6 Changed 6 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: newclosed

In 98a6d96874a4c0f194b95f2aaacf1fe54367c038/macports-ports (master):

OpenSceneGraph: respect MacPorts compiler flags

Fixes #45287

Note: See TracTickets for help on using tickets.