You are not logged in.

1

Friday, August 24th 2007, 4:45pm

Compiling Debug libraries

Hello,

I am trying to use compile the debug libraries of Qt 4.3.1 to use in the Eclipse integration. I am using Windows Vista. The release libraries seem to work alright, and the program will compile and run. But, when using Makefile.debug, there are errors. For instance, here is the output from Eclipse when trying to run a "Hello World" program:

Source code

1
2
3
4
5
6
7
8
9
mingw32-make debug
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/cgw/workspace/Hello'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o "debugHello.exe" debugmain.o debughello.o debugmoc_hello.o -L"c:Qt4.3.1lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
C:MinGWbin..libgccmingw323.4.2........mingw32binld.exe: cannot find -lQtGuid4
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debugHello.exe] Error 1
mingw32-make[1]: Leaving directory `C:/Users/cgw/workspace/Hello'
mingw32-make: *** [debug] Error 2


From this, I have heard elsewhere that I need to compile the debug libraries. Is that correct?

However, if I run configure -debug and then mingw32-make from the Qt/4.3.1 directory, it says :

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
gcc -c -g -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_BOOTSTRAPPED -DQT_RCC -DQT
_LITE_UNICODE -DQT_NO_DATASTREAM -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_UNICODET
ABLES -DQT_NO_LIBRARY -DQT_NO_SYSTEMLOCALE -DQT_NO_GEOM_VARIANT -DQT_NODLL -I"..
..corelibarchgeneric" -I"......include" -I"." -I"......includeQtCore"
-I"......includeQtXml" -I"....3rdpartyzlib" -I"." -I"c:Program FilesMi
crosoft Visual Studio .NET 2003SDKv1.1include" -I"......mkspecswin32-g++"
-o tmpobjdebug_sharedadler32.o ....3rdpartyzlibadler32.c
gcc: installation problem, cannot exec `cc1': No such file or directory
mingw32-make[2]: *** [tmpobjdebug_sharedadler32.o] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/4.3.1/src/tools/rcc'
mingw32-make[1]: *** [debug] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/4.3.1/src/tools/rcc'
mingw32-make: *** [sub-rcc-make_default-ordered] Error 2


Is there really something wrong with my gcc installation? I installed MinGW as part of the Qt installation, and it seems to work otherwise alright. For instance, I can compile a non-Qt "Hello World" with g++. I do have an installation of gcc within Cygwin too, but I don't think the DOS prompt knows about it, so that shouldn't be a problem here, right? I have tried reinstalling MinGW with Qt and separately from the MinGW installer, but still have the same problem. Note: The same problem occurs if I attempt to recompile the release libraries.

The relavent part of my PATH = C:\Windows\system32;C:\Windows;C:\Windows\system32\wbem;c:\program files\microsoft sql server\90\tools\binn\;C:\Qt\4.3.1\bin;C:\MinGW\bin;C:\Windows\system32\wbem

Finally, since gcc couldn't find cc1.exe I tried helping it by copying it from MinGW\libexec\gcc\mingw32\3.4.2 to MinGW\bin, but came up with other errors:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\4.3.1\lib\libQtCored4.a -o "..\.
.\lib\QtCored4.dll" object_script.QtCored.Debug  -L"c:\Qt\4.3.1\lib" -L"c:\Progr
am Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\" -L"c:\Qt\4.3.1\lib" -l
kernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lws2_32 tmp\obj\debug_sha
red\QtCored_resource_res.o
Creating library file: c:\Qt\4.3.1\lib\libQtCored4.a
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8358): In function `Z8readLin
kRK7QString':
C:/Qt/4.3.1/src/corelib/io/qfsfileengine_win.cpp:1310: undefined reference to `C
oCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8377):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1310: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x83a5):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1310: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x83cc):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1310: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8560):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1310: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x85a1):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1310: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x85c0):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1310: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x85f1):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1310: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8618):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1310: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x88e8):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1310: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8a1f): In function `ZN13QFSFi
leEngine4linkERK7QString':
C:/Qt/4.3.1/src/corelib/io/qfsfileengine_win.cpp:1404: undefined reference to `C
oCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8a3e):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1404: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8a6c):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1404: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8cc8):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1404: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8d70):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1404: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8e43):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1404: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8e62):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1404: undefined reference to `CoInitialize@4'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x8e90):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1404: undefined reference to `CoCreateInstance@20'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x9412):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1404: undefined reference to `IID_IPersistFile'
./tmp\obj\debug_shared\qfsfileengine_win.o(.text+0x96d3):C:/Qt/4.3.1/src/corelib
/io/qfsfileengine_win.cpp:1404: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\quuid.o(.text+0x229b): In function `ZN5QUuid10createUuidE
v':
C:/Qt/4.3.1/src/corelib/plugin/quuid.cpp:411: undefined reference to `CoCreateGu
id@4'
./tmp\obj\debug_shared\qeventdispatcher_win.o(.text+0x2776): In function `ZN28QE
ventDispatcherWin32Private16doWsaAsyncSelectEi':
C:/Qt/4.3.1/src/corelib/kernel/qeventdispatcher_win.cpp:390: undefined reference
 to `WSAAsyncSelect@16'
