Showing posts with label msvc. Show all posts
Showing posts with label msvc. Show all posts

Thursday, December 02, 2010

Compile GAlib247 with MSVC 2010 for Qt

edit makevars.vcpp
==> modify DESTDIR
==> set RELEASE_BUILD = true
==> set LIBRARY_BUILD = true
==> set SHARED_BUILD = true
nmake /f makefile.vcpp lib
nmake /f makefile.vcpp install

Wednesday, December 01, 2010

Update for Qt 4.7.1

Now option -mp makes things much easier for multi-threaded compile.

Shadow build works only outside installed folder, not inside.

eg) ../4.7.1src/configure -prefix c:\dev\qt\4.7.1x64 -mp

Saturday, November 07, 2009

MSVC and MinGW DLLs | MinGW

MSVC and MinGW DLLs | MinGW
Assume we have a testdll.h, testdll.c, and testmain.c. In the first case, we will compile testdll.c with MinGW, and let the MSVC-compiled testmain call it. You should use

gcc -shared -o testdll.dll testdll.c -Wl,--output-def,testdll.def,--out-implib,libtestdll.a

to produce the DLL and DEF files. MSVC cannot use the MinGW library, but since you have already the DEF file you may easily produce one by the Microsoft LIB tool:

lib /machine:i386 /def:testdll.def

Once you have testdll.lib, it is trivial to produce the executable with MSVC:

cl testmain.c testdll.lib

Now for MinGW programs calling an MSVC DLL. We have two methods. One way is to specify the LIB files directly on the command line after the main program. For example, after

cl /LD testdll.c

use

gcc -o testmain testmain.c testdll.lib

The other way is to produce the .a files for GCC. For __cdecl functions (in most cases), it is simple: you only need to apply the reimp tool from Anders Norlander (since his web site is no longer available, you may choose to download [this version|http://jrfonseca.dyndns.org/projects/gnu-win32/software/reimp/index.html] enhanced by Jose Fonseca):

reimp testdll.lib
gcc -o testmain testmain.c -L. -ltestdll

However, for __stdcall functions, the above method does not work. For MSVC will prefix an underscore to __stdcall functions while MinGW will not. The right way is to produce the DEF file using the pexports tool included in the mingw-utils package and filter off the first underscore by sed:

pexports testdll.dll | sed "s/^_//" > testdll.def

Then, when using dlltool to produce the import library, add `-U' to the command line:

dlltool -U -d testdll.def -l libtestdll.a

And now, you can proceed in the usual way:

gcc -o testmain testmain.c -L. -ltestdll

Hooray, we got it.

Tuesday, June 24, 2008

How to build QT 4.4 with /MP compiler option

In order to utilize multi-core CPU, we need to use /MP option on Visual Studio compiler.

It can be done by like this,

Replace all "= -nologo" to "= /MP -nologo" in every make* file


Saturday, March 22, 2008

No more patch for QT4 Open Source with MSVC2005

There is no more needs for apply patch to make QT4 Open Source with MSVC2005

Simply download source zip file and unzip it and configure it with QMAKESPEC

run command prompt from MSVC2005 command prompt
SET QMAKESPEC=win32-msvc2005
cd %QTDIR%
configure
   debug-and-release
   -qt-sql-odbc (optional)
   -qt-sql-sqlite (optional)
   -no-qt3support (optional)
nmake sub-src // Build debug and release library
nmake sub-tools release // build release executable for tools

%QTDIR%\bin\qmake -project -t vcapp // make .pro file with template option
%QTDIR%\bin\qmake // make .vcproj file to work with MSVC2005 IDE

Now it's good to go for debug and release

Saturday, August 04, 2007

QT OpenSource with Visual Studio

SourceForge.net: Files

QT Opensource patch for Visual Studio

Instruction



Download QT open source for win32

Download QT patch

Unzip them

Use MSVC command prompt

set QTDIR=%SOMEWHERE%

run patch

qconfigure.bat msvc2005 %OTHER OPTIONS%

follow the screen instruction

To build solution project file



set PATH=%PATH%;%QTDIR%/bin

set QMAKESPEC=win32-msvc2005

qmake -project -t vcapp

qmake