Mac OS - configure script can't find Qt libs

Help
2011-03-28
2012-12-15
  • Leo Filippini
    Leo Filippini
    2011-03-28

    Hi everybody,
    I'm trying to compile qucs 0.0.16 on a Mac OS X 10.6.7 system on Intel
    core 2 Duo 64 bit, but ./configure script ends with: "checking for Qt
    library… configure: error: not found".

    Here some facts:
    1) I compiled and installed qt library version 3.3.8b with -thread and
    -no-extensions options
    2) I installed the X11 libs from Mac OS DVD installer
    3) My QTDIR variable is set on the correct path ( $export QTDIR=/Developer/qt3)
    4) I also tried qucs versions 0.0.15 and 0.0.10 but none of these can
    find the library
    5) I tried all this things as root user, but without success
    6) I linked every .dylib in .so with (as example for libqt) $ ln -s
    libqt.dylib libqt.so, but the result didn't change

    I'm attaching the config.log, hoping can help, but I think the
    interesting part is:

    configure:5654: checking for Qt library
    configure:5679: g++ -o conftest -O2 -pipe -fno-exceptions
    -fno-check-new  -I/Developer/qt3/include -DQT_NO_DEBUG -DQT_NO_CHECK
    -DQT_THREAD_SUPPORT -D_REENTRANT    -L/Developer/qt3/lib  conftest.cpp
    -L/usr/X11/lib -R/usr/X11/lib  -lSM -lICE -lX11  -lqt-mt >&5
    ld: warning: in /Developer/qt3/lib/libqt-mt.dylib, file was built for
    i386 which is not the architecture being linked (x86_64)
    Undefined symbols:
    "QGList::write(QDataStream&, void*) const", referenced from:
         vtable for QGListin ccXPbZaZ.o
    "QApplication::QApplication(int&, char**)", referenced from:
         _main in ccXPbZaZ.o
    "QGList::~QGList()", referenced from:
         vtable for QGListin ccXPbZaZ.o
    "QGList::~QGList()", referenced from:
         vtable for QGListin ccXPbZaZ.o
    "typeinfo for QPtrCollection", referenced from:
         typeinfo for QGListin ccXPbZaZ.o
    "QGList::read(QDataStream&, void*&)", referenced from:
         vtable for QGListin ccXPbZaZ.o
    "QGList::compareItems(void*, void*)", referenced from:
         vtable for QGListin ccXPbZaZ.o
    "QPtrCollection::newItem(void*)", referenced from:
         vtable for QGListin ccXPbZaZ.o
    "QApplication::exec()", referenced from:
         _main in ccXPbZaZ.o
    "QApplication::~QApplication()", referenced from:
         _main in ccXPbZaZ.o
    "QGList::clear()", referenced from:
         vtable for QGListin ccXPbZaZ.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    configure:5679: $? = 1
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME "qucs"
    | #define PACKAGE_TARNAME "qucs"
    | #define PACKAGE_VERSION "0.0.16"
    | #define PACKAGE_STRING "qucs 0.0.16"
    | #define PACKAGE_BUGREPORT "qucs-bugs@lists.sourceforge.net"
    | #define PACKAGE_URL ""
    | #define NDEBUG 1
    | /* end confdefs.h.  */
    | #include <qapplication.h>
    |      int main (int argc, char ** argv) {
    |      QApplication a (argc, argv); a.exec (); return 0; }

    Maybe I miss some libs?
    Thank you for your time.

     
  • Stefan Jahn
    Stefan Jahn
    2011-04-06

    Hm…

    I believe the solution is connected with:

    ld: warning: in /Developer/qt3/lib/libqt-mt.dylib, file was built for
    i386 which is not the architecture being linked (x86_64)

    Seems like, Qt was built with a -m32 or something compiler option which is now missing on the command line for qucs.

    You could try to

    $ CXXFLAGS=-m32 -O2 ./configure …

    well I dont know currently…

    Also 5) and 6) of your facts are not necessary.

    Best regards, Stefan.

     
  • Leo Filippini
    Leo Filippini
    2011-04-14

    After some weeks of work I finally solved the problems, and now Qucs compiles and runs.

    The main problem is you can't compile Qt3.3.8b at 64 bit on a 64 bit Mac OS X system, because of some obsoleted system functions used during the configure of qt libs.
    What I did is to compile qt libs with -m32 option and then compile Qucs with -m32 -arch i386 options.
    Here the steps I followed:
    1) get qt-mac-free-3.3.b.tar.gz from somewhere (try http://qtnode.net/wiki/Download_Qt ), extract and move it to /Developer folder; set the environment variable as explained here http://qucs.sourceforge.net/build.html
    2) patch this libs with "qt3-leopard.diff" "reinplace_support.diff" "dlcompat.diff" patches available at Macports.
    3) edit qt3/mkspecs/macx-g++/qmake.conf and change QMAKE_INCDIR_QT variable from "$(QTDIR)/include/qt3" to "$(QTDIR)/include" and QMAKE_CFLAGS variable adding "-m32" option, so you will have "QMAKE_CFLAGS = -pipe -arch i386 -m32"
    4) edit src/kernel/qpngio.cpp and modify as explained here http://bugs.gentoo.org/attachment.cgi?id=231299&action=diff
    5) go to qt3 main folder and launch "./configure" then "make". If everything goes well you'll have qt libs at 32 bit
    6) go to qucs folder and launch ./configure as follow: " $ CFLAGS='-arch i386 -m32' CCFLAGS='-arch i386 -m32' CXXFLAGS='-arch i386 -m32' ./configure -disable-mt -prefix=/path/to/install/folder " then "make" and "make install"
    7) go to the /path/to/install/folder/bin, double click on qucs.app and enjoy!

    Note: this instructions are very unstable! If you modify some compiling options of qt libs, then qucs will compile but won't run… :(
    I didn't try macports' qt3, someone tried?

    Leo