PDA

View Full Version : Where are my Qt .lib files??



vonCZ
17th April 2007, 11:07
I've just downloaded/installed Qt4.2.3 using Mingw on WindowsXP. All of the demos I compiled/tested work fine.

My bin directory has 24 Qt*.dll files. These exact same files are in my "lib" directory, as well. (all built at the same time, this morning). However, there are no Qt*.lib files in the lib directory.

I am trying to build a Coin3d MSVC++ project which has links to the following four .lib files:

$(QtDIR)\lib\QtOpenGLd4.lib
$(QtDIR)\lib\QtGuid4.lib
$(QtDIR)\lib\QtCored4.lib
$(QtDIR)\lib\Qt3Supportd4.lib

but there are no Qt*.lib files anywhere in my $(QtDIR) directory. Should there be? Did I install Qt incorrectly?

marcel
17th April 2007, 11:16
Do you have dlls in your lib folder?
There's something wrong there. You should only have lib files there.
Maybe you didn't compile it correctly.

vonCZ
17th April 2007, 11:19
Yes, .dll's in the lib directory.

Thanks for the feedback- i suspected this was odd, but wasn't positive. I'll rebuild, see what happens.

Given that there are currently no *.lib files in the lib directory, I'm surprised all of the demos compiled correctly.:confused:

marcel
17th April 2007, 11:24
Maybe they were built someplace else. What options did you use when you compiled Qt? Maybe you provided a custom lib directory...

Regards

vonCZ
17th April 2007, 11:51
I just search my whole drive; there are no Qt*.lib files anywhere.

It seems I've made a mess of the installation. First, I absent-mindedly ran the

Qt 4.2.3 (Build Debug Libraries)

program/routine.

When this failed to generate the .lib files (it created only the Qt*d*.dlls), I then ran "configure" in the

Qt 4.2.3 (Command Prompt)

shell, and then typed/ran "mingw32-make".

marcel
17th April 2007, 11:56
:)
Well, build it again...

wysota
17th April 2007, 11:56
MinGW doesn't use "lib" files. Instead it has .a files. If you want to use a dll for msvc, you need Qt compiled for msvc as well. To do that you may have a look at our wiki, there are instructions how to do it.

vonCZ
17th April 2007, 12:01
sorry, one more question. From the instructions:

If you later need to reconfigure and rebuild Qt from the same location, ensure that all traces of the previous configuration are removed by entering the build directory and typing make confclean before running configure again.

When I do this, I receive the following error message:

