https://wiki.codeblocks.org/api.php?action=feedcontributions&user=Squizzz&feedformat=atomCode::Blocks - User contributions [en]2024-03-29T09:28:23ZUser contributionsMediaWiki 1.35.0https://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE&diff=2604Integrating Microsoft Visual Toolkit 2003 with Code::Blocks IDE2006-04-07T09:53:43Z<p>Squizzz: </p>
<hr />
<div>[[Category:Installation]]<br />
[[Category:Compiler]]<br />
==Microsoft Visual C++ Toolkit 2003 - Overview==<br />
'''Microsoft Visual C++ Toolkit 2003''' (or VCToolkit, MVCT) is freely available and free for commercial use minimalistic compiler suite released by Microsoft. It consists of high quality C/C++ optimizing compiler (VC 7.1, which is much better than old VC++ 6.0) and linker, but obviously comes without IDE, thus making management of medium and larger projects nearly impossible. Luckily, it's where Code::Blocks IDE with its multi-compiler integration feature comes in handy! This tutorial will cover process of integrating these two incredible pieces of software - VCToolkit and Code::Blocks IDE.<br />
<br />
'''Note:''' if you like watching rather than reading, and don't mind downloading 40MB, you can get videos made by guys from [http://www.gametutorials.com Gametutorials.com]. They have provided us with some easy step-by-step [http://www.gametutorials.com/codeblocks_tutorials.zip Code::Blocks tutorials], that will help you successfully set up your first steps with VC Toolkit compiler.. :)<br />
<br />
==What does VC Toolkit include, and what does it not?==<br />
<br />
According to '''readme.txt''' shipped with package, Microsoft Visual C++ Toolkit 2003 '''does include''':<br />
<br />
* Visual C/C++ compiler and linker, same as these shipped with Visual Studio .NET 2003 Professional! <br />
<br />
* C Runtime Library and the C++ Standard Library, including the Standard Template Library. These are the same static-link libraries included with Visual Studio.<br />
<br />
* Microsoft .NET Framework Common Language Runtime. Visual C++ can optionally build applications that run on the Common Language Runtime (CLR). <br />
<br />
* Code samples. The toolkit includes four samples designed to showcase the powerful new features of the 2003 version, including new optimization capabilities, features to improve code-security and robustness, enhanced ISO C++ standards support, and the ability to use the .NET Framework library and target the CLR. <br />
<br />
According the same source, MSVT '''does NOT include''':<br />
<br />
* Various development tools shipped only with commercial Visual Studio IDE - like debugger, profiler, etc.<br />
<br />
* Microsoft Foundation Class (MFC) and Active Template Libraries (ATL). <br />
<br />
* Advanced developer tools, including compilers and tools for developing using other languages like Visual Basic and C#.<br />
<br />
==Packages needed==<br />
In order to set up '''Code::Blocks IDE''' with '''Microsoft Visual C++ Toolkit 2003''' you need following packages:<br />
<br />
* '''Code::Blocks IDE''' itself.<br />
: You can grab the latest version of '''Code::Blocks IDE''' in download section of [http://codeblocks.org/downloads.shtml Code::Blocks homepage] or at [http://sourceforge.net/project/showfiles.php?group_id=126998 project's site] at [http://sourceforge.net Source Forge]. (~3 MB)<br />
<br />
* '''Microsoft Visual C++ Toolkit 2003''' compiler suite<br />
: This package contains fully functional Visual C++ 7.1 compiler suite, which is '''free for commercial use'''. It contains minimalistic set of tools and C/C++ header and library files required for basic application development. You can download latest release of MVCT from [http://www.microsoft.com/downloads/details.aspx?FamilyId=272BE09D-40BB-49FD-9CB0-4BFA122FA91B&displaylang=en Microsoft's website]. (~31.4 MB)<br />
<br />
===Optional RECOMMENDED packages===<br />
Rather sooner than later you will encounter problems with missing libraries, that are not included in MVCT bundle. To save yourself most of the trouble you should install freely available SDK packages available at Microsoft's website. They will greatly enchance functionality offered by VC7.1. <br />
<br />
Packages that you should definitely take a look are:<br />
<br />
* '''Platform SDK'''<br />
: This package provides a whole bunch of useful stuff not only for Visual C++ compiler users, but generally, any Windows developer - it includes extensive headers and libraries, as well as tools (like resource compiler, '''not included''' in basic VCToolkit package), documentation and samples.<br />
<br />
: There are three ways to obtain '''Platform SDK''':<br />
<blockquote><br />
* [http://www.microsoft.com/downloads/details.aspx?FamilyID=a55b6b43-e24f-4ea3-a93e-40c0ec4f68e5&DisplayLang=en Platform SDK Web Install]<br />
: '''Platform SDK''' in its most compact shape - download tiny (~1.2 MB), compact installer, which will guide you through rest of the installation process (online). You will also decide yourself which components you want to install.<br />
<br />
* [http://www.microsoft.com/downloads/details.aspx?FamilyID=eba0128f-a770-45f1-86f3-7ab010b398a3&DisplayLang=en Platform SDK Full Download] (beware, it's HUGE!)<br />
: Complete '''Platform SDK''', with all things you will ever need or not. Huge, self-extracting *.cab installer.<br />
<br />
* [http://www.microsoft.com/downloads/details.aspx?familyid=D8EECD75-1FC4-49E5-BC66-9DA2B03D9B92&displaylang=en Platform SDK ISO Install] (beware, it's HUGE!)<br />
: Same as above, but you get it as *.img (CD image) file.<br />
</blockquote><br />
: Choose the most convinient way for yourself.<br />
<br />
* '''.NET Framework SDK Version 1.1'''<br />
: This package provides a lot of stuff useful for .NET development, but also, few crucial libraries that are missing (in their debug & multithreaded version) in regular Platform SDK - for more details check [[FAQ#I_can.27t_compile_a_multithreaded_app_with_VC_Toolkit.21_Where_are_the_libraries.3F|this Code::Blocks FAQ entry]]. You can download .NET Framework SDK [http://www.microsoft.com/downloads/details.aspx?FamilyId=9B3A2CA6-3647-4070-9F41-A333C6B9181D&displaylang=en here].<br />
<br />
* '''DirectX SDK'''<br />
: If you are interested in Graphics programming, you might try to integrate DirectX SDK with your MVCT as well (feel free to update C::B Wiki about your succesful attempts, DirectX setup & "hello DX world" compilation are welcome! :P). You can get DirectX SDK [http://www.microsoft.com/downloads/details.aspx?FamilyId=3904B19A-02B9-447B-AB58-C12E2456E9BA&displaylang=en here].<br />
<br />
==Okay, so let's proceed with installation:==<br />
<br />
Basically, it doesn't really matter what you install first. The most convinient way, however, is to have compiler suite installed before running '''Code::Blocks IDE''' for the first time. In such case, C::B will likely autodetect available compilers during its startup, and set up everything correctly. If you have some of the components already installed, just skip that part.<br />
<br />
===Installing Microsoft Visual C++ Toolkit 2003===<br />
Simply run '''VCToolkitSetup.exe''' and installation process will start. Select a path you want to install MVCT to. This tutorial assumes you installed it to:<br />
C:\VCToolkit2003\<br />
When installation is done, navigate to the MSVT directory ("C:\VCToolkit2003\") and run vcvars32.bat. It will set up enviromental variables.<br />
<br />
'''Note:''' <small>Install MSVT to any subfolder, installing it to bare "C:\" or "D:\" (or any drive letter) will likely cause compiler/linker produce very strange compilation errors and well, its general malfunction :)</small><br />
<br />
'''Note 2:''' <small>Installing VCToolkit requires .NET Framework. Most likely you already have it. If not, setup will trigger .NET Framework installation and proceed it smoothly on older Windows NT systems (NT & 2000), newer ones (XP and above) already have it. This one will, however, fail if you have Windows 9x/Me. In order to install VCToolkit on these machines you need to install .NET Framework manually, preventing setup from triggering malfunctioning procedure. [TODO: it would be great if someone who actually tried it describe it somewhere here]</small><br />
<br />
===Installing Platform SDK===<br />
In this tutorial we will follow '''Platform SDK Web Install'''. Download (links above) and run '''PSDK-x86.exe''', '''PSDK-amd64.exe''' or '''PSDK-ia64.exe''' (according your PCs architecture). Select a path you want to install Platform SDK to. We will use <br />
C:\PlatformSDK\<br />
If you select '''custom installation''', you will have to select which components you want to install. I didn't dare to run '''typical installation''', because it presumably downloads & installs everything (= hundreds of megabytes). Selecting components may be a little tricky, most of them are related to various Microsoft technologies, and if you are using any of them in your applications, you should install these features here, otherwise your programs will likely fail to compile and/or link correctly. You can update your Platform SDK installation at any time.<br />
<br />
When installation is finished, navigate to the Platform SDK directory ("C:\PlatformSDK\") and run '''SetEnv.Cmd'''.<br />
<br />
===Installing Code::Blocks IDE===<br />
Simply run setup file, and select a path where you want it to be installed. <br />
<br />
'''Note:''' some of the plugins are '''MinGW''' specific (GDB plugin, DevPak plugin). If you are not sure whether you might need them some day (you may switch to '''MinGW''' or simply decide to use more than one compiler), better install them (they are just few kilobytes anyway) and eventually keep them disabled.<br />
<br />
Now you can run the '''Code::Blocks IDE''' for the first time, and set up the compiler.<br />
<br />
==Setting up the compiler==<br />
===First run compiler auto-detection===<br />
If you have already installed MVCT on your machine, Code::Blocks will autodetect it now ([http://img289.imageshack.us/img289/4028/compilerautodetecton8rb.png screen]), as well as all other supported compilers that are present. If more than one compiler is detected, you can set one of them as default one.<br />
<br />
After this step, you should have Visual C++ compiler almost fully integrated with Code::Blocks.<br />
You only need to inform compiler about your Platform SDK installation and goodies (like resource compiler) it should find there. Now, either go to "Settings->Compiler" (in your C::B IDE) and then jump quickly to [[#Setting Platform SDK]], or read further to know more details and verify your auto-detection results.<br />
<br />
===Setting compiler from scratch (missed or failed first run auto-detection)===<br />
In case you missed first run auto-detection (MVCT was not present at the time) or somehow it failed, you have to set up your compiler manually. Whole procedure is actually common for any supported compiler, and applies to Microsoft Visual C++ Toolkit 2003 perfectly:<br />
<br />
'''''Golden Tip :''' "In order to integrate any supported compiler with Code::Blocks, all you need to do is to correctly specify location of compiler's executables, as well as compiler's (include) and linker's (lib) directories".''<br />
====Specifying location of compiler's executables====<br />
Go to "Settings->Compiler" and make sure that "Microsoft Visual C++ Toolkit 2003" is selected.<br />
<br />
Open "Programs" tab - verify whether '''''Compiler's installation directory''''' (the same you installed VCToolkit to, ie: "C:\VCToolkit2003\" ) is set properly - if not - press "Autodetect". If correct path doesn't appear, simply paste the correct one there or navigate to it using dialog available under "..." button.<br />
<br />
Note that all specified executables (compiler, linker, resource compiler) must exist either in the "bin" subdirectory of '''''Compiler's installation path''''' (ie: "C:\VCToolkit2003\bin\") or in any other path specified here as "Extra path". (see [http://img289.imageshack.us/img289/772/settingexepaths7yx.png screen])<br />
<br />
====Specifying location of compiler's and linker's directories====<br />
Open "Directories" tab and verify if following entries are present:<br />
<br />
"Compiler" tab - entries should point to "include" directories:<br />
C:\VCToolkit2003\include<br />
<br />
"Linker" tab - entries should point to "lib" directories:<br />
C:\VCToolkit2003\lib<br />
<br />
If not, do not hestitate to add these ones.<br />
<br />
'''Note:''' If you ever be using any library that is not included in MVCT (like FMOD, Allegro, or any of thousands open source libraries out there), you need either to add appropriate "include" and "libs" paths here too, or copy headers and libs to already specified paths.<br />
<br />
===Setting Platform SDK (these steps applies to .NET SDK and DirectX SDK as well)===<br />
Setting up Platform SDK looks the same as previous step, you just have to add appropriate entries that point to Platform SDK's "include" and "lib" subdirectories respectively.<br />
<br />
Being in "Directories" tab just add following entries:<br />
<br />
"Compiler" tab:<br />
C:\PlatformSDK\Include<br />
<br />
"Linker" tab:<br />
C:\PlatformSDK\Lib<br />
<br />
"Resource compiler" tab:<br />
C:\PlatformSDK\Include<br />
<br />
Do not forget to specify extra path for resource compiler executable (it's in Platform SDK's "bin" subdirectory, ie: "C:\PlatformSDK\Bin" ) - you can do this in "Programs" tab (see [http://img289.imageshack.us/img289/772/settingexepaths7yx.png screen])<br />
<br />
<br />
That's all - you can compile your applications using free Microsoft Visual C++ Toolkit 2003 with Code::Blocks as your IDE.<br />
<br />
Enjoy!<br />
<br />
===Compiling Hints===<br />
<br />
-H1: If the project cannot find "lib.exe" or "cvtres.exe" then use the ones in C:\Program Files\Microsoft Platform SDK\Bin\win64. They correctly make lib files for 32-bit windows. So add to the END of Programs->Additional paths under "Compiler Settings":<br />
C:\Program Files\Microsoft Platform SDK\Bin\win64<br />
<br />
-H2: If the project you are compiling complains that it cannot find "msvcrt.lib" then download the .NET 1.1 SDK and add to the END of the Directories->Linker tab:<br />
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib<br />
<br />
Both the VC++ Toolkit 2003 and the platform SDK omit this library.<br />
<br />
-H3: Note that the VC++ Toolkit itself does not come with debugging versions of the .lib library files. For these you should also download the .NET 1.1 SDK and add the linker path as in H2 above.<br />
<br />
The MS naming convention for some their libraries seems to be e.g.<br />
release version = libc.lib<br />
debug version = libcd.lib<br />
multithreaded release version = libmt.lib<br />
etc. (not sure about the 'i' or 'p' variants) <br><br />
The above link statically.<br />
dynamic multithreaded release version (uses a dll) = msvcrt.lib<br />
<br />
===Problems and Solutions===<br />
<br />
'''Resources adding via a '.rc' file to a Windows program are not linked into the program.'''<br />
: Go to "Settings->Compiler->[select MSVCToolkit]->Other->Advanced options" and make sure that the command line macro for "Link object files to executable" is like this: "$linker /nologo /subsystem:windows $libdirs /out:$exe_output $libs $link_objects $link_resobjects $link_options"</div>Squizzzhttps://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE&diff=2594Integrating Microsoft Visual Toolkit 2003 with Code::Blocks IDE2006-04-03T00:53:13Z<p>Squizzz: link to FAQ updated</p>
<hr />
<div>[[Category:Installation]]<br />
[[Category:Compiler]]<br />
==Microsoft Visual C++ Toolkit 2003 - Overview==<br />
'''Microsoft Visual C++ Toolkit 2003''' (or VCToolkit, MVCT) is freely available and free for commercial use minimalistic compiler suite released by Microsoft. It consists of high quality C/C++ optimizing compiler (VC 7.1, which is much better than old VC++ 6.0) and linker, but obviously comes without IDE, thus making management of medium and larger projects nearly impossible. Luckily, it's where Code::Blocks IDE with its multi-compiler integration feature comes in handy! This tutorial will cover process of integrating these two incredible pieces of software - VCToolkit and Code::Blocks IDE.<br />
<br />
'''Note:''' if you like watching rather than reading, and don't mind downloading 40MB, you can get videos made by guys from [http://www.gametutorials.com Gametutorials.com]. They have provided us with some easy step-by-step [http://www.gametutorials.com/codeblocks_tutorials.zip Code::Blocks tutorials], that will help you successfully set up your first steps with VC Toolkit compiler.. :)<br />
<br />
==What does VC Toolkit include, and what does it not?==<br />
<br />
According to '''readme.txt''' shipped with package, Microsoft Visual C++ Toolkit 2003 '''does include''':<br />
<br />
* Visual C/C++ compiler and linker, same as these shipped with Visual Studio .NET 2003 Professional! <br />
<br />
* C Runtime Library and the C++ Standard Library, including the Standard Template Library. These are the same static-link libraries included with Visual Studio.<br />
<br />
* Microsoft .NET Framework Common Language Runtime. Visual C++ can optionally build applications that run on the Common Language Runtime (CLR). <br />
<br />
* Code samples. The toolkit includes four samples designed to showcase the powerful new features of the 2003 version, including new optimization capabilities, features to improve code-security and robustness, enhanced ISO C++ standards support, and the ability to use the .NET Framework library and target the CLR. <br />
<br />
According the same source, MSVT '''does NOT include''':<br />
<br />
* Various development tools shipped only with commercial Visual Studio IDE - like debugger, profiler, etc.<br />
<br />
* Microsoft Foundation Class (MFC) and Active Template Libraries (ATL). <br />
<br />
* Advanced developer tools, including compilers and tools for developing using other languages like Visual Basic and C#.<br />
<br />
==Packages needed==<br />
In order to set up '''Code::Blocks IDE''' with '''Microsoft Visual C++ Toolkit 2003''' you need following packages:<br />
<br />
* '''Code::Blocks IDE''' itself.<br />
: You can grab the latest version of '''Code::Blocks IDE''' in download section of [http://codeblocks.org/downloads.shtml Code::Blocks homepage] or at [http://sourceforge.net/project/showfiles.php?group_id=126998 project's site] at [http://sourceforge.net Source Forge]. (~3 MB)<br />
<br />
* '''Microsoft Visual C++ Toolkit 2003''' compiler suite<br />
: This package contains fully functional Visual C++ 7.1 compiler suite, which is '''free for commercial use'''. It contains minimalistic set of tools and C/C++ header and library files required for basic application development. You can download latest release of MVCT from [http://www.microsoft.com/downloads/details.aspx?FamilyId=272BE09D-40BB-49FD-9CB0-4BFA122FA91B&displaylang=en Microsoft's website]. (~31.4 MB)<br />
<br />
===Optional RECOMMENDED packages===<br />
Rather sooner than later you will encounter problems with missing libraries, that are not included in MVCT bundle. To save yourself most of the trouble you should install freely available SDK packages available at M$ site. They will greatly enchance possibilities offered by VC7.1 :)<br />
<br />
Packages that you should definitely take a look are:<br />
<br />
* '''Platform SDK'''<br />
: This package provides a whole bunch of useful stuff not only for Visual C++ compiler users, but generally, any Windows developer - it includes extensive headers and libraries, as well as tools (like resource compiler, '''not included''' in basic VCToolkit package), documentation and samples.<br />
<br />
: There are three ways to obtain '''Platform SDK''':<br />
<blockquote><br />
* [http://www.microsoft.com/downloads/details.aspx?FamilyID=a55b6b43-e24f-4ea3-a93e-40c0ec4f68e5&DisplayLang=en Platform SDK Web Install]<br />
: '''Platform SDK''' in its most compact shape - download tiny (~1.2 MB), compact installer, which will guide you through rest of the installation process (online). You will also decide yourself which components you want to install.<br />
<br />
* [http://www.microsoft.com/downloads/details.aspx?FamilyID=eba0128f-a770-45f1-86f3-7ab010b398a3&DisplayLang=en Platform SDK Full Download] (beware, it's HUGE!)<br />
: Complete '''Platform SDK''', with all things you will ever need or not. Huge, self-extracting *.cab installer.<br />
<br />
* [http://www.microsoft.com/downloads/details.aspx?familyid=D8EECD75-1FC4-49E5-BC66-9DA2B03D9B92&displaylang=en Platform SDK ISO Install] (beware, it's HUGE!)<br />
: Same as above, but you get it as *.img (CD image) file.<br />
</blockquote><br />
: Choose the most convinient way for yourself.<br />
<br />
* '''.NET Framework SDK Version 1.1'''<br />
: This package provides a lot of stuff useful for .NET development, but also, few crucial libraries that are missing (in their debug & multithreaded version) in regular Platform SDK - for more details check [[FAQ#I_can.27t_compile_a_multithreaded_app_with_VC_Toolkit.21_Where_are_the_libraries.3F|this Code::Blocks FAQ entry]]. You can download .NET Framework SDK [http://www.microsoft.com/downloads/details.aspx?FamilyId=9B3A2CA6-3647-4070-9F41-A333C6B9181D&displaylang=en here].<br />
<br />
* '''DirectX SDK'''<br />
: If you are interested in Graphics programming, you might try to integrate DirectX SDK with your MVCT as well (feel free to update C::B Wiki about your succesful attempts, DirectX setup & "hello DX world" compilation are welcome! :P). You can get DirectX SDK [http://www.microsoft.com/downloads/details.aspx?FamilyId=3904B19A-02B9-447B-AB58-C12E2456E9BA&displaylang=en here].<br />
<br />
==Okay, so let's proceed with installation:==<br />
<br />
Basically, it doesn't really matter what you install first. The most convinient way, however, is to have compiler suite installed before running '''Code::Blocks IDE''' for the first time. In such case, C::B will likely autodetect available compilers during its startup, and set up everything correctly. If you have some of the components already installed, just skip that part.<br />
<br />
===Installing Microsoft Visual C++ Toolkit 2003===<br />
Simply run '''VCToolkitSetup.exe''' and installation process will start. Select a path you want to install MVCT to. This tutorial assumes you installed it to:<br />
C:\VCToolkit2003\<br />
When installation is done, navigate to the MSVT directory ("C:\VCToolkit2003\") and run vcvars32.bat. It will set up enviromental variables.<br />
<br />
'''Note:''' <small>Install MSVT to any subfolder, installing it to bare "C:\" or "D:\" (or any drive letter) will likely cause compiler/linker produce very strange compilation errors and well, its general malfunction :)</small><br />
<br />
'''Note 2:''' <small>Installing VCToolkit requires .NET Framework. Most likely you already have it. If not, setup will trigger .NET Framework installation and proceed it smoothly on older Windows NT systems (NT & 2000), newer ones (XP and above) already have it. This one will, however, fail if you have Windows 9x/Me. In order to install VCToolkit on these machines you need to install .NET Framework manually, preventing setup from triggering malfunctioning procedure. [TODO: it would be great if someone who actually tried it describe it somewhere here]</small><br />
<br />
===Installing Platform SDK===<br />
In this tutorial we will follow '''Platform SDK Web Install'''. Download (links above) and run '''PSDK-x86.exe''', '''PSDK-amd64.exe''' or '''PSDK-ia64.exe''' (according your PCs architecture). Select a path you want to install Platform SDK to. We will use <br />
C:\PlatformSDK\<br />
If you select '''custom installation''', you will have to select which components you want to install. I didn't dare to run '''typical installation''', because it presumably downloads & installs everything (= hundreds of megabytes). Selecting components may be a little tricky, most of them are related to various Microsoft technologies, and if you are using any of them in your applications, you should install these features here, otherwise your programs will likely fail to compile and/or link correctly. You can update your Platform SDK installation at any time.<br />
<br />
When installation is finished, navigate to the Platform SDK directory ("C:\PlatformSDK\") and run '''SetEnv.Cmd'''.<br />
<br />
===Installing Code::Blocks IDE===<br />
Simply run setup file, and select a path where you want it to be installed. <br />
<br />
'''Note:''' some of the plugins are '''MinGW''' specific (GDB plugin, DevPak plugin). If you are not sure whether you might need them some day (you may switch to '''MinGW''' or simply decide to use more than one compiler), better install them (they are just few kilobytes anyway) and eventually keep them disabled.<br />
<br />
Now you can run the '''Code::Blocks IDE''' for the first time, and set up the compiler.<br />
<br />
==Setting up the compiler==<br />
===First run compiler auto-detection===<br />
If you have already installed MVCT on your machine, Code::Blocks will autodetect it now ([http://img289.imageshack.us/img289/4028/compilerautodetecton8rb.png screen]), as well as all other supported compilers that are present. If more than one compiler is detected, you can set one of them as default one.<br />
<br />
After this step, you should have Visual C++ compiler almost fully integrated with Code::Blocks.<br />
You only need to inform compiler about your Platform SDK installation and goodies (like resource compiler) it should find there. Now, either go to "Settings->Compiler" (in your C::B IDE) and then jump quickly to [[#Setting Platform SDK]], or read further to know more details and verify your auto-detection results.<br />
<br />
===Setting compiler from scratch (missed or failed first run auto-detection)===<br />
In case you missed first run auto-detection (MVCT was not present at the time) or somehow it failed, you have to set up your compiler manually. Whole procedure is actually common for any supported compiler, and applies to Microsoft Visual C++ Toolkit 2003 perfectly:<br />
<br />
'''''Golden Tip :''' "In order to integrate any supported compiler with Code::Blocks, all you need to do is to correctly specify location of compiler's executables, as well as compiler's (include) and linker's (lib) directories".''<br />
====Specifying location of compiler's executables====<br />
Go to "Settings->Compiler" and make sure that "Microsoft Visual C++ Toolkit 2003" is selected.<br />
<br />
Open "Programs" tab - verify whether '''''Compiler's installation directory''''' (the same you installed VCToolkit to, ie: "C:\VCToolkit2003\" ) is set properly - if not - press "Autodetect". If correct path doesn't appear, simply paste the correct one there or navigate to it using dialog available under "..." button.<br />
<br />
Note that all specified executables (compiler, linker, resource compiler) must exist either in the "bin" subdirectory of '''''Compiler's installation path''''' (ie: "C:\VCToolkit2003\bin\") or in any other path specified here as "Extra path". (see [http://img289.imageshack.us/img289/772/settingexepaths7yx.png screen])<br />
<br />
====Specifying location of compiler's and linker's directories====<br />
Open "Directories" tab and verify if following entries are present:<br />
<br />
"Compiler" tab - entries should point to "include" directories:<br />
C:\VCToolkit2003\include<br />
<br />
"Linker" tab - entries should point to "lib" directories:<br />
C:\VCToolkit2003\lib<br />
<br />
If not, do not hestitate to add these ones.<br />
<br />
'''Note:''' If you ever be using any library that is not included in MVCT (like FMOD, Allegro, or any of thousands open source libraries out there), you need either to add appropriate "include" and "libs" paths here too, or copy headers and libs to already specified paths.<br />
<br />
===Setting Platform SDK (these steps applies to .NET SDK and DirectX SDK as well)===<br />
Setting up Platform SDK looks the same as previous step, you just have to add appropriate entries that point to Platform SDK's "include" and "lib" subdirectories respectively.<br />
<br />
Being in "Directories" tab just add following entries:<br />
<br />
"Compiler" tab:<br />
C:\PlatformSDK\Include<br />
<br />
"Linker" tab:<br />
C:\PlatformSDK\Lib<br />
<br />
"Resource compiler" tab:<br />
C:\PlatformSDK\Include<br />
<br />
Do not forget to specify extra path for resource compiler executable (it's in Platform SDK's "bin" subdirectory, ie: "C:\PlatformSDK\Bin" ) - you can do this in "Programs" tab (see [http://img289.imageshack.us/img289/772/settingexepaths7yx.png screen])<br />
<br />
<br />
That's all - you can compile your applications using free Microsoft Visual C++ Toolkit 2003 with Code::Blocks as your IDE.<br />
<br />
Enjoy!<br />
<br />
===Compiling Hints===<br />
<br />
-H1: If the project cannot find "lib.exe" or "cvtres.exe" then use the ones in C:\Program Files\Microsoft Platform SDK\Bin\win64. They correctly make lib files for 32-bit windows. So add to the END of Programs->Additional paths under "Compiler Settings":<br />
C:\Program Files\Microsoft Platform SDK\Bin\win64<br />
<br />
-H2: If the project you are compiling complains that it cannot find "msvcrt.lib" then download the .NET 1.1 SDK and add to the END of the Directories->Linker tab:<br />
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib<br />
<br />
Both the VC++ Toolkit 2003 and the platform SDK omit this library.<br />
<br />
-H3: Note that the VC++ Toolkit itself does not come with debugging versions of the .lib library files. For these you should also download the .NET 1.1 SDK and add the linker path as in H2 above.<br />
<br />
The MS naming convention for some their libraries seems to be e.g.<br />
release version = libc.lib<br />
debug version = libcd.lib<br />
multithreaded release version = libmt.lib<br />
etc. (not sure about the 'i' or 'p' variants) <br><br />
The above link statically.<br />
dynamic multithreaded release version (uses a dll) = msvcrt.lib<br />
<br />
===Problems and Solutions===<br />
<br />
'''Resources adding via a '.rc' file to a Windows program are not linked into the program.'''<br />
: Go to "Settings->Compiler->[select MSVCToolkit]->Other->Advanced options" and make sure that the command line macro for "Link object files to executable" is like this: "$linker /nologo /subsystem:windows $libdirs /out:$exe_output $libs $link_objects $link_resobjects $link_options"</div>Squizzzhttps://wiki.codeblocks.org/index.php?title=FAQ&diff=2593FAQ2006-04-03T00:41:07Z<p>Squizzz: useless, legacy question removed.</p>
<hr />
<div>= General =<br />
<br />
== Is it possible to integrate the win32-help as in dev-cpp, to get help on the items under the caret? ==<br />
<br />
Integration of the win32 API helpfile should be a no-brainer. Someone could just write a really simple plugin and, upon invocation (through a shortcut possibly), look at the word under the cursor and invoke windows help... If you think you 're up to the task, I can help you with all the info you need. If not, I could write it myself but no promises on a release date ;)<br />
<br />
== Launching for the first time, Code::Blocks tells me I need to install GNU make. Is this necessary on a Windows system? ==<br />
<br />
Since version 1.0-beta5, no it is not. Code::Blocks works with GNU "make" [http://www.mingw.org/download.shtml (here)] or without it (default). To choose the build method, go to "Project/Build options", switch to the "Other" tab and select the build method you prefer.<br />
<br />
== What licence is Code::Blocks released under? ==<br />
<br />
GNU General Public License 2 ([http://www.gnu.org/licenses/gpl.txt GPL])<br />
<br />
= Compiling =<br />
<br />
== What compiler can I use with Code::Blocks? ==<br />
<br />
Code::Blocks philosophy is to be able to use any compiler on earth! Well, almost.<br />
<br />
As a matter of fact it largely depends on the used compiler plugin. The one provided with the default Code::Blocks installation, supports GNU GCC (MinGW/Cygwin), MS Visual C++ Free Toolkit 2003, Borland's C++ Compiler 5.5, DigitalMars Free Compiler., OpenWatcom and Small Device C Compiler (SDCC).<br />
<br />
== I imported a MSVCToolkit project/workspace, but Code::Blocks insists on trying to use GCC. What's wrong? ==<br />
<br />
A little documentation problem ^^;. The "default compiler" is usually GCC, so when you imported it with "the default compiler", you told it to use GCC. To fix this situation, go to "Project", "Build Options" and select VC++ Toolkit as your compiler.<br />
<br />
Another possibility is to put the M$ compiler as the default one. To do this, choose '''''Settings - Compiler''''', choose the M$ compiler in the '''''Selected Compiler''''' section (top of dialog box) and press the '''''Set as default''''' button.<br />
<br />
From now onwards, for all new projects the M$ compiler will be taken by default.<br />
<br />
== I 'm using gcc compiler from an existing dev-cpp installation. How can I make it work? ==<br />
<br />
''As of version 1.0-beta6, if a default MinGW installation is not detected, a Dev-C++ installation is checked for and is used if detected.''<br />
<br />
You need to take two steps. First, set the compiler master path to the dev-cpp folder. It's under "Settings/Configure plugins/Compiler" in the "Programs" tab...<br />
Second, you have to add two additional compiler (include) dirs. Go to "Settings/Configure plugins/Compiler" and in the "Compiler dirs" tab add "dev-cpp\include\c++" and "dev-cpp\include\c++\mingw32" (substituting "dev-cpp" with the actual dev-cpp installation folder).<br />
<br />
== My project should be compiled with a custom makefile. Is it possible with Code::Blocks? ==<br />
<br />
Yes, you can. You need to change two different settings:<br />
<br />
a) In "Compiler Settings", under the tab "Other", there's a setting called "Build Method". Choose "Work with makefiles".<br />
<br />
b) In your project's Properties, you can choose to use a makefile. Check "This is a custom makefile" (WARNING! if you forget to check, the makefile will be OVERWRITTEN!)<br />
<br />
And that's it! :)<br />
<br />
== I have downloaded MS VC++ Toolkit 2003 for a compiler. How do I tell Code::Blocks that it is my compiler? ==<br />
<br />
Click on "Project/Build options" and select the compiler you want for your project/target.<br />
<br />
== When compiling a wxWidgets project, I get several "variable 'vtable for xxxx' can't be auto-imported". What's wrong? ==<br />
<br />
You need to add WXUSINGDLL in "Project->Build options->Compiler #defines" and rebuild your project (or create a new project and use the "Using wxWidgets DLL" project option which adds "-DWXUSINGDLL" to Project->Build options->Other options).<br />
Other errors with the same resolution are:<br />
'unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString@@3PBDB)' or similar.<br />
If you were using 1.0-finalbeta and were trying to build a statically linked wxWidgets project, the cause of the problem was some faulty templates. But that's fixed now.<br />
<br />
== I can't compile a multithreaded app with VC Toolkit! Where are the libraries? ==<br />
<br />
sorry, no fix for your problem...<br />
<br />
Your problem doesn't come from CodeBlocks. It exists, because the free VC toolkit (VCTK) doesn't provide all the libraries and tools which are coming with Visual C++ (VC) which isn't free, unfortunately.<br />
<br />
Try buying a full-fledged VC++, or even better, download MinGW :)<br />
<br />
The libraries that can be obtained free of charge are:<br />
<br />
Paths:<br />
(VCT3) Visual C++ Toolkit 2003 - C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib<br />
(PSDK) Platform SDK - C:\Program Files\Microsoft Platform SDK\Lib<br />
(NSDK) .NET 1.1 SDK - C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib<br />
<br />
C runtime libs:<br />
LIBC.LIB Single-threaded, static link (VCT3, NSDK)<br />
LIBCMT.LIB Multithreaded, static link (VCT3, NSDK)<br />
MSVCRT.LIB Multithreaded, dynamic link (import library for MSVCR71.DLL) (NSDK)<br />
LIBCD.LIB Single-threaded, static link (debug) (VCT3, NSDK)<br />
LIBCMTD.LIB Multithreaded, static link (debug) (NSDK)<br />
MSVCRTD.LIB Multithreaded, dynamic link (import library for MSVCR71D.DLL) (debug) (NSDK)<br />
<br />
C++ libs:<br />
LIBCP.LIB Single-threaded, static link (VCT3, PSDK)<br />
LIBCPMT.LIB Multithreaded, static link (VCT3)<br />
MSVCPRT.LIB Multithreaded, dynamic link (import library for MSVCP71.dll) (none)<br />
LIBCPD.LIB Single-threaded, static link (debug) (VCT3)<br />
LIBCPMTD.LIB Multithreaded, static link (debug) (none)<br />
MSVCPRTD.LIB Multithreaded, dynamic link (import library for MSVCP71D.DLL) (debug) (none)<br />
<br />
Try setting the library linker directories to:<br />
C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib<br />
C:\Program Files\Microsoft Platform SDK\Lib<br />
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib<br />
in that order.<br />
<br />
The ones listed as (none) above are actually present in the IA64 and AMD64 subdirectories of the PSDK lib directory. Not sure if these would work on 32-bit windows, however, they may if they are<br />
meant to work in 32-bit compatibility mode on the 64-bit processors. Worth a try. Otherwise, you<br />
can link statically to the C++ library instead of using MSVCP71.dll. If you really want to link against MSVCP71.dll you can try to create MSVCP71.LIB from the dll using lib.exe and sed. Search google for "exports.sed" for detailed steps.<br />
<br />
See also: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_c_run.2d.time_libraries.asp<br />
<br />
See also: http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit<br />
<br />
== Where are the libraries for the OpenGL / SDL / etc. projects? ==<br />
<br />
They're not bundled. The templates were provided for your convenience, but you need to download the libraries on your own.<br />
In common terms, "batteries not included" :)<br />
<br />
== Is it possible to use Visual C++ 6.0 with Code::Blocks? ==<br />
<br />
As they say in ##C++ on FreeNode:<br><br />
cylon> msvc++6 is not a C++ compiler. It was made before the C++ standard, so it compiles some language that isn't C++. Upgrade.<br />
<br />
== I got this error when compiling: Symbol "isascii" was not found in "codeblocks.dll" ==<br />
Make sure you didn't mix up the MSVC headers or libs with the MinGW ones.</div>Squizzzhttps://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE&diff=238Integrating Microsoft Visual Toolkit 2003 with Code::Blocks IDE2005-09-08T22:09:42Z<p>Squizzz: </p>
<hr />
<div>==Microsoft Visual C++ Toolkit 2003 - Overview==<br />
'''Microsoft Visual C++ Toolkit 2003''' (or VCToolkit, MVCT) is freely available and free for commercial use minimalistic compiler suite released by Microsoft. It consists of high quality C/C++ optimizing compiler (VC 7.1, which is much better than old VC++ 6.0) and linker, but obviously comes without IDE, thus making management of medium and larger projects nearly impossible. Luckily, it's where Code::Blocks IDE with its multi-compiler integration feature comes in handy! This tutorial will cover process of integrating these two incredible pieces of software - VCToolkit and Code::Blocks IDE.<br />
<br />
'''Note:''' if you like watching rather than reading, and don't mind downloading 40MB, you can get videos made by guys from [http://www.gametutorials.com Gametutorials.com]. They have provided us with some easy step-by-step [http://www.gametutorials.com/codeblocks_tutorials.zip Code::Blocks tutorials], that will help you successfully set up your first steps with VC Toolkit compiler.. :)<br />
<br />
==What does VC Toolkit include, and what does it not?==<br />
<br />
According to '''readme.txt''' shipped with package, Microsoft Visual C++ Toolkit 2003 '''does include''':<br />
<br />
* Visual C/C++ compiler and linker, same as these shipped with Visual Studio .NET 2003 Professional! <br />
<br />
* C Runtime Library and the C++ Standard Library, including the Standard Template Library. These are the same static-link libraries included with Visual Studio.<br />
<br />
* Microsoft .NET Framework Common Language Runtime. Visual C++ can optionally build applications that run on the Common Language Runtime (CLR). <br />
<br />
* Code samples. The toolkit includes four samples designed to showcase the powerful new features of the 2003 version, including new optimization capabilities, features to improve code-security and robustness, enhanced ISO C++ standards support, and the ability to use the .NET Framework library and target the CLR. <br />
<br />
According the same source, MSVT '''does NOT include''':<br />
<br />
* Various development tools shipped only with commercial Visual Studio IDE - like debugger, profiler, etc.<br />
<br />
* Microsoft Foundation Class (MFC) and Active Template Libraries (ATL). <br />
<br />
* Advanced developer tools, including compilers and tools for developing using other languages like Visual Basic and C#.<br />
<br />
==Packages needed==<br />
In order to set up '''Code::Blocks IDE''' with '''Microsoft Visual C++ Toolkit 2003''' you need following packages:<br />
<br />
* '''Code::Blocks IDE''' itself.<br />
: You can grab the latest version of '''Code::Blocks IDE''' in download section of [http://codeblocks.org/downloads.shtml Code::Blocks homepage] or at [http://sourceforge.net/project/showfiles.php?group_id=126998 project's site] at [http://sourceforge.net Source Forge]. (~3 MB)<br />
<br />
* '''Microsoft Visual C++ Toolkit 2003''' compiler suite<br />
: This package contains fully functional Visual C++ 7.1 compiler suite, which is '''free for commercial use'''. It contains minimalistic set of tools and C/C++ header and library files required for basic application development. You can download latest release of MVCT from [http://www.microsoft.com/downloads/details.aspx?FamilyId=272BE09D-40BB-49FD-9CB0-4BFA122FA91B&displaylang=en Microsoft's website]. (~31.4 MB)<br />
<br />
===Optional RECOMMENDED packages===<br />
Rather sooner than later you will encounter problems with missing libraries, that are not included in MVCT bundle. To save yourself most of the trouble you should install freely available SDK packages available at M$ site. They will greatly enchance possibilities offered by VC7.1 :)<br />
<br />
Packages that you should definitely take a look are:<br />
<br />
* '''Platform SDK'''<br />
: This package provides a whole bunch of useful stuff not only for Visual C++ compiler users, but generally, any Windows developer - it includes extensive headers and libraries, as well as tools (like resource compiler, '''not included''' in basic VCToolkit package), documentation and samples.<br />
<br />
: There are three ways to obtain '''Platform SDK''':<br />
<blockquote><br />
* [http://www.microsoft.com/downloads/details.aspx?FamilyID=a55b6b43-e24f-4ea3-a93e-40c0ec4f68e5&DisplayLang=en Platform SDK Web Install]<br />
: '''Platform SDK''' in its most compact shape - download tiny (~1.2 MB), compact installer, which will guide you through rest of the installation process (online). You will also decide yourself which components you want to install.<br />
<br />
* [http://www.microsoft.com/downloads/details.aspx?FamilyID=eba0128f-a770-45f1-86f3-7ab010b398a3&DisplayLang=en Platform SDK Full Download] (beware, it's HUGE!)<br />
: Complete '''Platform SDK''', with all things you will ever need or not. Huge, self-extracting *.cab installer.<br />
<br />
* [http://www.microsoft.com/downloads/details.aspx?familyid=D8EECD75-1FC4-49E5-BC66-9DA2B03D9B92&displaylang=en Platform SDK ISO Install] (beware, it's HUGE!)<br />
: Same as above, but you get it as *.img (CD image) file.<br />
</blockquote><br />
: Choose the most convinient way for yourself.<br />
<br />
* '''.NET Framework SDK Version 1.1'''<br />
: This package provides a lot of stuff useful for .NET development, but also, few crucial libraries that are missing (in their debug & multithreaded version)in regular Platform SDK - for more details check [https://wiki.codeblocks.org/index.php/FAQ#I_can.27t_compile_a_multithreaded_app_with_VC_Toolkit.21_Where_are_the_libraries.3F this Code::Blocks FAQ entry]. You can download .NET Framework SDK [http://www.microsoft.com/downloads/details.aspx?FamilyId=9B3A2CA6-3647-4070-9F41-A333C6B9181D&displaylang=en here].<br />
<br />
* '''DirectX SDK'''<br />
: If you are interested in Graphics programming, you might try to integrate DirectX SDK with your MVCT as well (feel free to update C::B Wiki about your succesful attempts, DirectX setup & "hello DX world" compilation are welcome! :P). You can get DirectX SDK [http://www.microsoft.com/downloads/details.aspx?FamilyId=3904B19A-02B9-447B-AB58-C12E2456E9BA&displaylang=en here].<br />
<br />
==Okay, so let's proceed with installation:==<br />
<br />
Basically, it doesn't really matter what you install first. The most convinient way, however, is to have compiler suite installed before running '''Code::Blocks IDE''' for the first time. In such case, C::B will likely autodetect available compilers during its startup, and set up everything correctly. If you have some of the components already installed, just skip that part.<br />
<br />
===Installing Microsoft Visual C++ Toolkit 2003===<br />
Simply run '''VCToolkitSetup.exe''' and installation process will start. Select a path you want to install MVCT to. This tutorial assumes you installed it to:<br />
C:\VCToolkit2003\<br />
When installation is done, navigate to the MSVT directory ("C:\VCToolkit2003\") and run vcvars32.bat. It will set up enviromental variables.<br />
<br />
'''Note:''' <small>Install MSVT to any subfolder, installing it to bare "C:\" or "D:\" (or any drive letter) will likely cause compiler/linker produce very strange compilation errors and well, its general malfunction :)</small><br />
<br />
'''Note 2:''' <small>Installing VCToolkit requires .NET Framework. Most likely you already have it. If not, setup will trigger .NET Framework installation and proceed it smoothly on older Windows NT systems (NT & 2000), newer ones (XP and above) already have it. This one will, however, fail if you have Windows 9x/Me. In order to install VCToolkit on these machines you need to install .NET Framework manually, preventing setup from triggering malfunctioning procedure. [TODO: it would be great if someone who actually tried it describe it somewhere here]</small><br />
<br />
===Installing Platform SDK===<br />
In this tutorial we will follow '''Platform SDK Web Install'''. Download (links above) and run '''PSDK-x86.exe''', '''PSDK-amd64.exe''' or '''PSDK-ia64.exe''' (according your PCs architecture). Select a path you want to install Platform SDK to. We will use <br />
C:\PlatformSDK\<br />
If you select '''custom installation''', you will have to select which components you want to install. I didn't dare to run '''typical installation''', because it presumably downloads & installs everything (= hundreds of megabytes). Selecting components may be a little tricky, most of them are related to various Microsoft technologies, and if you are using any of them in your applications, you should install these features here, otherwise your programs will likely fail to compile and/or link correctly. You can update your Platform SDK installation at any time.<br />
<br />
When installation is finished, navigate to the Platform SDK directory ("C:\PlatformSDK\") and run '''SetEnv.Cmd'''.<br />
<br />
===Installing Code::Blocks IDE===<br />
Simply run setup file, and select a path where you want it to be installed. <br />
<br />
'''Note:''' some of the plugins are '''MinGW''' specific (GDB plugin, DevPak plugin). If you are not sure whether you might need them some day (you may switch to '''MinGW''' or simply decide to use more than one compiler), better install them (they are just few kilobytes anyway) and eventually keep them disabled.<br />
<br />
Now you can run the '''Code::Blocks IDE''' for the first time, and set up the compiler.<br />
<br />
==Setting up the compiler==<br />
===First run compiler auto-detection===<br />
If you have already installed MVCT on your machine, Code::Blocks will autodetect it now ([http://img289.imageshack.us/img289/4028/compilerautodetecton8rb.png screen]), as well as all other supported compilers that are present. If more than one compiler is detected, you can set one of them as default one.<br />
<br />
After this step, you should have Visual C++ compiler almost fully integrated with Code::Blocks.<br />
You only need to inform compiler about your Platform SDK installation and goodies (like resource compiler) it should find there. Now, either go to "Settings->Compiler" (in your C::B IDE) and then jump quickly to [[#Setting Platform SDK]], or read further to know more details and verify your auto-detection results.<br />
<br />
===Setting compiler from scratch (missed or failed first run auto-detection)===<br />
In case you missed first run auto-detection (MVCT was not present at the time) or somehow it failed, you have to set up your compiler manually. Whole procedure is actually common for any supported compiler, and applies to Microsoft Visual C++ Toolkit 2003 perfectly:<br />
<br />
'''''Golden Tip :''' "In order to integrate any supported compiler with Code::Blocks, all you need to do is to correctly specify location of compiler's executables, as well as compiler's (include) and linker's (lib) directories".''<br />
====Specifying location of compiler's executables====<br />
Go to "Settings->Compiler" and make sure that "Microsoft Visual C++ Toolkit 2003" is selected.<br />
<br />
Open "Programs" tab - verify whether '''''Compiler's installation directory''''' (the same you installed VCToolkit to, ie: "C:\VCToolkit2003\" ) is set properly - if not - press "Autodetect". If correct path doesn't appear, simply paste the correct one there or navigate to it using dialog available under "..." button.<br />
<br />
Note that all specified executables (compiler, linker, resource compiler) must exist either in the "bin" subdirectory of '''''Compiler's installation path''''' (ie: "C:\VCToolkit2003\bin\") or in any other path specified here as "Extra path". (see [http://img289.imageshack.us/img289/772/settingexepaths7yx.png screen])<br />
<br />
====Specifying location of compiler's and linker's directories====<br />
Open "Directories" tab and verify if following entries are present:<br />
<br />
"Compiler" tab - entries should point to "include" directories:<br />
C:\VCToolkit2003\include<br />
<br />
"Linker" tab - entries should point to "lib" directories:<br />
C:\VCToolkit2003\lib<br />
<br />
If not, do not hestitate to add these ones.<br />
<br />
'''Note:''' If you ever be using any library that is not included in MVCT (like FMOD, Allegro, or any of thousands open source libraries out there), you need either to add appropriate "include" and "libs" paths here too, or copy headers and libs to already specified paths.<br />
<br />
===Setting Platform SDK (these steps applies to .NET SDK and DirectX SDK as well)===<br />
Setting up Platform SDK looks the same as previous step, you just have to add appropriate entries that point to Platform SDK's "include" and "lib" subdirectories respectively.<br />
<br />
Being in "Directories" tab just add following entries:<br />
<br />
"Compiler" tab:<br />
C:\PlatformSDK\Include<br />
<br />
"Linker" tab:<br />
C:\PlatformSDK\Lib<br />
<br />
"Resource compiler" tab:<br />
C:\PlatformSDK\Include<br />
<br />
Do not forget to specify extra path for resource compiler executable (it's in Platform SDK's "bin" subdirectory, ie: "C:\PlatformSDK\Bin" ) - you can do this in "Programs" tab (see [http://img289.imageshack.us/img289/772/settingexepaths7yx.png screen])<br />
<br />
<br />
That's all - you can compile your applications using free Microsoft Visual C++ Toolkit 2003 with Code::Blocks as your IDE.<br />
<br />
Enjoy!<br />
<br />
===Compiling Hints===<br />
<br />
-H1: If the project cannot find "lib.exe" or "cvtres.exe" then use the ones in C:\Program Files\Microsoft Platform SDK\Bin\win64. They correctly make lib files for 32-bit windows. So add to the END of Programs->Additional paths under "Compiler Settings":<br />
C:\Program Files\Microsoft Platform SDK\Bin\win64<br />
<br />
-H2: If the project you are compiling complains that it cannot find "msvcrt.lib" then download the .NET 1.1 SDK and add to the END of the Directories->Linker tab:<br />
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib<br />
<br />
Both the VC++ Toolkit 2003 and the platform SDK omit this library.<br />
<br />
-H3: Note that the VC++ Toolkit itself does not come with debugging versions of the .lib library files. For these you should also download the .NET 1.1 SDK and add the linker path as in H2 above.<br />
<br />
The MS naming convention for some their libraries seems to be e.g.<br />
release version = libc.lib<br />
debug version = libcd.lib<br />
multithreaded release version = libmt.lib<br />
etc. (not sure about the 'i' or 'p' variants) <br><br />
The above link statically.<br />
dynamic multithreaded release version (uses a dll) = msvcrt.lib</div>Squizzzhttps://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE&diff=126Integrating Microsoft Visual Toolkit 2003 with Code::Blocks IDE2005-08-07T22:16:35Z<p>Squizzz: /* Microsoft Visual C++ Toolkit 2003 - Overview */</p>
<hr />
<div><br />
==Microsoft Visual C++ Toolkit 2003 - Overview==<br />
'''Microsoft Visual C++ Toolkit 2003''' (or VCToolkit, MVCT) is freely available and free for commercial use minimalistic compiler suite released by Microsoft. It consists of high quality C/C++ optimizing compiler (VC 7.1, which is much better than old VC++ 6.0) and linker, but obviously comes without IDE, thus making management of medium and larger projects nearly impossible. Luckily, it's where Code::Blocks IDE with its multi-compiler integration feature comes in handy! This tutorial will cover process of integrating these two incredible pieces of software - VCToolkit and Code::Blocks IDE.<br />
<br />
==What does VC Toolkit include, and what does it not?==<br />
<br />
According to '''readme.txt''' shipped with package, Microsoft Visual C++ Toolkit 2003 '''does include''':<br />
<br />
* Visual C/C++ compiler and linker, same as these shipped with Visual Studio .NET 2003 Professional! <br />
<br />
* C Runtime Library and the C++ Standard Library, including the Standard Template Library. These are the same static-link libraries included with Visual Studio.<br />
<br />
* Microsoft .NET Framework Common Language Runtime. Visual C++ can optionally build applications that run on the Common Language Runtime (CLR). <br />
<br />
* Code samples. The toolkit includes four samples designed to showcase the powerful new features of the 2003 version, including new optimization capabilities, features to improve code-security and robustness, enhanced ISO C++ standards support, and the ability to use the .NET Framework library and target the CLR. <br />
<br />
According the same source, MSVT '''does NOT include''':<br />
<br />
* Various development tools shipped only with commercial Visual Studio IDE - like debugger, profiler, etc.<br />
<br />
* Microsoft Foundation Class (MFC) and Active Template Libraries (ATL). <br />
<br />
* Advanced developer tools, including compilers and tools for developing using other languages like Visual Basic and C#.<br />
<br />
<br />
==Packages needed==<br />
In order to set up '''Code::Blocks IDE''' with '''Microsoft Visual C++ Toolkit 2003''' you need following packages:<br />
<br />
* '''Code::Blocks IDE''' itself.<br />
: You can grab the latest version of '''Code::Blocks IDE''' in download section of [http://codeblocks.org/downloads.shtml Code::Blocks homepage] or at [http://sourceforge.net/project/showfiles.php?group_id=126998 project's site] at [http://sourceforge.net Source Forge]. (~3 MB)<br />
<br />
* '''Microsoft Visual C++ Toolkit 2003''' compiler suite<br />
: This package contains fully functional Visual C++ 7.1 compiler suite, which is '''free for commercial use'''. It contains minimalistic set of tools and C/C++ header and library files required for basic application development. You can download latest release of MVCT from [http://www.microsoft.com/downloads/details.aspx?FamilyId=272BE09D-40BB-49FD-9CB0-4BFA122FA91B&displaylang=en Microsoft's website]. (~31.4 MB)<br />
<br />
* '''Platform SDK'''<br />
: This package provides a whole bunch of useful stuff not only for Visual C++ compiler users, but generally, any Windows developer - it includes extensive headers and libraries, as well as tools (like resource compiler, '''not included''' in basic VCToolkit package), documentation and samples.<br />
<br />
: There are three ways to obtain '''Platform SDK''':<br />
<blockquote><br />
* [http://www.microsoft.com/downloads/details.aspx?FamilyID=a55b6b43-e24f-4ea3-a93e-40c0ec4f68e5&DisplayLang=en Platform SDK Web Install]<br />
: '''Platform SDK''' in its most compact shape - download tiny (~1.2 MB), compact installer, which will guide you through rest of the installation process (online). You will also decide yourself which components you want to install.<br />
<br />
* [http://www.microsoft.com/downloads/details.aspx?FamilyID=eba0128f-a770-45f1-86f3-7ab010b398a3&DisplayLang=en Platform SDK Full Download] (beware, it's HUGE!)<br />
: Complete '''Platform SDK''', with all things you will ever need or not. Huge, self-extracting *.cab installer.<br />
<br />
* [http://www.microsoft.com/downloads/details.aspx?familyid=D8EECD75-1FC4-49E5-BC66-9DA2B03D9B92&displaylang=en Platform SDK ISO Install] (beware, it's HUGE!)<br />
: Same as above, but you get it as *.img (CD image) file.<br />
</blockquote><br />
: Choose the most convinient way for yourself.<br />
<br />
==Okay, so let's proceed with installation:==<br />
<br />
Basically, it doesn't really matter what you install first. The most convinient way, however, is to have compiler suite installed before running '''Code::Blocks IDE''' for the first time. In such case, C::B will likely autodetect available compilers during its startup, and set up everything correctly. If you have some of the components already installed, just skip that part.<br />
<br />
===Installing Microsoft Visual C++ Toolkit 2003===<br />
Simply run '''VCToolkitSetup.exe''' and installation process will start. Select a path you want to install MVCT to. This tutorial assumes you installed it to:<br />
C:\VCToolkit2003\<br />
When installation is done, navigate to the MSVT directory ("C:\VCToolkit2003\") and run vcvars32.bat. It will set up enviromental variables.<br />
<br />
<br />
'''Note:''' <small>Installing VCToolkit requires .NET Framework. Most likely you already have it. If not, setup will trigger .NET Framework installation and proceed it smoothly on older Windows NT systems (NT & 2000), newer ones (XP and above) already have it. This one will, however, fail if you have Windows 9x/Me. In order to install VCToolkit on these machines you need to install .NET Framework manually, preventing setup from triggering malfunctioning procedure. [TODO: it would be great if someone who actually tried it describe it somewhere here]</small><br />
<br />
===Installing Platform SDK===<br />
In this tutorial we will follow '''Platform SDK Web Install'''. Download (links above) and run '''PSDK-x86.exe''', '''PSDK-amd64.exe''' or '''PSDK-ia64.exe''' (according your PCs architecture). Select a path you want to install Platform SDK to. We will use <br />
C:\PlatformSDK\<br />
If you select '''custom installation''', you will have to select which components you want to install. I didn't dare to run '''typical installation''', because it presumably downloads & installs everything (= hundreds of megabytes). Selecting components may be a little tricky, most of them are related to various Microsoft technologies, and if you are using any of them in your applications, you should install these features here, otherwise your programs will likely fail to compile and/or link correctly. You can update your Platform SDK installation at any time.<br />
<br />
When installation is finished, navigate to the Platform SDK directory ("C:\PlatformSDK\") and run '''SetEnv.Cmd'''.<br />
<br />
===Installing Code::Blocks IDE===<br />
Simply run setup file, and select a path where you want it to be installed. <br />
<br />
'''Note:''' some of the plugins are '''MinGW''' specific (GDB plugin, DevPak plugin). If you are not sure whether you might need them some day (you may switch to '''MinGW''' or simply decide to use more than one compiler), better install them (they are just few kilobytes anyway) and eventually keep them disabled.<br />
<br />
Now you can run the '''Code::Blocks IDE''' for the first time, and set up the compiler.<br />
<br />
==Setting up the compiler==<br />
===First run compiler auto-detection===<br />
If you have already installed MVCT on your machine, Code::Blocks will autodetect it now ([http://img289.imageshack.us/img289/4028/compilerautodetecton8rb.png screen]), as well as all other supported compilers that are present. If more than one compiler is detected, you can set one of them as default one.<br />
<br />
After this step, you should have Visual C++ compiler almost fully integrated with Code::Blocks.<br />
You only need to inform compiler about your Platform SDK installation and goodies (like resource compiler) it should find there. Now, either go to "Settings->Compiler" (in your C::B IDE) and then jump quickly to [[#Setting Platform SDK]], or read further to know more details and verify your auto-detection results.<br />
<br />
===Setting compiler from scratch (missed or failed first run auto-detection)===<br />
In case you missed first run auto-detection (MVCT was not present at the time) or somehow it failed, you have to set up your compiler manually. Whole procedure is actually common for any supported compiler, and applies to Microsoft Visual C++ Toolkit 2003 perfectly:<br />
<br />
'''''Golden Tip :''' "In order to integrate any supported compiler with Code::Blocks, all you need to do is to correctly specify location of compiler's executables, as well as compiler's (include) and linker's (lib) directories".''<br />
====Specifying location of compiler's executables====<br />
Go to "Settings->Compiler" and make sure that "Microsoft Visual C++ Toolkit 2003" is selected.<br />
<br />
Open "Programs" tab - verify whether '''''Compiler's installation directory''''' (the same you installed VCToolkit to, ie: "C:\VCToolkit2003\" ) is set properly - if not - press "Autodetect". If correct path doesn't appear, simply paste the correct one there or navigate to it using dialog available under "..." button.<br />
<br />
Note that all specified executables (compiler, linker, resource compiler) must exist either in the "bin" subdirectory of '''''Compiler's installation path''''' (ie: "C:\VCToolkit2003\bin\") or in any other path specified here as "Extra path". (see [http://img289.imageshack.us/img289/772/settingexepaths7yx.png screen])<br />
<br />
====Specifying location of compiler's and linker's directories====<br />
Open "Directories" tab and verify if following entries are present:<br />
<br />
"Compiler" tab - entries should point to "include" directories:<br />
C:\VCToolkit2003\include<br />
<br />
"Linker" tab - entries should point to "lib" directories:<br />
C:\VCToolkit2003\lib<br />
<br />
If not, do not hestitate to add these ones.<br />
<br />
'''Note:''' If you ever be using any library that is not included in MVCT (like FMOD, Allegro, or any of thousands open source libraries out there), you need either to add appropriate "include" and "libs" paths here too, or copy headers and libs to already specified paths.<br />
<br />
===Setting Platform SDK===<br />
Setting up Platform SDK looks the same as previous step, you just have to add appropriate entries that point to Platform SDK's "include" and "lib" subdirectories respectively.<br />
<br />
Being in "Directories" tab just add following entries:<br />
<br />
"Compiler" tab:<br />
C:\PlatformSDK\Include<br />
<br />
"Linker" tab:<br />
C:\PlatformSDK\Lib<br />
<br />
"Resource compiler" tab:<br />
C:\PlatformSDK\Include<br />
<br />
Do not forget to specify extra path for resource compiler executable (it's in Platform SDK's "bin" subdirectory, ie: "C:\PlatformSDK\Bin" ) - you can do this in "Programs" tab (see [http://img289.imageshack.us/img289/772/settingexepaths7yx.png screen])<br />
<br />
<br />
That's all - you can compile your applications using free Microsoft Visual C++ Toolkit 2003 with Code::Blocks as your IDE.<br />
<br />
Enjoy!</div>Squizzzhttps://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE&diff=119Integrating Microsoft Visual Toolkit 2003 with Code::Blocks IDE2005-08-07T21:59:42Z<p>Squizzz: article has been added. chmod 777 this_article :)</p>
<hr />
<div><br />
==Microsoft Visual C++ Toolkit 2003 - Overview==<br />
'''Microsoft Visual C++ Toolkit 2003''' (or VCToolkit, MVCT) is freely available and free for commercial use minimalistic compiler suite released by Microsoft. It consists of high quality C/C++ optimizing compiler (VC 7.1, which is much better than old VC++ 6.0) and linker, but obviously comes without IDE, thus making management of medium and larger projects nearly impossible. Luckily, it's where Come::Blocks IDE with its multi-compiler integration feature comes in handy! This tutorial will cover process of integrating these two incredible pieces of software - VCToolkit and Code::Blocks IDE.<br />
<br />
==What does VC Toolkit include, and what does it not?==<br />
<br />
According to '''readme.txt''' shipped with package, Microsoft Visual C++ Toolkit 2003 '''does include''':<br />
<br />
* Visual C/C++ compiler and linker, same as these shipped with Visual Studio .NET 2003 Professional! <br />
<br />
* C Runtime Library and the C++ Standard Library, including the Standard Template Library. These are the same static-link libraries included with Visual Studio.<br />
<br />
* Microsoft .NET Framework Common Language Runtime. Visual C++ can optionally build applications that run on the Common Language Runtime (CLR). <br />
<br />
* Code samples. The toolkit includes four samples designed to showcase the powerful new features of the 2003 version, including new optimization capabilities, features to improve code-security and robustness, enhanced ISO C++ standards support, and the ability to use the .NET Framework library and target the CLR. <br />
<br />
According the same source, MSVT '''does NOT include''':<br />
<br />
* Various development tools shipped only with commercial Visual Studio IDE - like debugger, profiler, etc.<br />
<br />
* Microsoft Foundation Class (MFC) and Active Template Libraries (ATL). <br />
<br />
* Advanced developer tools, including compilers and tools for developing using other languages like Visual Basic and C#.<br />
<br />
<br />
==Packages needed==<br />
In order to set up '''Code::Blocks IDE''' with '''Microsoft Visual C++ Toolkit 2003''' you need following packages:<br />
<br />
* '''Code::Blocks IDE''' itself.<br />
: You can grab the latest version of '''Code::Blocks IDE''' in download section of [http://codeblocks.org/downloads.shtml Code::Blocks homepage] or at [http://sourceforge.net/project/showfiles.php?group_id=126998 project's site] at [http://sourceforge.net Source Forge]. (~3 MB)<br />
<br />
* '''Microsoft Visual C++ Toolkit 2003''' compiler suite<br />
: This package contains fully functional Visual C++ 7.1 compiler suite, which is '''free for commercial use'''. It contains minimalistic set of tools and C/C++ header and library files required for basic application development. You can download latest release of MVCT from [http://www.microsoft.com/downloads/details.aspx?FamilyId=272BE09D-40BB-49FD-9CB0-4BFA122FA91B&displaylang=en Microsoft's website]. (~31.4 MB)<br />
<br />
* '''Platform SDK'''<br />
: This package provides a whole bunch of useful stuff not only for Visual C++ compiler users, but generally, any Windows developer - it includes extensive headers and libraries, as well as tools (like resource compiler, '''not included''' in basic VCToolkit package), documentation and samples.<br />
<br />
: There are three ways to obtain '''Platform SDK''':<br />
<blockquote><br />
* [http://www.microsoft.com/downloads/details.aspx?FamilyID=a55b6b43-e24f-4ea3-a93e-40c0ec4f68e5&DisplayLang=en Platform SDK Web Install]<br />
: '''Platform SDK''' in its most compact shape - download tiny (~1.2 MB), compact installer, which will guide you through rest of the installation process (online). You will also decide yourself which components you want to install.<br />
<br />
* [http://www.microsoft.com/downloads/details.aspx?FamilyID=eba0128f-a770-45f1-86f3-7ab010b398a3&DisplayLang=en Platform SDK Full Download] (beware, it's HUGE!)<br />
: Complete '''Platform SDK''', with all things you will ever need or not. Huge, self-extracting *.cab installer.<br />
<br />
* [http://www.microsoft.com/downloads/details.aspx?familyid=D8EECD75-1FC4-49E5-BC66-9DA2B03D9B92&displaylang=en Platform SDK ISO Install] (beware, it's HUGE!)<br />
: Same as above, but you get it as *.img (CD image) file.<br />
</blockquote><br />
: Choose the most convinient way for yourself.<br />
<br />
==Okay, so let's proceed with installation:==<br />
<br />
Basically, it doesn't really matter what you install first. The most convinient way, however, is to have compiler suite installed before running '''Code::Blocks IDE''' for the first time. In such case, C::B will likely autodetect available compilers during its startup, and set up everything correctly. If you have some of the components already installed, just skip that part.<br />
<br />
===Installing Microsoft Visual C++ Toolkit 2003===<br />
Simply run '''VCToolkitSetup.exe''' and installation process will start. Select a path you want to install MVCT to. This tutorial assumes you installed it to:<br />
C:\VCToolkit2003\<br />
When installation is done, navigate to the MSVT directory ("C:\VCToolkit2003\") and run vcvars32.bat. It will set up enviromental variables.<br />
<br />
<br />
'''Note:''' <small>Installing VCToolkit requires .NET Framework. Most likely you already have it. If not, setup will trigger .NET Framework installation and proceed it smoothly on older Windows NT systems (NT & 2000), newer ones (XP and above) already have it. This one will, however, fail if you have Windows 9x/Me. In order to install VCToolkit on these machines you need to install .NET Framework manually, preventing setup from triggering malfunctioning procedure. [TODO: it would be great if someone who actually tried it describe it somewhere here]</small><br />
<br />
===Installing Platform SDK===<br />
In this tutorial we will follow '''Platform SDK Web Install'''. Download (links above) and run '''PSDK-x86.exe''', '''PSDK-amd64.exe''' or '''PSDK-ia64.exe''' (according your PCs architecture). Select a path you want to install Platform SDK to. We will use <br />
C:\PlatformSDK\<br />
If you select '''custom installation''', you will have to select which components you want to install. I didn't dare to run '''typical installation''', because it presumably downloads & installs everything (= hundreds of megabytes). Selecting components may be a little tricky, most of them are related to various Microsoft technologies, and if you are using any of them in your applications, you should install these features here, otherwise your programs will likely fail to compile and/or link correctly. You can update your Platform SDK installation at any time.<br />
<br />
When installation is finished, navigate to the Platform SDK directory ("C:\PlatformSDK\") and run '''SetEnv.Cmd'''.<br />
<br />
===Installing Code::Blocks IDE===<br />
Simply run setup file, and select a path where you want it to be installed. <br />
<br />
'''Note:''' some of the plugins are '''MinGW''' specific (GDB plugin, DevPak plugin). If you are not sure whether you might need them some day (you may switch to '''MinGW''' or simply decide to use more than one compiler), better install them (they are just few kilobytes anyway) and eventually keep them disabled.<br />
<br />
Now you can run the '''Code::Blocks IDE''' for the first time, and set up the compiler.<br />
<br />
==Setting up the compiler==<br />
===First run compiler auto-detection===<br />
If you have already installed MVCT on your machine, Code::Blocks will autodetect it now ([http://img289.imageshack.us/img289/4028/compilerautodetecton8rb.png screen]), as well as all other supported compilers that are present. If more than one compiler is detected, you can set one of them as default one.<br />
<br />
After this step, you should have Visual C++ compiler almost fully integrated with Code::Blocks.<br />
You only need to inform compiler about your Platform SDK installation and goodies (like resource compiler) it should find there. Now, either go to "Settings->Compiler" (in your C::B IDE) and then jump quickly to [[#Setting Platform SDK]], or read further to know more details and verify your auto-detection results.<br />
<br />
===Setting compiler from scratch (missed or failed first run auto-detection)===<br />
In case you missed first run auto-detection (MVCT was not present at the time) or somehow it failed, you have to set up your compiler manually. Whole procedure is actually common for any supported compiler, and applies to Microsoft Visual C++ Toolkit 2003 perfectly:<br />
<br />
'''''Golden Tip :''' "In order to integrate any supported compiler with Code::Blocks, all you need to do is to correctly specify location of compiler's executables, as well as compiler's (include) and linker's (lib) directories".''<br />
====Specifying location of compiler's executables====<br />
Go to "Settings->Compiler" and make sure that "Microsoft Visual C++ Toolkit 2003" is selected.<br />
<br />
Open "Programs" tab - verify whether '''''Compiler's installation directory''''' (the same you installed VCToolkit to, ie: "C:\VCToolkit2003\" ) is set properly - if not - press "Autodetect". If correct path doesn't appear, simply paste the correct one there or navigate to it using dialog available under "..." button.<br />
<br />
Note that all specified executables (compiler, linker, resource compiler) must exist either in the "bin" subdirectory of '''''Compiler's installation path''''' (ie: "C:\VCToolkit2003\bin\") or in any other path specified here as "Extra path". (see [http://img289.imageshack.us/img289/772/settingexepaths7yx.png screen])<br />
<br />
====Specifying location of compiler's and linker's directories====<br />
Open "Directories" tab and verify if following entries are present:<br />
<br />
"Compiler" tab - entries should point to "include" directories:<br />
C:\VCToolkit2003\include<br />
<br />
"Linker" tab - entries should point to "lib" directories:<br />
C:\VCToolkit2003\lib<br />
<br />
If not, do not hestitate to add these ones.<br />
<br />
'''Note:''' If you ever be using any library that is not included in MVCT (like FMOD, Allegro, or any of thousands open source libraries out there), you need either to add appropriate "include" and "libs" paths here too, or copy headers and libs to already specified paths.<br />
<br />
===Setting Platform SDK===<br />
Setting up Platform SDK looks the same as previous step, you just have to add appropriate entries that point to Platform SDK's "include" and "lib" subdirectories respectively.<br />
<br />
Being in "Directories" tab just add following entries:<br />
<br />
"Compiler" tab:<br />
C:\PlatformSDK\Include<br />
<br />
"Linker" tab:<br />
C:\PlatformSDK\Lib<br />
<br />
"Resource compiler" tab:<br />
C:\PlatformSDK\Include<br />
<br />
Do not forget to specify extra path for resource compiler executable (it's in Platform SDK's "bin" subdirectory, ie: "C:\PlatformSDK\Bin" ) - you can do this in "Programs" tab (see [http://img289.imageshack.us/img289/772/settingexepaths7yx.png screen])<br />
<br />
<br />
That's all - you can compile your applications using free Microsoft Visual C++ Toolkit 2003 with Code::Blocks as your IDE.<br />
<br />
Enjoy!</div>Squizzzhttps://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.6.2_to_develop_Code::Blocks_(MSW)&diff=111Compiling wxWidgets 2.6.2 to develop Code::Blocks (MSW)2005-07-28T13:07:41Z<p>Squizzz: </p>
<hr />
<div>These are the instructions to compile wxWidgets do you can compile Code::Blocks on your own.<br />
<br />
'''NOTE:''' These instructions are MS Windows (TM) specific, but because we are using MinGW it should be possible to use these instructions with some modifications on other platforms.<br />
<br />
== Install MinGW ==<br />
If you don't have the Code::Blocks + MinGW bundle, grab the latest MinGW stuff from the [http://www.mingw.org/download.shtml#hdr2 MinGW site] and install it under a directory you like.<br />
'''NOTE:''' In these instroctions we're calling the MinGW directory <MINGW>, so you have to replace that with you're own directory.<br />
<br />
'''If you DO have the Code::Blocks + MinGW bundle, or have already installed MINGW on your own, you can skip this section.'''<br />
<br />
'''NOTE:''' The files are compressed in the tar.gz format. You need a third-party extraction utility to unzip them. (like 7-zip)<br />
<br />
You need at least the following files:<br />
* [http://prdownloads.sf.net/mingw/gcc-core-3.4.2-20040916-1.tar.gz?download gcc-core-3.4.2-20040916-1.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/gcc-g++-3.4.2-20040916-1.tar.gz?download gcc-g++-3.4.2-20040916-1.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/mingw-runtime-3.7.tar.gz?download mingw-runtime-3.7.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/mingw-utils-0.3.tar.gz?download mingw-utils-0.3.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/w32api-3.2.tar.gz?download w32api-3.2.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/binutils-2.15.91-20040904-1.tar.gz?download binutils-2.15.91-20040904-1.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/mingw32-make-3.80.0-3.exe?download mingw32-make-3.80.0-3.exe]<br />
* [http://prdownloads.sf.net/mingw/gdb-5.2.1-1.exe?download gdb-5.2.1-1.exe]<br />
GDB is not really needed, but could be usefull for debugging.<br />
<br />
After you install, make sure you have the following directories under your path:<br />
* <MINGW>\bin;<br />
* <MINGW>\mingw32\bin;<br />
<br />
== Download and Install the wxWidgets source code ==<br />
The wxWidgets 2.6.1 distribution can be found at the [http://www.wxwidgets.org/dl_msw2.htm#stable wxWidgets website]. (Note that ther e is also a winhelp file available.) You can get choose between an installer and a zip file. You can just get the zip file because the installer is also a zipped version.<br />
<br />
If you use the plain zip version, make sure to unzip using the full path. Otherwise the directories won't be created correctly.<br />
<br />
'''NOTE:''' In the rest of these instructions we are calling the wxWidgets directory <WXWIN> you have to change it to your own directory. (e.g. "c:\wxWidgets-2.6.1")<br />
<br />
== Check make version ==<br />
If you didn't install MingW yourself you have to make sure you have the right version of make. Open the command prompt and type:<br />
<tt>mingw32-make -v</tt><br />
If the version is 3.80 or greater it is allright to go on, else you have to install the new make.<br />
<br />
== Building wxWidgets ==<br />
Now it is time to compile wxWidgets, open the command promt and change to the wxWidgets directory:<br />
<tt>cd <WXWIN>\build\msw</tt><br />
Now we are on the right place we are first going to clean up the source:<br />
<tt>mingw32-make -f makefile.gcc clean</tt><br />
'''NOTE:''' if you still have problems with compiling after cleaning, you may want to remove the directory in the build\msw directory. (it contains object files...)<br />
When everything is clean we can compile wxWidgets:<br />
<tt>mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 VENDOR=cb</tt><br />
'''NOTE:''' these options are the official Code::Blocks options. When you want another version of wxWidgets (unicode or debug) you have to make sure you build a MONOLITHIC version. (One big dll)<br />
Now you can get a cup of coffee, or do something else, because this could take a long time.<br />
<br />
== Build the STC library ==<br />
If you closed the command promt, you have to open it again.<br />
We are going to the STC directory<br />
<tt>cd ..\..\contrib\build\stc</tt><br />
We clean the source:<br />
<tt>mingw32-make -f makefile.gcc clean</tt><br />
And we going to compile it. Make sure you have the same build options as before.<br />
<tt>mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 VENDOR=cb</tt><br />
So now everything is compiled for using codeblocks.<br />
<br />
== Copy libraries ==<br />
When compilation is finished it is usefull to copy the libs to another directory. By doing this you can make several builds (e.g. debug and release).<br />
* So first we create a directory this could be done in <WXWIN>\lib.<br />
* Then we go to the directory <WXWIN>\lib\gcc_dll (could called diffrent when you changed the build options)<br />
* Now we move all the files (.a .dll) and the directory (msw) to the directory of your choice. (for me it is <WXWIN>\lib\codeblocks)<br />
'''NOTE:''' Make sure you everything is removed from the directory <WXWIN>\lib\gcc_dll else you can get trouble when compiling another version.<br />
<br />
== Setting up paths ==<br />
Everything is done now, and we can start compiling Code::Blocks, couldn't we? No! First we have to setup the paths.<br />
Open the codeblocks project (CodeBlocks-wx2.6.0.cbp) and go to the Build options.<br />
From there you have to go to the tab Directories and Compiler. Here you have to add the following paths (Remember to replace <WXWIN>)<br />
* <WXWIN>\lib\codeblocks\msw<br />
* <WXWIN>\include<br />
* <WXWIN>\contrib\include<br />
The first path is used to find the right setup.h for the build you are using. The other two are for the normal include files.<br />
<br />
Now go to the Linker tab and add the following path:<br />
* <WXWIN>\lib\codeblocks<br />
'''NOTE:''' You have to replace this with the directory of your own choice in the previous section!<br />
<br />
Now you are finished with the configuration and you can hit the compile button (CTRL-F9). Be aware that Code::Blocks is not officially support wxWidgets 2.6.1 so it is possible that new files are not yet in the project. You have to do this by your self.<br />
<br />
== Post compilation steps (before running C::B) ==<br />
<br />
When compilation process is finished, simply run the update.bat script. It will ensure that all resource files (that C::B uses) are in the right place and up to date.<br />
<br />
Note: This step requires appropriate zip command, which you likely have already set up and working. However, in case you have not, you should find something usable [ftp://ftp.uu.net/pub/archiving/zip/WIN32/ here].</div>Squizzzhttps://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.4.2_to_develop_Code::Blocks_(MSW)&diff=139Compiling wxWidgets 2.4.2 to develop Code::Blocks (MSW)2005-07-28T13:05:59Z<p>Squizzz: </p>
<hr />
<div>These are the instructions to Install and compile wxWidgets 2.4.2 so you can later compile Code::Blocks on your own.<br />
<br />
NOTE: The instructions are MS Windows (TM) specific, but some could be applied to other platforms as well<br />
<br />
NOTE: This article is under construction. More info can be found [https://www.codeblocks.org/index.php?name=PNphpBB2&file=viewtopic&t=211&highlight=tutorial in the forums].<br />
<br />
== Install MinGW ==<br />
<br />
If you don't have the Code::Blocks+MinGW bundle, grab the latest MINGW stuff (including MSYS) from the <br />
[http://www.mingw.org/download.shtml#hdr2 MINGW site] and install it under a directory you like. In this tutorial we're assumming you're installing MINGW under C:\MINGW.<br />
<br />
'''If you DO have the Code::Blocks + MinGW bundle, or have already installed MINGW on your own, you can skip this section.'''<br />
<br />
NOTE: The files are compressed in the tar.gz format. You need a third-party extraction utility to unzip them.<br />
<br />
The files I (Rick) have installed are:<br />
<br />
* [http://prdownloads.sf.net/mingw/gcc-core-3.4.2-20040916-1.tar.gz?download gcc-core-3.4.2-20040916-1.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/gcc-g++-3.4.2-20040916-1.tar.gz?download gcc-g++-3.4.2-20040916-1.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download MSYS-1.0.10.exe]<br />
* [http://prdownloads.sf.net/mingw/mingw-runtime-3.7.tar.gz?download mingw-runtime-3.7.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/mingw-utils-0.3.tar.gz?download mingw-utils-0.3.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/w32api-3.2.tar.gz?download w32api-3.2.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/binutils-2.15.91-20040904-1.tar.gz?download binutils-2.15.91-20040904-1.tar.gz]<br />
* [http://prdownloads.sf.net/mingw/gdb-5.2.1-1.exe?download gdb-5.2.1-1.exe]<br />
* [http://prdownloads.sf.net/mingw/mingw32-make-3.80.0-3.exe?download mingw32-make-3.80.0-3.exe]<br />
<br />
After you install, make sure you have the following directories under your path:<br />
* C:\MINGW\bin;<br />
* C:\MINGW\mingw32\bin;<br />
(I'm assumming you installed under C:\MINGW)<br />
<br />
== Install the unix-like commands ==<br />
<br />
The wxWidgets makefile requires some unix commands (like cp) to run correctly. To avoid this windows-linux compatibility problems, you have two options:<br />
<br />
a) Download the [ftp://biolpc22.york.ac.uk/pub/ports/mingw32/extra.zip extra.zip] package, or<br />
<br />
b) Setup [[#About MSYS|MSYS]].<br />
<br />
=== About the extra.zip package ===<br />
<br />
The extra.zip package contains some programs which mimic frequently-used commands in Linux.<br />
<br />
To install, just [ftp://biolpc22.york.ac.uk/pub/ports/mingw32/extra.zip download it] and unzip it in your MINGW directory.<br />
<br />
=== About MSYS ===<br />
<br />
The [http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download MSYS package] ('''NOT included in the Code::Blocks+MinGW bundle''') allows you to run unix scripts with Mingw. Think of it as a "mini-linux emulator". When you run the executable installer, it will provide a link to msys.bat. If it doesn't appear in your desktop, search for it in your programs menu.<br />
<br />
If you don't have the extra package, you must run the wxWidgets 2.4.2 compilation from inside MSYS. Drive C is found under /c/, drive D under /d/ and so on.<br />
<br />
== Download and Install the wxWidgets source code ==<br />
<br />
The wxWidgets 2.4.2 distribution can be found at the [http://www.wxwindows.org/dl_msw2.htm#stable242 wxWidgets site]. (Note that there's also a [http://prdownloads.sourceforge.net/wxwindows/wxWindows-2.4.2-WinHelp.zip winhelp file] available). You can choose to install either the [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.4.2-setup.zip setup version] or the [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.4.2.zip plain zip version] (which I find ridiculous, because the setup version is zipped too!).<br />
<br />
If you use the plain zip version, make sure to unzip using the full path. Otherwise the directories won't be created correctly.<br />
On a second thought, you might like to use the setup version :P<br />
<br />
I have my wxWidgets installed in '''C:\wxWindows-2.4.2''' . Under MSYS, that should be '''/c/wxWindows-2.4.2''' .<br />
<br />
And now that you have all the ingredients, it's time to compile :)<br />
<br />
== Build wxWidgets ==<br />
<br />
NOTE: We're assumming you installed under C:\wxWindows-2.4.2 .<br />
<br />
Before anything, let me warn you: wxWidgets compilation is SLOW. And by SLOW I mean the time equivalent to one or two evolution cycles, like from Triasic to Jurasic, but doubled. So make sure there's a nice show on the TV, or you could invite a friend to play cards. OR you could start preparing the coffee :)<br />
<br />
Now, open up your MSYS prompt, and change to the wxWidgets src/msw directory:<br />
<br />
: <tt>cd /c/wxWindows-2.4.2/src/msw</tt><br />
<br />
Then proceed to the build. But first, an important warning that will save you many headaches.<br />
----<br />
<br />
:'''WARNING!'''<br />
:If due to a misconfiguration (like changing the version of your MINGW), your compilation fails, '''MAKE SURE''' you clean out the outputs directory with the following command:<br />
<br />
:: <tt>mingw32-make -f makefile.g95 clean</tt><br />
<br />
:(do it for wxwidgets, stc and xrc. I had weird linker errors and crashes because I didn't clean up the partial compilations). <br />
----<br />
<br />
<br />
And now that everything's clean, proceed to the build:<br />
<br />
: <tt>mingw32-make -f makefile.g95 FINAL=1 UNICODE=0 WXMAKINGDLL=1</tt><br />
<br />
If no "mingw32-make" is found, try this:<br />
<br />
: <tt>make -f makefile.g95 FINAL=1 UNICODE=0 WXMAKINGDLL=1</tt><br />
<br />
Is it compiling OK? Good! You can now enjoy your coffee :-)<br />
<br />
== Build the STC library ==<br />
<br />
Still inside MSYS, type:<br />
<br />
:<tt>cd ../../contrib/src/stc</tt><br />
<br />
That should change the directory to /c/wxWindows-2.4.2/contrib/src/stc.<br />
Now type:<br />
<br />
:<tt>mingw32-make -f makefile.g95 FINAL=1 UNICODE=0 WXUSINGDLL=1</tt><br />
<br />
(NOTE: There are NO line breaks in the command, if you see them, they're shown for readability)<br />
<br />
== Build the XRC library ==<br />
<br />
Still inside MSYS, type:<br />
<br />
:<tt>cd ../xrc</tt><br />
<br />
That should change the directory to /c/wxWindows-2.4.2/contrib/src/xrc.<br />
Now type:<br />
<br />
:<tt>mingw32-make -f makefile.g95 FINAL=1 UNICODE=0 WXUSINGDLL=1</tt><br />
<br />
And that's it! Now you only have to copy the lib and include directories so your MINGW installation can find them.<br />
<br />
== Copy the files to your mingw directory or set up the paths ==<br />
<br />
This section provides you with two alternatives: The easy one, and the hard one.<br />
The easy one consists of just copying the files to your MINGW directory. The hard one consists of setting up the paths in codeblocks.<br />
<br />
=== Option 1: Copying the wxWidgets files over your MINGW installation ===<br />
<br />
NOTE: The following instructions will overwrite part of your MINGW installation. If you're planning to build unicode applications, or use another version of wxWidgets, DO NOT, repeat, '''DO NOT''' follow these! Instead you'll have to set up the paths manually.<br />
<br />
So, here's how to copy the files. I (Rick) guarantee this option works, since it's the one I used.<br />
<br />
Close your MSYS window, and now open your windows explorer ('''NOT''' internet explorer, but Windows explorer. To open it, just press "(Windows key)+E"<br />
<br />
It's recommended to open TWO explorer windows: One for your wxWidgets directory (which we'll change to copy different files), and another to <br />
==== Copying the header files ====<br />
In the location bar, select the following path:<br />
:<tt>C:\wxWindows-2.4.2\include</tt><br />
<br />
Select all the files AND DIRECTORIES and copy. <br />
Change to the directory "include" under your MINGW main directory, and paste.<br />
<br />
Now change again the directory to:<br />
:<<tt>C:\wxWindows-2.4.2\contrib\include</tt><br />
<br />
Copy all files and directories, and paste them to your MINGW include directory.<br />
<br />
==== Copying the library files ====<br />
<br />
Change the explorer directory to: <br />
<br />
:<tt>C:\wxWindows-2.4.2\lib</tt><br />
<br />
And select all the files. Copy and Paste under your MINGW "lib" directory. <br />
<br />
==== Copying the setup.h file ====<br />
<br />
This one's very important! Normally people know to copy the headers and libs, but miss this step. If you miss it, you'll get LOTS of compilation errors. <br />
<br />
Change the explorer directory to:<br />
<br />
:<tt>C:\wxWindows-2.4.2\lib</tt><br />
<br />
There is a "mswdll" directory there. Under it, there's a "wx" subdirectory, too. Inside it there's a "setup.h". <br />
<br />
Copy it, and paste under your MINGW include/wx directory.<br />
<br />
(END of option 1)<br />
<br />
=== Option 2: Setting up the paths manually ===<br />
<br />
These instructions are to be followed by those who plan to use the 2.6 version of wxWidgets, or want to build their own version (i.e. with unicode support). Since you can't use both 2.4.2 and 2.6 libraries at the same time, you have to keep them in separate directories.<br />
<br />
Open the CodeBlocks.cbp, to be found in your local Code::Blocks source directory (for example "C:\codeblocks\src").<br />
Open up the build options, change the tab to "Directories" and add the following, replacing <WXW> with your WxWindows directory, for example "C:\wxWindows-2.4.2" (without the quotes):<br />
<br />
'''Compiler'''<br />
*<WXW>\include<br />
*<WXW>\contrib\include<br />
*<WXW>\lib\mswdll<br />
<br />
'''Linker'''<br />
*<WXW>\lib<br />
<br />
'''Resource compiler'''<br />
*<WXW>\include<br />
<br />
----<br />
<br />
And that's it. Now you're ready to compile Code::Blocks!<br />
<br />
== Post compilation steps (before running C::B) ==<br />
<br />
When compilation process is finished, simply run the update.bat script. It will ensure that all resource files (that C::B uses) are in the right place and up to date.<br />
<br />
Note: This step requires appropriate zip command, which you likely have already set up and working. However, in case you have not, you should find something usable [ftp://ftp.uu.net/pub/archiving/zip/WIN32/ here].<br />
<br />
== Common compilation problems ==<br />
<br />
=== symbol `_D' is already defined ===<br />
<br />
Your MinGW installation is probably outdated (dev-cpp user perhaps?). Make sure you're using [[#Install_MinGW|GCC 3.4.2 or later]].</div>Squizzz