0

I'm using Qt4.8 on OSX Leopard and instead of qmake+QtCreator I want to compile a very simple project using CMake on OSX to understand how to do a package.

While the very same project compiles and links smoothly under Linux, under my OSX box, this is the error message I always get in the linking phase:

ld warning: in /Library/Frameworks//QtGui.framework/QtGui, file is not of required architecture
ld warning: in /Library/Frameworks//QtCore.framework/QtCore, file is not of required architecture
Undefined symbols:
  "QWidget::mousePressEvent(QMouseEvent*)", referenced from:
      vtable for TestFormin moc_TestForm.cxx.o
  "QObject::childEvent(QChildEvent*)", referenced from:
      vtable for TestFormin moc_TestForm.cxx.o
  "QWidget::actionEvent(QActionEvent*)", referenced from:
      vtable for TestFormin moc_TestForm.cxx.o
  "QCoreApplication::translate(char const*, char const*, char const*, QCoreApplication::Encoding)", referenced from:

etcetera etcetera.

This happens for every project I want to compile with cmake. Any idea of what's going on?

Anonymous
  • 18,162
  • 2
  • 41
  • 64
linello
  • 8,451
  • 18
  • 63
  • 109

1 Answers1

1

Check what architecture (i386,x86_64) is being used by cmake (CMAKE_OSX_ARCHITECTURES). Try suggesting the architecture to cmake:

cmake -DCMAKE_OSX_ARCHITECTURES=x86_64
Anonymous
  • 18,162
  • 2
  • 41
  • 64
  • Thanks, this solved my problem! I must only keep the x86_64 architecture because my Qt libraries are provided only in that architecture. – linello Apr 03 '12 at 14:25