mingw32-make: *** No rule to make target `confclean'. Stop.


I tried "make clean", which removed many files (although the .dlls and .exe demo files are still present). Think I should just go ahead w/the rebuild? (it takes a couple hours)

vonCZ
17th April 2007, 12:05
MinGW doesn't use "lib" files. Instead it has .a files. If you want to use a dll for msvc, you need Qt compiled for msvc as well. To do that you may have a look at our wiki, there are instructions how to do it.


oooh... ok. I should have pointed out that the lib directory did contain the 24 Qt*.a files.

wysota
17th April 2007, 19:38
Of course it did. Because you have a MinGW based installation, not MSVC based one.

vonCZ
18th April 2007, 13:05
I've followed the instructions on the Wiki page ("Qt with Visual Studio") and have run into an early snag: compiling qmake.

I'm using the Microsoft Visual C++ 2005 Express Edition, so I ran qconfigure in the Visual Studio 2005 Command Prompt as follows:

qconfigure msvc2005 -prefix F:\Qt4_msvc -release -fast

When I get to the "Going to compile qmake now\n Continue? (Y/N):" prompt and type y <enter>, i immediately get the following error message:

Cannot open include file: 'Windows.h' : No such file or directory.

The environment variable for INCLUDE is:

INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE

Though this directory exists (and has a few include files like stdlib.h, stdio.h, etc), there's no "Windows.h" file. This Windows.h file is here, however:

C:\Program Files\Microsoft Platform SDK for Windows Server 2003\Include

Do I need to add this 2nd include directory to the Environment? How?

wysota
18th April 2007, 13:19
You need to download the SDK for MSVC Express.

vonCZ
18th April 2007, 16:37
I have already... unless I'm missing something.

When I installed MSVC++ 2005 Express a month ago, I went to this site:

http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/

and followed the instructions. I have been able to create Win32 applications within the MSVC++ software; the appropriate include/bin/lib directories are found (in the *SDK*2003 R2 directory).

But when I try to compile qmake from the qconfig program: these SDK bin/lib/include directories aren't properly referenced.

wysota
18th April 2007, 17:50
You probably forgot to tell Visual Studio where to look for additional includes.

vonCZ
18th April 2007, 17:59
no, I did tell it, per the instructions on the webpage I linked. And I can compile/link/run other programs requiring Windows.h, just not this one.

My guess: the instructions for pointing to the new include/bin/lib directories don't apply for programs built using the "Visual Studio 2005 Command Prompt", but I cannot find how to fix it.

marcel
18th April 2007, 18:10
You can set the paths for include/dll from the project properties, in Visual Studio.

wysota
18th April 2007, 18:21
My guess: the instructions for pointing to the new include/bin/lib directories don't apply for programs built using the "Visual Studio 2005 Command Prompt", but I cannot find how to fix it.

Probably the simplest way to make it work is to tweak the BAT file that comes with VS that sets all the paths for the command prompt.

vonCZ
18th April 2007, 18:37
Probably the simplest way to make it work is to tweak the BAT file that comes with VS that sets all the paths for the command prompt.

woo-hoo! Yep, that's gotta be it. I found a different wiki-page here:

http://qtnode.net/wiki/Qt4_with_Visual_Studio

than the qtcentre Wiki page, that includes specific instructions for MSVC++ Express users, including instructions for editing the vsvars32.bat file. Gotta run now; will try it later tonight. Thanks for the help.:)

wysota
18th April 2007, 18:57
Yes... Ours should include them as well, but Johan "forgot" to write them :)

vonCZ
19th April 2007, 16:31
thanks all; it's a go.:)

btw, there's some variation between the 2 wikis--the qtcentre one, and the one linked above--in addition to the aforementioned msvc++ 2005 Express special instructions. I followed the instructions in link above with no problems. thanks again.

wysota
19th April 2007, 16:56
The difference is that you can't delete the Qt source tree with the qtnode version. If you do, you won't be able to compile any Qt code.

vonCZ
19th April 2007, 17:59
yeah, i saw that in the qtcentre instructions (using the -prefix flag, otherwise "you won't be able to delete Qt sources without making the whole thing unusable"). Honestly, I didn't quite understand what this meant, but figured I just build everything without it (per qtnode instructions) and leave it alone... and shouldn't have any problems. Does this mean: you won't be able to compile the dlls and libs, move them elsewhere, then delete the directory tree from which you built the dlls/libs?

This next question isn't critical, but: I built everything on an external drive to my laptop. Can I copy the whole directory tree to my C:\ drive now, edit my environment variables, and expect everything to work? Now that i've the MSVC++ version working, I can delete the mingw version on C:\ to make space for the MS stuff.

wysota
19th April 2007, 20:25
Does this mean: you won't be able to compile the dlls and libs, move them elsewhere, then delete the directory tree from which you built the dlls/libs?
If you're talking about Qt dlls, then that's correct. Look at your Qt include files (one reason) or try moving the dlls elsewhere and ask qmake to compile any app (second reason).


This next question isn't critical, but: I built everything on an external drive to my laptop. Can I copy the whole directory tree to my C:\ drive now, edit my environment variables, and expect everything to work?
No (that's the second reason) as qmake (the binary and config files) has the path to Qt directory hardcoded. You could if you used the prefix or prefix-install switches.