qt application 64 bit windows - windows

Is it possible to compile a 64 bit executable in qt windows?
Is it the same process as with 32 bit or any different?

Have a look at this wiki page. I describes how to build the Qt binaries from source for different configurations.

I'm not sure if I understand your question completely, but I can tell you about my project and see if it helps your situation.
We have:
Visual Studio 2008 C++ project
Contains both Win32 and x64 platforms (in other words, it can be 32-bits or 64-bits)
We save the original Qt libraries that came with the Qt installer in one directory (e.g. Qt/lib/x32), and re-built Qt as 64-bits and save that in another directory (e.g. Qt/lib/x64).
When it comes to linking, we just ensure that we link with the correct library (32-bit platform links to 32-bit Qt, and so on).
This has worked quite well for us.
So if I had to guess the answer to your question.
Yes, it's possible to compile a 64-bit executable in Qt on Windows. It's the same process, except you have to tell the qmake a little bit different parameter. See Frank Bollack link above on how to build it.
Note, if you app is 64-bit (x64), and you try to link 32-bit Qt (the one that came with the installer), it will not link.
Hope this helps.

There is also an (inofficial) installer of the qt-libraries etc. for 64-bit Windows. You might want to have a look at that:
http://code.google.com/p/qt-msvc-installer/
(Just in case you don't want to spend a few hours compiling qt yourself... :D)

Related

Can Lazarus 64-bit for Windows compile to 64-bit for Windows?

I downloaded, what i thought, would be the 64-bit version of Lazarus:
Although it downloads a 32-bit build:
And after installing it, the IDE is 32-bits:
And it builds 32-bit binaries:
Changing the targeting options to win64, win64, win64:
Gives an error that Lazarus doesn't support 64-bit:
Reading the somewhat dated Cross compiling Wiki page gives the instructions on how to make the 64-bit Lazarus work on 64-bit machines:
From win32 to win64
If you are compiling the 2.1.1 or greater branch of fpc you can just do:
$ make all OS_TARGET=win64 CPU_TARGET=x86_64
and then
$ make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64
which, if you follow, just gives a few thousand errors:
The common suggestion is to abandon the Lazarus IDE, altogether, and use a fork known as CodeTyphoon. Downloading that 500 MB, and installing it, i couldn't find an IDE anywhere:
Which is confusing, because i thought CodeTyphoon was a Pascal Visual Programming Environment.
Before i go on
Before i go randomly stumbling around, downloading gigabytes of stuff, let me just ask straight out:
Can Lazarus 64-bit for Windows compile to 64-bit for Windows?
Is there a 64-bit Lazarus for Windows, that can create 64-bit Windows binaries? Am i missing something, or is that functionality not in there yet?
And if the ability is in there, at least could someone commiserate that my confusion is understandable?
The following is from README.txt files on the SourceForge download pages (http://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%201.2/ and http://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%201.2/). However, those readme.txt files are apparently not included in the actual installation.
I have verified that installing the plug-in allows you to build a 64-bit application.
Two things:
there is an add-on for building Win64 applications in the 32-bit Lazarus IDE:
Add-On for building 64bit Windows applications:
lazarus-1.2.0-fpc-2.6.2-cross-x86_64-win64-win32.exe
This file can be installed as add-on to the 32 bit Lazarus IDE (on Systems with Windows 32 or 64 bit), if you wish to develop for
64bit Windows too. If you install this on a 64bit Windows PC together
with the 32 bit Lazarus IDE, you will also able to debug 64 bit
applications.
the link to the 64-bit Lazarus IDE on the Lazarus homepage is incorrect (it points to the Win32 version). The link should be:
http://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%201.2/lazarus-1.2.0-fpc-2.6.2-win64.exe/download
If you use the 64-bit IDE you'll need a similar (but different) plugin to build 32-bit binaries.

ILmerge generating only 64bit compatible exe

I am building up my VS2010 project using "any cpu configuration" so that the executable can work for both 32 bit and 64 bit versions.
But after using ILMerge to generate a bundled exe, the resultant exe is only working in 64 bit system and for 32 bit system its showing
This version of output.exe is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.
The ILMerge command used:
C:\BuildTools\ilmerge.exe /out:proj1.exe output.exe 1.dll NLog.dll 2.dll targetplatform:v4 /ndebug
I tried to figure out any option in ILMerge to fix this, but do not find anything useful.
Any help on this will be of great help.
Figured out is the issue with Nlog.dll which was built in 64 bit environment. Fixed after converting it to Any Cpu

Building for x86 and x64 platform with CMake with Xcode and Visual studio

I started using CMake pretty recently.
It is a really easy script language but there are many tricks to learn and tutorials on the cmake website is not much help.
Basically I want to build my project for
Windows (using visual studio 2010) x86 and x64
Mac os (using Xcode 4) x86 and x64
Dependending on the OS and plateforme I want to link certain libraries.
I figured out for Windows that I can use WIN32 or WIN64 to set this up.
But I can't find the equivalence for mac os.
Can someone point me in the right direction?
In addition to the "if(APPLE)" and other variables that Tobias pointed you to in his answer, you can also inspect what generator you're using to make decisions on a per-generator basis if necessary.
if(CMAKE_GENERATOR MATCHES "Xcode")
...
elseif(CMAKE_GENERATOR MATCHES "Win64")
...
endif()
On the Mac, you can build universal binaries by setting the target property OSX_ARCHITECTURES, or the variable CMAKE_OSX_ARCHITECTURES: http://cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:OSX_ARCHITECTURES
Alternatively, you can build two single-architecture binaries using two separate build trees with a single value in CMAKE_OSX_ARCHITECTURES for each build tree.
On Windows, you should simply have two separate build trees, on for your 32-bit build and one for your 64-bit build.
if (APPLE)
....
endif(APPLE)
more information:
http://cmake.org/Wiki/CMake_Useful_Variables#System_.26_Compiler_Information

Cross-platform make system supporting 32/64 bit targets on Windows and Linux

I'm looking for a make system, along the lines of CMake or Bakefile, that supports the generation of Visual Studio project files and makefiles (targetting Linux) dual targeting x86 and x64 (in the same project/make file).
I've looked at CMake and Bakefile and they both appear to have limitations in this respect; they both appear to not support multiple targets (Bakefile doesn't even seem to support 64bit vcproj).
Are there any other tools, open source or paid, that may be suitable?
There's a (simple) patch for Bakefile that enables it -- you may be able to help with testing it.
Although it's a higher level tool and that you probably already know about it, I would propose SCons.
CMake can generate code multiple targets architectures (32 and 64 bit, say) on different platforms (win and linux, say). I can also use qmake (part of Qt) for this.

QtCreator for windows: is it possible to build 64 bit .exe?

Is it any way in QtCreator for windows to build a 64-bit executable? (I need to use a COM object as INPROC and this object is only available for 64 bit architecture)
I do not see any reason why not. You would need:
To be working on a 64-bit processor,
Ensure you have the Visual Studio 64 bit edition
Compile Qt on that 64 Bit setup
Compile QtCreator on that setup
The email says that debugging tools would also need to be compiled. I am not sure which debugger QtCreator uses but I would image it would be open source and you could compile it on that setup anyway.
Qt probably do not do it by default because they already produce loads of different builds for all the platforms they support and there has not yet been a large demand for 64bit windows desktop applications.
Pekka Gaiser correctly pointed to an email from Trolltech. Basically, that's it :)
Specifically: Seemingly there is no 64 bit cross-compiler for Windows (due to that, there is no 64bit VLC for Windows). Therefore, the Microsoft compiler must be used. Unfortunately, Creator's support for Microsoft's toolchain is limited (although they make big steps towards supporting it fully).
Again: The email pointed to by Pekka Gaiser contains the information and links for using Qt Creator with Microsoft's 64bit toolchain.

Resources