Results 1 to 5 of 5

Thread: libmingw32.a problem

  1. #1
    Join Date
    Dec 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default libmingw32.a problem

    Hi,

    I´m facing a problem trying to build a lib.

    After every .o file is compiled, the link phase shows the
    following message:

    c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
    collect2: ld returned 1 exit status
    make[2]: *** [../lib/rtf1.dll] Error 1
    make[1]: *** [release] Error 2
    make: *** [sub-src] Error 2

    I´m using:
    - qt4.1.3
    - mingw installed through qt package (5.0.2)
    - cygwin
    - Win XP

    How can I solve this problem?

    Best regards,

    Roger

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: libmingw32.a problem

    Do you use qmake?

  3. #3
    Join Date
    Dec 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: libmingw32.a problem

    Hi,

    Yes.

    In fact, I use a script (just like QT configure file in Linux) that I run
    in cygwin.

    This script sweeps every .pro and .pri file of my project to generate
    the corresponding Makefile.

    With Qt4, qmake behaves a little different, since it creates two files, namely:
    Makefile.release and Makefile.debug.

    Then, I just run make to do the work. After the compilation process, I got
    this message during the linkage.

    Hope you can help me.

    We are stucked just because of this problem.

    Thanks for your attention,

    Roger

  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: libmingw32.a problem

    You seem to be compiling a library with an application template.

  5. #5
    Join Date
    Dec 2006
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: libmingw32.a problem

    Hi,

    I finally found out the solution, or better saying, what was lacking.

    In my .pro file I was defining:

    TEMPLATE = lib

    to generate a library, but I didn´t realize that I also had to define:

    CONFIG += staticlib

    Hope this can help others facing the same problem.

    Best regards,

    Roger

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.