Results 1 to 4 of 4

Thread: silly undefined refrence to main

  1. #1
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default silly undefined refrence to main

    Well i need more help!!!

    I am designign a form in Qt4.1.2 dsigner.
    I inherit form-class and put some more features. In the same file i am defining main() and naming this file as main.cpp;

    i went through copy book stpes for compilation . It results in link time error
    g++ -Wl,-rpath,/usr/local/Trolltech/Qt-4.1.2/lib -o Info -L/usr/local/Trolltech/Qt-4.1.2/lib -lQtGui_debug -L/home/qt-x11-opensource-src-4.1.2/lib -L/usr/X11R6/lib -lpng -lSM -lICE -lXi -lXrender -lXrandr -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lQtCore_debug -lz -lm -ldl -lpthread
    /usr/lib/gcc/i386-redhat-linux/4.0.0/../../../crt1.o(.text+0x18): In function `_start':
    : undefined reference to `main'
    collect2: ld returned 1 exit status
    make: *** [Info] Error 1
    pro file also look good.
    Is there a web link talking about all such silly novice issues.
    Last edited by jacek; 16th November 2006 at 11:20. Reason: changed [code] to [quote]

  2. #2
    Join Date
    Nov 2006
    Location
    Almaty, Kazakhstan
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: silly undefined refrence to main

    can you show the source code, please?

  3. #3
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: silly undefined refrence to main

    I have done some modification to make my code work , its doing . What iremeber is i was inheriting class generated by uic and puting sme more operations. then typical main where this error was resulting.

    i found , even if i am creating a dialog in designer it still do not inherit from QDialog class. Ihave to make a object to pass to setupUi(). Is it normal.
    Also i am following following steps for compilation
    1. qmake -project
    2. qmake
    3. make

    but qmake donot detects ui file and convert to equivalent .h but it shows entry for it in pro file.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: silly undefined refrence to main

    Quote Originally Posted by quickNitin View Post
    I have done some modification to make my code work , its doing . What iremeber is i was inheriting class generated by uic and puting sme more operations. then typical main where this error was resulting.

    i found , even if i am creating a dialog in designer it still do not inherit from QDialog class. Ihave to make a object to pass to setupUi(). Is it normal.
    The class generated by uic is not a widget. It's just a class for creating the designed ui for the given widget. I strongly suggest you to read this doc: Using a Component in Your Application
    J-P Nurmi

Similar Threads

  1. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15
  2. Replies: 1
    Last Post: 18th June 2006, 10:12
  3. Strange error while using Q3Canvas
    By Kapil in forum Newbie
    Replies: 13
    Last Post: 15th June 2006, 19:36
  4. undefined reference to fftw libraries
    By kmyadam in forum General Programming
    Replies: 2
    Last Post: 9th March 2006, 01:01
  5. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11

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
  •  
Qt is a trademark of The Qt Company.