PDA

View Full Version : Trying to link to my own static library, "not of required architecture" error



Warren Marshall
7th September 2009, 11:43
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?

NoRulez
7th September 2009, 12:06
Try to add the following to the GUI app project file:


DEPENDPATH += $$INCLUDEPATH
TARGETDEPS += $$LIBS


Best Regards
NoRulez

Warren Marshall
7th September 2009, 21:13
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!