Results 1 to 8 of 8

Thread: can not compile

  1. #1
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Question can not compile

    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:

    Qt Code:
    1. 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
    2. mingw32-make[1]: Leaving directory `F:/Projekte/QT/4.7.0/iLesson-build-desktop'
    3. mingw32-make: Leaving directory `F:/Projekte/QT/4.7.0/iLesson-build-desktop'
    4. release/webdatacontroller.o:webdatacontroller.cpp:(.text+0x129): undefined reference to `WebDataController::constructDynamicOnlyOpenTagRegExp(QString, QStringList, bool)'
    5. release/webdatacontroller.o:webdatacontroller.cpp:(.text+0x19b): undefined reference to `WebDataController::constructInvertedOpenTagRegExp(QString, QStringList, bool)'
    6. release/webdatacontroller.o:webdatacontroller.cpp:(.text+0x1e6): undefined reference to `WebDataController::constructCloseTagRegExp(QString)'
    7. collect2: ld returned 1 exit status
    8. mingw32-make[1]: *** [release\iLesson.exe] Error 1
    9. mingw32-make: *** [release] Error 2
    To copy to clipboard, switch view to plain text mode 

    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

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: can not compile

    Well, do those functions exist?

  3. #3
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: can not compile

    Quote Originally Posted by fatjuicymole View Post
    Well, do those functions exist?
    yes they do.
    i can not show the whole sourcecode but here are the declarations in the head:

    Qt Code:
    1. public:
    2. QString constructCloseTagRegExp(QString tag);
    3. QString constructDynamicOnlyOpenTagRegExp(QString tag, QStringList parameters, bool special = false);
    4. QString constructStrictDynamicOnlyOpenTagRegExp(QString tag, QStringList parameters, bool special = false);
    5. QString constructInvertedOpenTagRegExp(QString tag, QStringList parameters, bool special = false);
    6. QString constructMustContainOpenTagRegExp(QString tag, QStringList parameters, bool special = false);
    To copy to clipboard, switch view to plain text mode 

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: can not compile

    Check if the .pro file contains a reference to the file containing definitions of those methods.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: can not compile

    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?

  6. #6
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: can not compile

    well this is an extract from my .pro file

    SOURCES += main.cpp\
    mainwindow.cpp \
    webdatacontroller.cpp

    HEADERS += mainwindow.h \
    webdatacontroller.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

    EDIT:

    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:
    Qt Code:
    1. QString specified_open_tag_regexpstr( this->constructDynamicOnlyOpenTagRegExp(tag, parameters, false) );
    2.  
    3. QString open_tag_regexpstr( this->constructInvertedOpenTagRegExp(tag, parameters, false) );
    4.  
    5. QString close_tag_regexpstr( this->constructCloseTagRegExp(tag) );
    To copy to clipboard, switch view to plain text mode 

    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?

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: can not compile

    Please show us the bodies of the three methods. You can strip out the contents if you don't want to show them.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: can not compile

    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 :

    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

Similar Threads

  1. [Mac] Compile Qt
    By Tibo6 in forum Installation and Deployment
    Replies: 12
    Last Post: 3rd December 2009, 21:52
  2. how to compile qt use /clr?
    By yunpeng880 in forum Qt Programming
    Replies: 1
    Last Post: 14th April 2009, 19:56
  3. Please help, can not compile
    By raphaelf in forum Newbie
    Replies: 1
    Last Post: 16th June 2008, 17:45
  4. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 14:43
  5. Can't compile
    By ihoss in forum Installation and Deployment
    Replies: 12
    Last Post: 24th August 2007, 13:27

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.