collect2: ld returned 1 exit status
mingw32-make[2]: *** [..\..\lib\QtCored4.dll] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/4.3.1/src/corelib'
mingw32-make[1]: *** [debug] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/4.3.1/src/corelib'
mingw32-make: *** [sub-corelib-make_default-ordered] Error 2 


How can I get the debug libraries to compile?

Thanks.

2

Wednesday, September 19th 2007, 8:31pm

RE: Compiling Debug libraries

I'm having the exact same problem on a windows XP machine. I tried deleting everything (environmental variables as well). This doesn't work.

An older install (4.2) has the same exact code, but it compiled on my machine. I have no idea what is going wrong.

3

Friday, September 21st 2007, 7:52pm

RE: Compiling Debug libraries

Using Qt 4.2.3 fixed my problem. Qt 4.3 still is problematic, though.
Thanks.

ferdna

Beginner

  • "ferdna" is male

Posts: 27

Location: USA

Occupation: Programming

  • Send private message

4

Saturday, November 24th 2007, 5:31am

an answer yet?
It Is Not That I'm Different! ... I'm Only Making The Difference!

rmarc

Beginner

Posts: 2

Location: Paris, France

Occupation: research engineer

  • Send private message

5

Thursday, November 29th 2007, 3:11pm

I have the same problem than described above (*) when creating
the library file libQtCored4.a with Qt 4.3.1 and 4.3.2.
But I don't have this problem with the 4.2.1.
(*) see the last piece of code shown by "cgwahl".

franck24

Beginner

Posts: 2

Location: France, Bordeaux

  • Send private message

6

Thursday, November 29th 2007, 4:05pm

I finally found the problem: the linker was using the Visual studio libraries instead of the MinGW libraries...

Edit src\corelib\Makefile.Debug (or Makefile.Release)

and replace something like :

LIBS = -L"c:\Qt\4.3.1_g++\lib" -L"C:\MinGW\lib" -L"c:\Program Files\Microsoft Visual Studio .NET 2003
\ATLMFC\LIB" -L"c:\Program Files\Microsoft Visual Studio .NET 2003
\LIB" -L"c:\Program Files\Microsoft Visual Studio .NET 2003
\PlatformSDK\lib" -L"c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1
\lib" -L"c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\"

By:

-L"c:\Qt\4.3.1_g++\lib" -L"C:\MinGW\lib"

Then, the same problem will come again (with the same solution) for "src\xml", "src\gui", "src\sql", "src\network", "src\svg", "src\script", ...

I'm still building it so, I don't know if the execution will be OK...

Bye.

ferdna

Beginner

  • "ferdna" is male

Posts: 27

Location: USA

Occupation: Programming

  • Send private message

7

Thursday, November 29th 2007, 4:07pm

I second that.

Qt Debug libs compiled ok with a computer where I don't have Visual Studio installed, It failed on my laptop and other computer where I do have Visual Studio!.

nice catch!
It Is Not That I'm Different! ... I'm Only Making The Difference!

This post has been edited 2 times, last edit by "ferdna" (Nov 29th 2007, 6:16pm)


ferdna

Beginner

  • "ferdna" is male

Posts: 27

Location: USA

Occupation: Programming

  • Send private message

8

Thursday, November 29th 2007, 5:59pm

solution found.

in your"Environment Variables" check for a "lib" Variable and make sure it is empty.
In my case it was pointing to: "C:\Program Files\SQLXML 4.0\bin" and this is worng it must be empty or deleted.



