[osg-users] [build] osgslice build failure on OSX

6 views
Skip to first unread message

Ravi Mathur

unread,
Sep 9, 2019, 12:45:08 PM9/9/19
to osg-...@lists.openscenegraph.org
Hi all,

Has anyone using OSX noticed that the osgslice example does not build? This prevents OSG from building on OSX out of the box. I'm currently using OSX 10.14.6 & XCode 10.3, but it's been happening for over a year now.


Code:

[100%] Linking CXX executable ../../bin/osgslice
Undefined symbols for architecture x86_64:
"_graphicswindow_Carbon", referenced from:
__GLOBAL__sub_I_osgslice.cpp in osgslice.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [bin/osgslice] Error 1
make[2]: *** [examples/osgslice/CMakeFiles/example_osgslice.dir/all] Error 2
make[1]: *** [examples/osgslice/CMakeFiles/example_osgslice.dir/rule] Error 2
make: *** [example_osgslice] Error 2




I usually circumvent this by just commenting out the osgslice example in examples/CMakeLists.txt . Does anyone else approach this differently?

Thanks,
Ravi

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76656#76656





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Robert Osfield

unread,
Sep 10, 2019, 4:14:36 AM9/10/19
to OpenSceneGraph Users
Hi Ravi,

On Mon, 9 Sep 2019 at 22:34, Ravi Mathur <ravi...@utexas.edu> wrote:
Has anyone using OSX noticed that the osgslice example does not build? This prevents OSG from building on OSX out of the box. I'm currently using OSX 10.14.6 & XCode 10.3, but it's been happening for over a year now.

I don't have OSX so have to rely on others in the community to report problems.  I have done two point releases of 3.6.x in the last year and no one reported this issue.  Which version of the OSG are you using?

Robert.

Ravi Mathur

unread,
Sep 10, 2019, 11:34:24 AM9/10/19
to OpenSceneGraph Users
I've tried on OSG 3.6.3 and 3.6.4. You can see from the error I posted that it's because of the Carbon graphics window type, which hasn't existed on osx for some time. Might be that other Mac OSG users are on older osx versions.

---
Ravi

Sent from my phone, please excuse my brevity.

Robert Osfield

unread,
Sep 11, 2019, 3:54:30 AM9/11/19
to OpenSceneGraph Users
Hi Ravi,

On Tue, 10 Sep 2019 at 16:34, Ravi Mathur <ravi...@utexas.edu> wrote:
I've tried on OSG 3.6.3 and 3.6.4. You can see from the error I posted that it's because of the Carbon graphics window type, which hasn't existed on osx for some time. Might be that other Mac OSG users are on older osx versions.

I have a quick look through osgslice and couldn't see any reference to platform specific windowing.  Where is the reference to Carbon coming from?

Robert.
 

Voerman, L.

unread,
Sep 11, 2019, 4:32:57 AM9/11/19
to OpenSceneGraph Users
Hi Robert,
The reference comes from include/osgViewer/GraphicsWindow near the end of the file:
USE_GRAPICSWINDOW_IMPLEMENTATION(Carbon)

I've created a pull request with a possible fix here; however
- I dont have an apple so I can't test anything
- I got unsure if it's possible to build with mutiple windowing systems, and whether we should prefer cocoa if available.

On the other hand my PR will fix the build on modern apple systems without making the build impossible on carbon systems. I don't know if the carbon system is used anyway; the current master tree will probably not link the osgSlice example when building with the carbon windowing system.
Laurens.

Ravi Mathur

unread,
Sep 11, 2019, 2:02:53 PM9/11/19
to OpenSceneGraph Users
Thanks for the input Laurens. You're right, it is because of the USE_GRAPHICSWINDOW() macro called from osgslice and defined in osgViewer/GraphicsWindow. If I change the macro to use Cocoa, osgslice compiles and runs fine. Laurens' PR does the same thing, but more gracefully and with backwards compatibility, so I support his approach.

Ravi
Reply all
Reply to author
Forward
0 new messages