[MacPorts] #41382: libQGLViewer example fails to link
#41382: libQGLViewer example fails to link ------------------------------+-------------------------------- Reporter: dv30fps-macosx@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Keywords: | Port: libQGLViewer ------------------------------+-------------------------------- After the fix for ticket #41358, libQGLViewer.dylib builds successfully for x86_64, but the link of the example program called animation fails. libQGLViewer.dylib is built for x86_64 only and the example program is trying to link i386. {{{ :info:build /usr/bin/clang++ -headerpad_max_install_names -arch x86_64 -arch i386 -Xarch_x86_64 -mmacosx-version-min=10.8 -o animation.app/Contents/MacOS/animation .obj/animation.o .obj/main.o -F/opt/local/Library/Frameworks -F/opt/local/lib -L/opt/local/lib -lQGLViewer -framework OpenGL -framework AGL -F/opt/local/Library/Frameworks -F/opt/local/lib -framework QtXml -framework QtCore -framework QtOpenGL -framework QtGui :info:build ld: warning: ignoring file /opt/local/lib/libQGLViewer.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libQGLViewer.dylib :info:build Undefined symbols for architecture i386: :info:build "QGLViewer::closeEvent(QCloseEvent*)", referenced from: :info:build vtable for Viewer in animation.o :info:build "QGLViewer::setPathKey(int, int)", referenced from: :info:build vtable for Viewer in animation.o :info:build "QGLViewer::timerEvent(QTimerEvent*)", referenced from: :info:build vtable for Viewer in animation.o :info:build "QGLViewer::wheelEvent(QWheelEvent*)", referenced from: :info:build vtable for Viewer in animation.o ... :info:build ld: symbol(s) not found for architecture i386 :info:build clang: error: linker command failed with exit code 1 (use -v to see invocation) :info:build make[2]: *** [animation.app/Contents/MacOS/animation] Error 1 :info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_libQGLViewer/libQGLViewer/work/libQGLViewer-2.4.0/examples/animation' :info:build make[1]: *** [sub-animation-all] Error 2 }}} -- Ticket URL: <https://trac.macports.org/ticket/41382> MacPorts <http://www.macports.org/> Ports system for OS X
#41382: libQGLViewer example fails to link when building universal -------------------------------+----------------------- Reporter: dv30fps-macosx@… | Owner: raphael@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: libQGLViewer | -------------------------------+----------------------- Changes (by raphael@…): * cc: raphael@… (removed) * cc: michaelld@… (added) * owner: macports-tickets@… => raphael@… * status: new => assigned Comment: You are trying to build the universal variant. The non-universal build works for me and also on the BuildBot. Your [attachment:main.log main.log] shows that for every call to {{{clang++}}} the architecture specific options {{{ -arch x86_64 -arch i386 -Xarch_x86_64 }}} are used and the {{{-Xarch_x86_64}}} option probably comes from QMake. I guess that either this option should be removed or that the option {{{-Xarch_i386}}} should be added. Michael, do you have any idea how to fix this? -- Ticket URL: <https://trac.macports.org/ticket/41382#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#41382: libQGLViewer example fails to link when building universal -------------------------------+----------------------- Reporter: dv30fps-macosx@… | Owner: raphael@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: libQGLViewer | -------------------------------+----------------------- Comment (by michaelld@…): It's trying to link to an already-installed /opt/local/lib/libQGLViewer.dylib, which was built for just x86_64. Try adding the following to the Portfile: {{{ configure.cppflags-delete -I/opt/local/include configure.ldflags-delete -L/opt/local/lib }}} and see if that helps. -- Ticket URL: <https://trac.macports.org/ticket/41382#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#41382: libQGLViewer example fails to link when building universal -------------------------------+----------------------- Reporter: dv30fps-macosx@… | Owner: raphael@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: fixed | Keywords: Port: libQGLViewer | -------------------------------+----------------------- Changes (by raphael@…): * status: assigned => closed * resolution: => fixed Comment: {{{ :info:build ld: warning: ignoring file /opt/local/lib/libQGLViewer.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libQGLViewer.dylib }}} Replying to [comment:2 michaelld@…]:
It's trying to link to an already-installed /opt/local/lib/libQGLViewer.dylib, which was built for just x86_64.
Ah, sorry, I missed that.
Try adding the following to the Portfile: {{{ configure.cppflags-delete -I/opt/local/include configure.ldflags-delete -L/opt/local/lib }}} and see if that helps.
Here, these two lines remove the {{{-L/opt/local/lib}}} before {{{-lQGLViewer}}} in the linker call, so I added these lines to the Portfile in r113512. dv30fps, please selfupdate, try again to install libQGLViewer and reopen this ticket if you still have the same problem. -- Ticket URL: <https://trac.macports.org/ticket/41382#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts