<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.next.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dkovari</id>
	<title>Code::Blocks - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.next.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dkovari"/>
	<link rel="alternate" type="text/html" href="https://wiki.next.codeblocks.org/index.php?title=Special:Contributions/Dkovari"/>
	<updated>2026-10-18T20:43:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.next.codeblocks.org/index.php?title=64Bit_Windows&amp;diff=7303</id>
		<title>64Bit Windows</title>
		<link rel="alternate" type="text/html" href="https://wiki.next.codeblocks.org/index.php?title=64Bit_Windows&amp;diff=7303"/>
		<updated>2012-07-24T16:00:33Z</updated>

		<summary type="html">&lt;p&gt;Dkovari: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
== How-to compile amd64 code with Code::Blocks ==&lt;br /&gt;
(by Tjaalie)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Requirements:&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
- Code::Bocks (just get a nightly build)&amp;lt;br&amp;gt;&lt;br /&gt;
- Windows SDK ([http://www.microsoft.com/downloads/details.aspx?familyid=C2B1E300-F358-4523-B479-F53D234CDCCF&amp;amp;displaylang=en])&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step1&#039;&#039;) Make sure you have a nightly build because I don’t think that RC2 supports all the needed functionality to setup the compiler.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step2&#039;&#039;) Install the Windows SDK, you can deselect all the .net stuff because we won’t be needing it.&lt;br /&gt;
*tip If you deselect the documentation parts you reduce the download size to under 100mb.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step3&#039;&#039;) Start Code::Blocks and go to ‘Settings-&amp;gt;Compiler and Debugger settings’, then select ‘Microsoft Visual C++ 2005’ from the dropdown box and click the copy button. Now choose a name I used ‘Windows SDK x64’ but you can name it whatever you like.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step4&#039;&#039;) Now with ‘Windows SDK x64’ as the selected compiler go to the ‘Toolchain executables’ tab and &#039;&#039;&#039;EMPTY&#039;&#039;&#039; the directory text box. Then click the ‘Additional Paths’ tab inside the ‘Toolchain executables’ tab. Remove the directory that goes to your Visual C++ 2005 install dir &#039;&#039;&#039;NOT&#039;&#039;&#039; the debug one and add the following directory’s:&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\x64&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\Bin\x64&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step5&#039;&#039;) Now go to the ‘Search Directories’ tab and remove all items under the ‘Compiler’, ‘Linker’ and ‘Resource compiler’ tabs. And then add the following,&lt;br /&gt;
Compiler:&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\INCLUDE&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\Include&amp;lt;br&amp;gt;&lt;br /&gt;
Linker:&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\LIB\x64&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\Lib\x64&amp;lt;br&amp;gt;&lt;br /&gt;
Resource Compiler:&amp;lt;br&amp;gt;&lt;br /&gt;
- None&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step6&#039;&#039;) Create a new project (console project) and select our new ‘Windows SDK x64’ compiler as the compiler to use. Now in the generated code add the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
*cout &amp;lt;&amp;lt; “sizeof(void*) = ” &amp;lt;&amp;lt; sizeof(void*) &amp;lt;&amp;lt; &amp;quot;;&amp;quot; &amp;lt;&amp;lt; endl;&amp;lt;br&amp;gt;&lt;br /&gt;
Hit the compile button and off we go. When we execute the program it appears to have a 8byte long address (64 bits).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Remarks&#039;&#039;) When you create a gui application Code::Blocks starts yelling at you about the PSDK, in fact the Windows SDK is the PSDK for Vista so you don’t need it, so you need to fill in a bogus path when creating the app (e.g. ‘c:\’) and then later remove the entries to the PSDK in ‘Build Options…-&amp;gt;Search Directories’. A new template would be cool but that’s something for another time.&lt;br /&gt;
&lt;br /&gt;
== Compiling amd64 code using Microsoft Visual C++ 2010 ==&lt;br /&gt;
The following instructions will allow you to compile 64-bit code using Microsoft&#039;s VC 2010 compiler (with the Windows SDK).&lt;br /&gt;
&#039;&#039;Requirements:&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
- Code::Bocks (at least as of 2012-07-23 the nightly build worked) [/index.php/board,20.0.html]&amp;lt;br&amp;gt;&lt;br /&gt;
-Microsoft Visual C++ 2010 express (or better) [http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express]&amp;lt;br&amp;gt;&lt;br /&gt;
-Microsoft Windows SDK v7.1 (earlier versions might not work, later version will probably work but directories will change) [http://www.microsoft.com/en-us/download/details.aspx?id=8279]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 1&#039;&#039;) Install Visual Studio 2010.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 2&#039;&#039;) Install Windwos SDK.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 3&#039;&#039;) Install Code::Blocks following instructions listed in nightly build forum. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note: Prior to setting up Code::Blocks for 64-Bit compiling, you may need to set the MSbuild environment to x64.  This can be done my running the command:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd&amp;quot; /x64&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 5&#039;&#039;) Run the new installation for the nightly build of Code::BLocks.  It should auto-detect your installed compilers, including the recently installed Visual C++ 2010.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 6&#039;&#039;) Once Code::Blocks open the &#039;Global Compiler Settings&#039; (Settings-&amp;gt;Compiler...).  Select &#039;Microsoft Visual C++ 2010&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
Now under the &#039;Toolchain executables&#039; Tab change the Compiler&#039;s installation directory to:&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64&amp;lt;br&amp;gt;&lt;br /&gt;
Note: if you installed VC to a different directory this path will change.  The important part is that you change the path to look in the &#039;.\bin\amd64&#039; directory.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
While still in the &#039;Toolchain...&#039; tab, click on &#039;Additional Paths&#039;.  Add the following:&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Next you need to add the x64 includes and lib file.&amp;lt;br&amp;gt;&lt;br /&gt;
Under the &#039;Search Directories&#039; tab add the following to the Compiler search path:&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Include&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include&amp;lt;br&amp;gt;&lt;br /&gt;
Note: the Windows SDK directory should be listed first&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now add the following to the Linker search path (in this order):&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should now be able to compile x64 code using VC 2010 (express).&amp;lt;br&amp;gt;&lt;br /&gt;
To test the compiler, build the following program:&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;main.cpp&#039;&#039;&lt;br /&gt;
&amp;lt;&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;SDKDDKVer.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;tchar.h&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;cstdlib&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int _tmain(int argc, _TCHAR* argv[])&lt;br /&gt;
{&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;sizeof(void*) = &amp;quot; &amp;lt;&amp;lt; sizeof(void*) &amp;lt;&amp;lt; &amp;quot;;&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If everything works correctly it should output: sizeof(void*) = 8;&lt;/div&gt;</summary>
		<author><name>Dkovari</name></author>
	</entry>
	<entry>
		<id>https://wiki.next.codeblocks.org/index.php?title=64Bit_Windows&amp;diff=7302</id>
		<title>64Bit Windows</title>
		<link rel="alternate" type="text/html" href="https://wiki.next.codeblocks.org/index.php?title=64Bit_Windows&amp;diff=7302"/>
		<updated>2012-07-24T16:00:08Z</updated>

		<summary type="html">&lt;p&gt;Dkovari: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
== How-to compile amd64 code with Code::Blocks ==&lt;br /&gt;
(by Tjaalie)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Requirements:&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
- Code::Bocks (just get a nightly build)&amp;lt;br&amp;gt;&lt;br /&gt;
- Windows SDK ([http://www.microsoft.com/downloads/details.aspx?familyid=C2B1E300-F358-4523-B479-F53D234CDCCF&amp;amp;displaylang=en])&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step1&#039;&#039;) Make sure you have a nightly build because I don’t think that RC2 supports all the needed functionality to setup the compiler.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step2&#039;&#039;) Install the Windows SDK, you can deselect all the .net stuff because we won’t be needing it.&lt;br /&gt;
*tip If you deselect the documentation parts you reduce the download size to under 100mb.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step3&#039;&#039;) Start Code::Blocks and go to ‘Settings-&amp;gt;Compiler and Debugger settings’, then select ‘Microsoft Visual C++ 2005’ from the dropdown box and click the copy button. Now choose a name I used ‘Windows SDK x64’ but you can name it whatever you like.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step4&#039;&#039;) Now with ‘Windows SDK x64’ as the selected compiler go to the ‘Toolchain executables’ tab and &#039;&#039;&#039;EMPTY&#039;&#039;&#039; the directory text box. Then click the ‘Additional Paths’ tab inside the ‘Toolchain executables’ tab. Remove the directory that goes to your Visual C++ 2005 install dir &#039;&#039;&#039;NOT&#039;&#039;&#039; the debug one and add the following directory’s:&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\x64&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\Bin\x64&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step5&#039;&#039;) Now go to the ‘Search Directories’ tab and remove all items under the ‘Compiler’, ‘Linker’ and ‘Resource compiler’ tabs. And then add the following,&lt;br /&gt;
Compiler:&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\INCLUDE&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\Include&amp;lt;br&amp;gt;&lt;br /&gt;
Linker:&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\LIB\x64&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\Lib\x64&amp;lt;br&amp;gt;&lt;br /&gt;
Resource Compiler:&amp;lt;br&amp;gt;&lt;br /&gt;
- None&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step6&#039;&#039;) Create a new project (console project) and select our new ‘Windows SDK x64’ compiler as the compiler to use. Now in the generated code add the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
*cout &amp;lt;&amp;lt; “sizeof(void*) = ” &amp;lt;&amp;lt; sizeof(void*) &amp;lt;&amp;lt; &amp;quot;;&amp;quot; &amp;lt;&amp;lt; endl;&amp;lt;br&amp;gt;&lt;br /&gt;
Hit the compile button and off we go. When we execute the program it appears to have a 8byte long address (64 bits).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Remarks&#039;&#039;) When you create a gui application Code::Blocks starts yelling at you about the PSDK, in fact the Windows SDK is the PSDK for Vista so you don’t need it, so you need to fill in a bogus path when creating the app (e.g. ‘c:\’) and then later remove the entries to the PSDK in ‘Build Options…-&amp;gt;Search Directories’. A new template would be cool but that’s something for another time.&lt;br /&gt;
&lt;br /&gt;
== Compiling amd64 code using Microsoft Visual C 2010 ==&lt;br /&gt;
The following instructions will allow you to compile 64-bit code using Microsoft&#039;s VC 2010 compiler (with the Windows SDK).&lt;br /&gt;
&#039;&#039;Requirements:&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
- Code::Bocks (at least as of 2012-07-23 the nightly build worked) [/index.php/board,20.0.html]&amp;lt;br&amp;gt;&lt;br /&gt;
-Microsoft Visual C++ 2010 express (or better) [http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express]&amp;lt;br&amp;gt;&lt;br /&gt;
-Microsoft Windows SDK v7.1 (earlier versions might not work, later version will probably work but directories will change) [http://www.microsoft.com/en-us/download/details.aspx?id=8279]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 1&#039;&#039;) Install Visual Studio 2010.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 2&#039;&#039;) Install Windwos SDK.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 3&#039;&#039;) Install Code::Blocks following instructions listed in nightly build forum. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note: Prior to setting up Code::Blocks for 64-Bit compiling, you may need to set the MSbuild environment to x64.  This can be done my running the command:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd&amp;quot; /x64&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 5&#039;&#039;) Run the new installation for the nightly build of Code::BLocks.  It should auto-detect your installed compilers, including the recently installed Visual C++ 2010.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 6&#039;&#039;) Once Code::Blocks open the &#039;Global Compiler Settings&#039; (Settings-&amp;gt;Compiler...).  Select &#039;Microsoft Visual C++ 2010&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
Now under the &#039;Toolchain executables&#039; Tab change the Compiler&#039;s installation directory to:&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64&amp;lt;br&amp;gt;&lt;br /&gt;
Note: if you installed VC to a different directory this path will change.  The important part is that you change the path to look in the &#039;.\bin\amd64&#039; directory.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
While still in the &#039;Toolchain...&#039; tab, click on &#039;Additional Paths&#039;.  Add the following:&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Next you need to add the x64 includes and lib file.&amp;lt;br&amp;gt;&lt;br /&gt;
Under the &#039;Search Directories&#039; tab add the following to the Compiler search path:&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Include&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include&amp;lt;br&amp;gt;&lt;br /&gt;
Note: the Windows SDK directory should be listed first&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now add the following to the Linker search path (in this order):&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should now be able to compile x64 code using VC 2010 (express).&amp;lt;br&amp;gt;&lt;br /&gt;
To test the compiler, build the following program:&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;main.cpp&#039;&#039;&lt;br /&gt;
&amp;lt;&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;SDKDDKVer.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;tchar.h&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;cstdlib&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int _tmain(int argc, _TCHAR* argv[])&lt;br /&gt;
{&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;sizeof(void*) = &amp;quot; &amp;lt;&amp;lt; sizeof(void*) &amp;lt;&amp;lt; &amp;quot;;&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If everything works correctly it should output: sizeof(void*) = 8;&lt;/div&gt;</summary>
		<author><name>Dkovari</name></author>
	</entry>
	<entry>
		<id>https://wiki.next.codeblocks.org/index.php?title=64Bit_Windows&amp;diff=7301</id>
		<title>64Bit Windows</title>
		<link rel="alternate" type="text/html" href="https://wiki.next.codeblocks.org/index.php?title=64Bit_Windows&amp;diff=7301"/>
		<updated>2012-07-24T15:58:15Z</updated>

		<summary type="html">&lt;p&gt;Dkovari: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
== How-to compile amd64 code with Code::Blocks ==&lt;br /&gt;
(by Tjaalie)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Requirements:&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
- Code::Bocks (just get a nightly build)&amp;lt;br&amp;gt;&lt;br /&gt;
- Windows SDK ([http://www.microsoft.com/downloads/details.aspx?familyid=C2B1E300-F358-4523-B479-F53D234CDCCF&amp;amp;displaylang=en])&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step1&#039;&#039;) Make sure you have a nightly build because I don’t think that RC2 supports all the needed functionality to setup the compiler.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step2&#039;&#039;) Install the Windows SDK, you can deselect all the .net stuff because we won’t be needing it.&lt;br /&gt;
*tip If you deselect the documentation parts you reduce the download size to under 100mb.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step3&#039;&#039;) Start Code::Blocks and go to ‘Settings-&amp;gt;Compiler and Debugger settings’, then select ‘Microsoft Visual C++ 2005’ from the dropdown box and click the copy button. Now choose a name I used ‘Windows SDK x64’ but you can name it whatever you like.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step4&#039;&#039;) Now with ‘Windows SDK x64’ as the selected compiler go to the ‘Toolchain executables’ tab and &#039;&#039;&#039;EMPTY&#039;&#039;&#039; the directory text box. Then click the ‘Additional Paths’ tab inside the ‘Toolchain executables’ tab. Remove the directory that goes to your Visual C++ 2005 install dir &#039;&#039;&#039;NOT&#039;&#039;&#039; the debug one and add the following directory’s:&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\x64&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\Bin\x64&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step5&#039;&#039;) Now go to the ‘Search Directories’ tab and remove all items under the ‘Compiler’, ‘Linker’ and ‘Resource compiler’ tabs. And then add the following,&lt;br /&gt;
Compiler:&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\INCLUDE&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\Include&amp;lt;br&amp;gt;&lt;br /&gt;
Linker:&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\LIB\x64&amp;lt;br&amp;gt;&lt;br /&gt;
- C:\Program Files\Microsoft SDKs\Windows\v6.0\Lib\x64&amp;lt;br&amp;gt;&lt;br /&gt;
Resource Compiler:&amp;lt;br&amp;gt;&lt;br /&gt;
- None&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step6&#039;&#039;) Create a new project (console project) and select our new ‘Windows SDK x64’ compiler as the compiler to use. Now in the generated code add the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
*cout &amp;lt;&amp;lt; “sizeof(void*) = ” &amp;lt;&amp;lt; sizeof(void*) &amp;lt;&amp;lt; &amp;quot;;&amp;quot; &amp;lt;&amp;lt; endl;&amp;lt;br&amp;gt;&lt;br /&gt;
Hit the compile button and off we go. When we execute the program it appears to have a 8byte long address (64 bits).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Remarks&#039;&#039;) When you create a gui application Code::Blocks starts yelling at you about the PSDK, in fact the Windows SDK is the PSDK for Vista so you don’t need it, so you need to fill in a bogus path when creating the app (e.g. ‘c:\’) and then later remove the entries to the PSDK in ‘Build Options…-&amp;gt;Search Directories’. A new template would be cool but that’s something for another time.&lt;br /&gt;
&lt;br /&gt;
== Compiling amd64 code using Microsoft Visual C 2010 ==&lt;br /&gt;
The following instructions will allow you to compile 64-bit code using Microsoft&#039;s VC 2010 compiler (with the Windows SDK).&lt;br /&gt;
&#039;&#039;Requirements:&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
- Code::Bocks (at least as of 2012-07-23 the nightly build worked) [/index.php/board,20.0.html]&amp;lt;br&amp;gt;&lt;br /&gt;
-Microsoft Visual C++ 2010 express (or better) [http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express]&amp;lt;br&amp;gt;&lt;br /&gt;
-Microsoft Windows SDK v7.1 (earlier versions might not work, later version will probably work but directories will change) [http://www.microsoft.com/en-us/download/details.aspx?id=8279]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Step 1&#039;&#039;) Install Visual Studio 2010.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 2&#039;&#039;) Install Windwos SDK.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 3&#039;&#039;) Install Code::Blocks following instructions listed in nightly build forum. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note: Prior to setting up Code::Blocks for 64-Bit compiling, you may need to set the MSbuild environment to x64.  This can be done my running the command:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd&amp;quot; /x64&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 5&#039;&#039;) Run the new installation for the nightly build of Code::BLocks.  It should auto-detect your installed compilers, including the recently installed Visual C++ 2010.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Step 6&#039;&#039;) Once Code::Blocks open the &#039;Global Compiler Settings&#039; (Settings-&amp;gt;Compiler...).  Select &#039;Microsoft Visual C++ 2010&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
Now under the &#039;Toolchain executables&#039; Tab change the Compiler&#039;s installation directory to:&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64&amp;lt;br&amp;gt;&lt;br /&gt;
Note: if you installed VC to a different directory this path will change.  The important part is that you change the path to look in the &#039;.\bin\amd64&#039; directory.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
While still in the &#039;Toolchain...&#039; tab, click on &#039;Additional Paths&#039;.  Add the following:&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Next you need to add the x64 includes and lib file.&amp;lt;br&amp;gt;&lt;br /&gt;
Under the &#039;Search Directories&#039; tab add the following to the Compiler search path:&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Include&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include&amp;lt;br&amp;gt;&lt;br /&gt;
Note: the Windows SDK directory should be listed first&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now add the following to the Linker search path (in this order):&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib&amp;lt;br&amp;gt;&lt;br /&gt;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should now be able to compile x64 code using VC 2010 (express).&amp;lt;br&amp;gt;&lt;br /&gt;
To test the compiler build the following program:&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;main.cpp&#039;&#039;&lt;br /&gt;
&amp;lt;&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;SDKDDKVer.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;tchar.h&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;cstdlib&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int _tmain(int argc, _TCHAR* argv[])&lt;br /&gt;
{&lt;br /&gt;
    cout &amp;lt;&amp;lt; &amp;quot;sizeof(void*) = &amp;quot; &amp;lt;&amp;lt; sizeof(void*) &amp;lt;&amp;lt; &amp;quot;;&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If everything works correctly it should output: sizeof(void*) = 8;&lt;/div&gt;</summary>
		<author><name>Dkovari</name></author>
	</entry>
</feed>