Author Topic: Integrating Windows 2003 R2 Platform SDK to Code::Blocks  (Read 6460 times)

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
Integrating Windows 2003 R2 Platform SDK to Code::Blocks
« on: July 10, 2006, 07:56:06 pm »
This thread is about integrating the Windows Server 2003 R2 platform SDK to Code::Blocks. The SDK includes full build system to create applications for IA64, AMD64 and x86 archs.

In the end, we should have integrated all the archs to Code::Blocks so that other developers can use them easily. I'll also write article to the Wiki about the integration along the way / when we're ready.

The compilers in this SDK are not the same as in Visual C++ 2005:

Quote
Although these compilers are on the same code base as the ones later released in Visual Studio 2005 the Visual Studio compilerss continued to have enhancements introduced to them, long after these were released, you will find differences between them. (For example if you use the VS 2005 compilers, and the VC libraries from VS 2005 you will not need to link to bufferoverflowu.lib. While it is perfectly acceptable to continue to use these compilers for production code you should consider moving to the enhanced versions in Visual Studio 2005.

But what I've understanded, the free version of Visual C++ 2005 does not allow you to create 64-bit executables nor it includes a 64-bit debugger.

What you need


Some random remarks

  • Remember to link against bufferoverflowU.lib (add bufferoverflowU to the link libraries) or you get errors about __security_cookie. More about the issue.

Edit: Hmm... reading the Wiki, this thread has some similarities to the Visual C++ Toolkit 2003 article.

Edit2: I had problems installing the SDK. The executable that's supposed to extract the .cab files didn't work. I had to use 7-zip to extract the files: open the first .cab file in the set (PSDK-FULL.1.cab) with 7-zip and extract normally.
« Last Edit: July 10, 2006, 11:34:57 pm by artoj »

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
Re: Integrating Windows 2003 R2 Platform SDK to Code::Blocks
« Reply #1 on: July 10, 2006, 11:34:22 pm »
Little update. It seems that the SDK doesn't even have 32-bit compiler in it. It just tries to search for existing Visual Studio installations and launch the compiler from there.

So this leaves us the following:

  • Visual C++ Toolkit 2003 removed from MS' site
  • Non-optimizing 32-bit-only compiler in Visual C++ 2005 Express
  • Old 64-bit (non-optimizing?) compilers in this SDK

*Sigh*

:(

Offline mmebane

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: Integrating Windows 2003 R2 Platform SDK to Code::Blocks
« Reply #2 on: July 11, 2006, 12:12:44 am »
I could've sworn Visual  C++ 2005 Express had an optimizing compiler.

EDIT: Yeah, here:
http://msdn.microsoft.com/vstudio/express/visualc/features/language/default.aspx

Quote
he C++ compiler in the Express Edition can generate highly optimized code for Windows and the .NET Framework. Developers using Visual C++ are able to create finely-tuned and high performance applications for Microsoft platforms. In addition, to achieve even greater performance, developers can use inline assembly code to write hand-optimized code. The Visual C++ compiler can also generate high performance floating point code for platforms that support SSE/SSE2 instructions.

It doesn't seem to do 64-bit, though.

EDIT2: You can get the 2003 toolkit from here:
http://xona.com/2004/06/29.html
« Last Edit: July 11, 2006, 12:14:51 am by mmebane »

Offline artoj

  • Almost regular
  • **
  • Posts: 206
  • Location: Supporting my team
    • http://ajonsson.kapsi.fi/
Re: Integrating Windows 2003 R2 Platform SDK to Code::Blocks
« Reply #3 on: July 11, 2006, 11:33:56 am »
Thanks for the links and information mmebane. :)

Here are the instructions to install the compiler (AMD64 version) / debugger:

- Install the SDK and the debugger package
- Open Code::Blocks and go to Settings - Compiler and debugger. Select the Programs tab
- Insert the SDK installation directory to the "Compiler's installation directory" text box.
- Select the Additional paths tab. Add <SDK-Installation-Directory>\Bin\win64\x86\AMD64. Replace the <SDK-Installation-Directory> with the real one.
- Add the debugger installation directory to the additional paths
- Go to the Directories tab and select the Compiler tab.
- Add <SDK-Installation-Directory>\Include, \Include\atl, \Include\crt, \Include\crt\sys, \Include\mfc.
- Go to the Linker tab.
- Add <SDK-Installation-Directory>\Lib\AMD64, \Lib\AMD64\atlmfc
- Go to the main Linker tab.
- In the link libraries, click Add, type "bufferoverflowU.lib" and click OK.

Click OK to save all modifications you've made.

Go to File - New. Select Win32 GUI Project. Be sure to the select the Visual C++ 2005 compiler in the wizard.

Click F9 to Build and run the project. You can verify that the application is indeed native 64-bit app by looking the application's image name from Task Manager. Applications that are native don't have the "* 32" in their name.

Let's test the debugger next. Close the test app you builded. Add a few breakpoints to the source and press F8. Verify that the application execution stops at the breakpoints.

Now you should have a 64-bit debugging / building environment in Code::Blocks.

    Arto

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Integrating Windows 2003 R2 Platform SDK to Code::Blocks
« Reply #4 on: July 11, 2006, 12:00:06 pm »
Wiki please :)
Be patient!
This bug will be fixed soon...