View Full Version : can not compile

12th July 2010, 23:03
i've downloaded the new qt creator 2.0.0
then i had my first problem:
when opening my old project i could not compile it in other mode then 4.6.2 debug
so i recreated the project in another directory of my drive and copied the whole sourcecode from old to new project
it compiled always but now i always (in every compile mode) get this error message:

"collect2: ld returned 1 exit status"

the information i got from the compililationscreen:

g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\iLesson.exe release/main.o release/mainwindow.o release/htmlparser.o release/webdatacontroller.o release/webuntisaccessor.o release/moc_mainwindow.o release/moc_htmlparser.o release/moc_webdatacontroller.o release/moc_webuntisaccessor.o -L"e:\Programme\Qt\2010.04\qt\lib" -lmingw32 -lqtmain -lQtGui4 -lQtNetwork4 -lQtCore4
mingw32-make[1]: Leaving directory `F:/Projekte/QT/4.7.0/iLesson-build-desktop'
mingw32-make: Leaving directory `F:/Projekte/QT/4.7.0/iLesson-build-desktop'
release/webdatacontroller.o:webdatacontroller.cpp:(.text+0 x129): undefined reference to `WebDataController::constructDynamicOnlyOpenTagReg Exp(QString, QStringList, bool)'
release/webdatacontroller.o:webdatacontroller.cpp:(.text+0 x19b): undefined reference to `WebDataController::constructInvertedOpenTagRegExp (QString, QStringList, bool)'
release/webdatacontroller.o:webdatacontroller.cpp:(.text+0 x1e6): undefined reference to `WebDataController::constructCloseTagRegExp(QStrin g)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\iLesson.exe] Error 1
mingw32-make: *** [release] Error 2

but have no idea what is wrong

the class that must force the error is at the moment completly isolated; means it is not needed
i just want to know if the code is correct

12th July 2010, 23:14
Well, do those functions exist?

12th July 2010, 23:25
Well, do those functions exist?

yes they do.
i can not show the whole sourcecode but here are the declarations in the head:

QString constructCloseTagRegExp(QString tag);
QString constructDynamicOnlyOpenTagRegExp(QString tag, QStringList parameters, bool special = false);
QString constructStrictDynamicOnlyOpenTagRegExp(QString tag, QStringList parameters, bool special = false);
QString constructInvertedOpenTagRegExp(QString tag, QStringList parameters, bool special = false);
QString constructMustContainOpenTagRegExp(QString tag, QStringList parameters, bool special = false);

like i said before: the code compiled successfully but after some changes in the funtions this is the result

strange is that the functions "constructMustContainOpenTagRegExp" and "constructStrictDynamicOnlyOpenTagRegExp" seem to dont force such an error but they are nearly indentical

12th July 2010, 23:39
Check if the .pro file contains a reference to the file containing definitions of those methods.

12th July 2010, 23:44
We know the declarations exist otherwise you get a compile error instead. But do the definitions exist and are they identical? Also, is the file linked correctly, as wysota says?

13th July 2010, 00:06
well this is an extract from my .pro file

SOURCES += main.cpp\
mainwindow.cpp \

HEADERS += mainwindow.h \

and yeah they are indentical (think so. im 99,9% sure but i will check tomorrow because in germany its about 0:00 and my parents want to sleep)
so i will give you a sencored version of my sourcecode tomorrow

so i think did nothing wrong because my old version with nearly same code


well i checked my code in the old Qt creator version (1.3.1) and he gave the message that the reference problem is here:

QString specified_open_tag_regexpstr( this->constructDynamicOnlyOpenTagRegExp(tag, parameters, false) );

QString open_tag_regexpstr( this->constructInvertedOpenTagRegExp(tag, parameters, false) );

QString close_tag_regexpstr( this->constructCloseTagRegExp(tag) );

the functions do exist i added them with QT creators auto function

i do not know what the problem is

all of my functions return a QString variable which i normaly could give to the constructor of a new QString or am i wrong?

13th July 2010, 00:36
Please show us the bodies of the three methods. You can strip out the contents if you don't want to show them.

13th July 2010, 11:04
i've got the problem and i'm such an idiot
the only thing i forgot was the classname infront of the functionname and the double : :p

my old problem...
i have started with vb.net and thus I often fall back in old patterns (because there you don't need this)

but thanks for all help