(also, I did some modifications to my qtvars.bat
i changed "set PATH=%PATH%;C:\MinGW\bin" to
"set PATH=%PATH%;C:\MinGW\bin;C:\MinGW\lib"
I don't know if this was necessary, I did it anyways.)



I hope this helps.
It Is Not That I'm Different! ... I'm Only Making The Difference!

This post has been edited 4 times, last edit by "ferdna" (Nov 29th 2007, 6:13pm)


franck24

Beginner

Posts: 2

Location: France, Bordeaux

  • Send private message

9

Friday, November 30th 2007, 8:46am

Hi,

Thanks for this hilight ferdna!

In my case, "lib" environment variable was pointing to the exact same path which was wrongly added to Makefile.Release (or Debug) files. I suggest to make it point to the MinGW lib path instead of letting it empty and do not modify the qtvars.bat file.

Bye.

rmarc

Beginner

Posts: 2

Location: Paris, France

Occupation: research engineer

  • Send private message

10

Friday, November 30th 2007, 2:14pm

LIB and INCLUDE system variables

Thanks also Ferdna.
To compile Qt 4.3.2 in both release and debug versions,
I had also to suppress some pathes referencing my Microsoft Visual Studio installation in the INCLUDE system variable.
So, to simplify, I cleared both variables LIB and INCLUDE and the compilation worked fine.

Raphaƫl

11

Monday, January 21st 2008, 10:14am

I tried it all!
I perished visual studio from my PATH/INCLUDE/LIB
I checked all of the makefiles for visual studio calls...
I even put the directories with space after the directories of qt (someone said that it helped him) in the path...

It doesnt matter QT just wont compile! not HelloWord and not the libraries...

Maybe downgrading my QT will help (I'm still a newbie so I reckon I wont need most of the new fixes/features...

macabre13

Trainee

  • "macabre13" is male

Posts: 127

Location: Poland/ Wroclaw

Occupation: sw developer

  • Send private message

12

Monday, January 21st 2008, 10:55am

Did you read THIS post ?
- ebm - noise - industrial -
I always could be wrong.
Lets share knowledge!

13

Monday, January 21st 2008, 11:05am

Yep Yep... yep yep yep...
I even wrote about that in my previous post...

I installed QT at the office and It works perfectly!
But if i will continue playing with Qt at the office It wont long before my boses will give me THA BOOT...

What is the .o file for all the COM related functions? (CoCreate and such)
That was the initial problem of my qt ... (since then I destroyed it even more...)
Does Mingw come with the .o file?

Thanks macabre13

This post has been edited 1 times, last edit by "ManicQin" (Jan 21st 2008, 11:06am)


macabre13

Trainee

  • "macabre13" is male

Posts: 127

Location: Poland/ Wroclaw

Occupation: sw developer

  • Send private message

14

Monday, January 21st 2008, 11:20am

Ok, maybe try this

1)
add path to yours or sth similiar (this is mine <c:\MinGW\libexec\gcc\mingw32\3.4.5> (there is cc1 and some other stuff)) and then build the debug libraries
OR
2) show you <set> output


Sorry I didn't noticed that you have already fixed the white spaces problem, my bad ;)
- ebm - noise - industrial -
I always could be wrong.
Lets share knowledge!

15

Monday, January 21st 2008, 1:12pm

(I just took over my PC at home Via logmein and compiled the debug libs of qt... how geek am i?!?!)

1. You meant adding that path to my path? (Mine is the same)
2. what do you mean just give you my output?

1.it didnt work it keeps on telling me the next lines...

./tmp\obj\debug_shared\qfsfileengine_win.o: In function `Z8readLinkRK7QString':
C:/Qt/4.3.3/src/corelib/io/qfsfileengine_win.cpp:1326: undefined reference to `CoCreateInstance@20'
C:/Qt/4.3.3/src/corelib/io/qfsfileengine_win.cpp:1326: undefined reference to `CoInitialize@4'
C:/Qt/4.3.3/src/corelib/io/qfsfileengine_win.cpp:1326: undefined reference to `CoCreateInstance@20'
C:/Qt/4.3.3/src/corelib/io/qfsfileengine_win.cpp:1326: undefined reference to `IID_IPersistFile'
C:/Qt/4.3.3/src/corelib/io/qfsfileengine_win.cpp:1326: undefined reference to `CoUninitialize@0'
C:/Qt/4.3.3/src/corelib/io/qfsfileengine_win.cpp:1326: undefined reference to `CoCreateInstance@20'
C:/Qt/4.3.3/src/corelib/io/qfsfileengine_win.cpp:1326: undefined reference to `CoInitialize@4'
C:/Qt/4.3.3/src/corelib/io/qfsfileengine_win.cpp:1326: undefined reference to `CoCreateInstance@20'
C:/Qt/4.3.3/src/corelib/io/qfsfileengine_win.cpp:1326: undefined reference to `IID_IPersistFile'
C:/Qt/4.3.3/src/corelib/io/qfsfileengine_win.cpp:1326: undefined reference to `CoUninitialize@0'
./tmp\obj\debug_shared\qfsfileengine_win.o: In function `ZN13QFSFileEngine4linkERK7QString':

