linker error

61 views
Skip to first unread message

ahmadhi...@gmail.com

unread,
Dec 30, 2013, 6:38:27 PM12/30/13
to qdj...@googlegroups.com
Dears,

I am able to compile the source code of QDjango and create a static library using "QDJANGO_LIBRARY_TYPE=staticlib" successfully. However, I am looking for the shared library option. The library got generated in the build directory but then QT creator have linker error:

moc_MyDAO.obj:-1: error: LNK2001: unresolved external symbol "public: static struct QMetaObject const QDjangoModel::staticMetaObject" (?staticMetaObject@QDjangoModel@@2UQMetaObject@@B)

My .pro file is updated with:
INCLUDEPATH += C:\***\qdjango\src\db

LIBS += -L"C:\***\qdjango\build\src\db" -lqdjango-db0

I am using Qt 5.1.1 and Qt creator 2.8.1 on win7.

I added the macro "Q_OBJECT" to MyDAO header file and run clean - qmake - rebuild sequence many times without success! Could you please help me fixing this linker error ?

Thanks

sandy....@gmail.com

unread,
Feb 26, 2014, 6:49:02 PM2/26/14
to qdj...@googlegroups.com, ahmadhi...@gmail.com

Add

DEFINES += QDJANGO_SHARED

to your .pro file.
Reply all
Reply to author
Forward
0 new messages