PDA

View Full Version : libmingw32.a problem



rogerdff
14th December 2006, 20:00
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

jacek
14th December 2006, 20:16
Do you use qmake?

rogerdff
15th December 2006, 14:40
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

wysota
15th December 2006, 15:27
You seem to be compiling a library with an application template.

rogerdff
18th December 2006, 19:34
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