Same as Above Output

./tmp\obj\debug_shared\quuid.o: In function `ZN5QUuid10createUuidEv':
C:/Qt/4.3.3/src/corelib/plugin/quuid.cpp:409: undefined reference to `CoCreateGu
id@4'./tmp\obj\debug_shared\qeventdispatcher_win.o: In function `ZN28QEventDispatcherWin32Private16doWsaAsyncSelectEi':
C:/Qt/4.3.3/src/corelib/kernel/qeventdispatcher_win.cpp:388: undefined reference to `WSAAsyncSelect@16'
collect2: ld returned 1 exit statusmingw32-make[2]: *** [..\..\lib\QtCored4.dll] Error 1mingw32-make[2]: Leaving directory `C:/Qt/4.3.3/src/corelib'
mingw32-make[1]: *** [debug] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/4.3.3/src/corelib'
mingw32-make: *** [debug-C__Qt_4_3_3_src_corelib] Error 2
qfsfileengine_win.cpp

Thanks

macabre13

Trainee

  • "macabre13" is male

Posts: 127

Location: Poland/ Wroclaw

Occupation: sw developer

  • Send private message

16

Monday, January 21st 2008, 1:26pm

1) yes :)
2) in command prompt type "set" and paste here the output
- ebm - noise - industrial -
I always could be wrong.
Lets share knowledge!

17

Monday, January 21st 2008, 1:58pm

Here...

ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\ManicQin\Application Data
CLASSPATH=C:\Program Files\Common Files\Compuware
CLIENTNAME=Console
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=HELL
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\ManicQin
INCLUDE=C:\Qt\4.3.3\;C:\Qt\4.3.3\include\;C:\MinGW\include
LIB=C:\Qt\4.3.3\;C:\MinGW\lib\;C:\Qt\4.3.3\lib\
LOGONSERVER=\\HELL
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
Path=C:\Qt\4.3.3\bin;C:\MinGW\bin;C:\WINDOWS\System32
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 1, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0401
ProgramFiles=C:\Program Files
PROMPT=$P$G
QMAKESPEC=win32-g++
QTDIR=C:\Qt\4.3.3
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\ManicQin\LOCALS~1\Temp
TMP=C:\DOCUME~1\ManicQin\LOCALS~1\Temp
USERDOMAIN=HELL
USERNAME=ManicQin
USERPROFILE=C:\Documents and Settings\ManicQin
VS71COMNTOOLS=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\
VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\
windir=C:\WINDOWS

Thanks

This post has been edited 1 times, last edit by "ManicQin" (Jan 21st 2008, 1:58pm)


macabre13

Trainee

  • "macabre13" is male

Posts: 127

Location: Poland/ Wroclaw

Occupation: sw developer

  • Send private message

18

Monday, January 21st 2008, 2:05pm

ok, try to remove this:

INCLUDE=C:\Qt\4.3.3\;C:\Qt\4.3.3\include\;C:\MinGW\include
LIB=C:\Qt\4.3.3\;C:\MinGW\lib\;C:\Qt\4.3.3\lib\
- ebm - noise - industrial -
I always could be wrong.
Lets share knowledge!

19

Monday, January 21st 2008, 3:11pm

Dude. You're THE MAN!!!
Saweeeeet!

but can you explain me what just happened there?
I thought that he wanted the include and the lib... no?

macabre13

Trainee

  • "macabre13" is male

Posts: 127

Location: Poland/ Wroclaw

Occupation: sw developer

  • Send private message

20

Monday, January 21st 2008, 3:42pm

makefile defines own INCLUDE, and since you had declared yours there must be some kind of problems, ambiguous.
I had similar problem yesterday, i had PSDK include in my sets. And also get problems with .h and .cpp files.

I'm glad that you are ok!
- ebm - noise - industrial -
I always could be wrong.
Lets share knowledge!