Results 1 to 3 of 3

Thread: Trying to link to my own static library, "not of required architecture" error

  1. #1
    Join Date
    Sep 2009
    Posts
    2
    Thanks
    1

    Default Trying to link to my own static library, "not of required architecture" error

    I'm working in OSX on an Intel Macbook Pro, for reference. QT 4.5.3.

    I'm getting pretty frustrated here as this makes little sense to me.
    I created a project in QT and built a static library. That dropped a
    ".a" file on my hard drive which is all good. I then created a GUI
    project in QT and cannot for the life of me get it to link to the
    static library.

    Whenever I compile the GUI app, I get this error:

    "ld: warning: in ../CommonFramework/libCommonFramework.a, file is not
    of required architecture"

    I'm brand new to the land of QT so be gentle. Which idiotic newbie
    mistake am I committing here?

    The .PRO file for the static library:

    # -------------------------------------------------
    # Project created by QtCreator 2009-09-06T09:50:35
    # -------------------------------------------------
    QT -= gui
    TARGET = CommonFramework
    TEMPLATE = lib
    CONFIG += staticlib x86
    SOURCES += xmapreader.cpp
    HEADERS += xmapreader.h
    CommonInclude.h
    PRECOMPILED_HEADER += CommonInclude.h

    The .PRO file for the GUI app:

    # -------------------------------------------------
    # Project created by QtCreator 2009-09-06T08:01:41
    # -------------------------------------------------
    QT += opengl
    webkit
    TARGET = LevelEd
    TEMPLATE = app
    SOURCES += main.cpp
    leveledwindow.cpp
    HEADERS += leveledwindow.h
    LevelEdInclude.h
    FORMS += leveledwindow.ui
    PRECOMPILED_HEADER += LevelEdInclude.h
    CONFIG += x86
    LIBS += ../CommonFramework/libCommonFramework.a

    Halp?

  2. #2
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Re: Trying to link to my own static library, "not of required architecture" error

    Try to add the following to the GUI app project file:
    Qt Code:
    1. DEPENDPATH += $$INCLUDEPATH
    2. TARGETDEPS += $$LIBS
    To copy to clipboard, switch view to plain text mode 

    Best Regards
    NoRulez

  3. The following user says thank you to NoRulez for this useful post:

    Warren Marshall (7th September 2009)

  4. #3
    Join Date
    Sep 2009
    Posts
    2
    Thanks
    1

    Default Re: Trying to link to my own static library, "not of required architecture" error

    Thanks for the reply! What's weird here is that I tried putting my project back together again to try your suggestion (I had switched over to trying some other ideas) and when I did - it worked. The only difference is that the static library and the app are now sitting in the same directory which I guess is what is making it work. Dumb, but there you.

    Thanks again!

Similar Threads

  1. nmake error during .pro compiling
    By mattia in forum Installation and Deployment
    Replies: 5
    Last Post: 18th June 2008, 10:15
  2. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 13:43
  3. Replies: 16
    Last Post: 23rd May 2008, 10:12
  4. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  5. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.