Author Topic: (Tut) Setting Up VC 10 Compiler In Code::Blocks  (Read 5376 times)

0 Members and 1 Guest are viewing this topic.

Offline bubzuru

  • Knight
  • **
  • Posts: 395
  • Cookies: 21
  • everything is contained in the data
    • View Profile
    • New School Tools
(Tut) Setting Up VC 10 Compiler In Code::Blocks
« on: September 27, 2012, 04:13:45 am »
ok i will make this short and sweet

How to use the Visual Studio 2010 Pro Compiler With Code::Blocks

if you try to use the VC compiler in code blocks by selecting the Microsoft Visual C++ ToolKit 2003 then pressing auto-detect it will find the compiler but when you try to compile a file you will get the missing mspdb100.dll error. here is how to fix it

1. Open your compiler's bin folder (C:\Program Files\Microsoft Visual Studio 10.0\VC\bin for me)
2. Create 2 new files p.bat and d.bat
3. Add this code to d.bat
Code: (batch) [Select]
call vcvars32.bat
call cl.exe %1 %*
4. Add this code to p.bat
Code: (batch) [Select]
call vcvars32.bat
call link.exe %1 %*

ok done, now open Code::Blocks

1. Click Settings->Compiler and Debuger...
2. Set Microsoft Visual C++ ToolKit 2003 as you compiler
3. Click the Toolchain Executables tab and press the auto-detect button (it should find VS 2010)
4. set d.bat as the compiler and p.bat as the linker


now your code should compile fine , no dll errors
Code: [Select]

-------------- Build: Debug in ggggg ---------------

C:\Users\Bubzuru\Desktop\ARTeam PE Tutorial\ggggg>REM File: cl.bat
C:\Users\Bubzuru\Desktop\ARTeam PE Tutorial\ggggg>call vcvars32.bat
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
C:\Users\Bubzuru\Desktop\ARTeam PE Tutorial\ggggg>call cl.exe /nologo /nologo  /W3 /DBUILD_DLL /Zi /D_DEBUG /MDd    /I"C:\Program Files\Microsoft Visual C++ Toolkit 2003\include" /I"C:\Program Files\Microsoft Visual Studio 10.0\VC\include" /I"C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE"  /c main.cpp /Foobj\Debug\main.obj
main.cpp
Linking dynamic library: bin\Debug\ggggg.dll
C:\Users\Bubzuru\Desktop\ARTeam PE Tutorial\ggggg>REM File: cl.bat
C:\Users\Bubzuru\Desktop\ARTeam PE Tutorial\ggggg>call vcvars32.bat
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
C:\Users\Bubzuru\Desktop\ARTeam PE Tutorial\ggggg>call link.exe /dll /dll /nologo /LIBPATH:"C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib" /LIBPATH:"C:\Program Files\Microsoft Visual Studio 10.0\VC\lib" /LIBPATH:"C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE"  /out:bin\Debug\ggggg.dll user32.lib  obj\Debug\main.obj   /DEBUG
Output size is 17.00 KB
Process terminated with status 0 (0 minutes, 2 seconds)
0 errors, 0 warnings
« Last Edit: September 27, 2012, 04:15:28 am by bubzuru »
Damm it feels good to be gangsta
http://bubzuru.comule.com

Offline bubzuru

  • Knight
  • **
  • Posts: 395
  • Cookies: 21
  • everything is contained in the data
    • View Profile
    • New School Tools
Re: (Tut) Setting Up VC 10 Compiler In Code::Blocks
« Reply #1 on: September 27, 2012, 03:33:54 pm »
btw just to let you guys know
using the VC compiler solved my dll entry point errors

im not bashing on gcc i just like Microsoft's compiler
Damm it feels good to be gangsta
http://bubzuru.comule.com