You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, July 26th 2005, 8:36am

Tried to create a static link .exe file in VC++

I've tried to use the QT 4.0.0 evaluation edition and configured with configure -static option. Then nmake. Everything looks fine.

Then I tried to setup the Visual C++ 7.01 to compile a program with static link.

I changed
Project\xxxxx properties\Configuration Properties\C/C++\Code Generation\Runtime Library\Multi-threaded debug(/MTd)

But lots of linking error occured.

The program works fine if I configure the QT library with -shared option and VC++ with Multi-threaded debug DLL option.

Anyone knows how to correctly configure the visual C++ 7.01 to build a static link qt program?

Thanks

Esleborn

Beginner

  • "Esleborn" is male

Posts: 44

Location: Germany

Occupation: Student and Programmer

  • Send private message

2

Tuesday, September 13th 2005, 6:34pm

RE: Tried to create a static link .exe file in VC++

First: I get a simliar problem.
Second: If I understand you right, you compile qt normally and your project with /MT. Qt is by default compiled with /MD (_DEBUG with /MDd), so you get lots of errors if you try to compile your programm with /MT or /MTd.
You can change <QTDIR>/mkspecs/win32-msvc.net/qmake.conf (bzw .../win32-msvc/... for Visual Studio 6) like this:

Source code

1
2
QMAKE_CFLAGS_RELEASE	= -O2 -MT
QMAKE_CFLAGS_DEBUG	= -Zi -MTd
but don't ask me why, I got a lot of errors even with this. But these errors now come also when I compile a shared version of QT, so perhaps this is the solution for you... if yes, PLEASE what did I wrongly?

(Sry for bad english, I'm german...)
Help us to protect your freedoms and to stop TCPA/TCG.

This post has been edited 1 times, last edit by "Esleborn" (Sep 13th 2005, 6:37pm)