Author Topic: Configuring VC++2010 Express (free Version) in CB  (Read 8305 times)

Offline mahaju

  • Multiple posting newcomer
  • *
  • Posts: 25
Configuring VC++2010 Express (free Version) in CB
« on: September 10, 2012, 02:57:43 pm »
Hi
I downloaded VC++2010 Express
For some reason the program crashes on startup
So now I am trying to setup CB to use VC++ compiler but it does not detect VC++2010 automatically
So I made a copy of VC++ 2005/2008 and changed the search directory in the global compiler options to "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin", everything else is at it's default value
I made a Console Application Project for a C file and when I tried to compile I got this error message

Execution of 'cl.exe /nologo /W3  /D_DEBUG    /I"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin"  /c main.c /Foobj\Debug\main.obj' in 'D:\CB_Files\VC++2010\test\test' failed.

Also, for the toolchain executable tab, how to I set the VC++ 2010 debugger? I cannot find the debugger file there

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Configuring VC++2010 Express (free Version) in CB
« Reply #1 on: September 10, 2012, 03:05:26 pm »
Hi
I downloaded VC++2010 Express
For some reason the program crashes on startup
So now I am trying to setup CB to use VC++ compiler but it does not detect VC++2010 automatically
So I made a copy of VC++ 2005/2008 and changed the search directory in the global compiler options to "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin", everything else is at it's default value
I made a Console Application Project for a C file and when I tried to compile I got this error message

Execution of 'cl.exe /nologo /W3  /D_DEBUG    /I"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin"  /c main.c /Foobj\Debug\main.obj' in 'D:\CB_Files\VC++2010\test\test' failed.
Try reading this: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
Also please read the rules, there you'll learn how to post good questions.
You're missing information about the versions, so I have to guess what is installed on your machine.
If you're using 10.05, you can try with a nightly build, I think there were some changes related to vc10 in there...

Also, for the toolchain executable tab, how to I set the VC++ 2010 debugger? I cannot find the debugger file there
You can't, because the debugger is tightly integrated with the visual studio and external programs doesn't have access to it.
You can debug vc++ programs by installing the "debugging tools for windows", which include the cdb executable, which
can be used by C::B.

But if you don't need vc++ for a specific project I highly recommend to use a mingw release and gdb, with codeblocks
it will be easier and more complete experience. Especially if you're a novice.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline mahaju

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Configuring VC++2010 Express (free Version) in CB
« Reply #2 on: September 10, 2012, 03:26:10 pm »
Sorry about that
CB is 10.05 , the Sept 2010 upload I think, Windows 7
I fixed all the paths and added the VC++ path in the Windows environment variables, but then it said mspdb100.dll could not be found
It was present in the VC++ installation folder and I have read that it is an issue even when trying to compile using VC++ from command line
I copied the file from VC++ installation directory to Windows\System32 but now I get this error

"main.c : fatal error C1902: Program database manager mismatch; please check your installation"

Anyway I managed to download the latest (I think, it was Aug 25) nightly build (This one: http://forums.codeblocks.org/index.php/topic,16772.0.html) and the two dll files mentioned in the nightly build information thread, but how do I use it? Do I just overwrite my older CB files with the one's in the nightly build? I do not want to ruin any of my previous settings
Also, what is RC2 that is mentioned in the nightly build information thread?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline mahaju

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Configuring VC++2010 Express (free Version) in CB
« Reply #4 on: September 10, 2012, 04:01:45 pm »
Ok I did everything but now I'm getting this

link.exe /nologo /LIBPATH:"C:\Program Files\Microsoft Visual Studio 10.0\VC\lib" /LIBPATH:"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin"  /out:bin\Debug\test.exe libcmtd.lib libcpmtd.lib  obj\Debug\main.obj   /DEBUG
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'

I have included ..vc\lib to the linker path
and there is no kernel32.lib inside the VC++2010 directory

Also, http://forums.codeblocks.org/index.php?topic=12915.0
but I don't understand it
Please help
thank you

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Configuring VC++2010 Express (free Version) in CB
« Reply #5 on: September 10, 2012, 04:37:01 pm »
But if you don't need vc++ for a specific project I highly recommend to use a mingw release and gdb, with codeblocks
it will be easier and more complete experience. Especially if you're a novice.
Maybe you've missed this comment...

p.s. the post explained that you have to put the path to kernel32.lib in the seach directories for the linker...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 539
Re: Configuring VC++2010 Express (free Version) in CB
« Reply #6 on: September 11, 2012, 01:21:13 am »
Also, for the toolchain executable tab, how to I set the VC++ 2010 debugger? I cannot find the debugger file there
You can't, because the debugger is tightly integrated with the visual studio and external programs doesn't have access to it.
You can debug vc++ programs by installing the "debugging tools for windows", which include the cdb executable, which
can be used by C::B.

But if you don't need vc++ for a specific project I highly recommend to use a mingw release and gdb, with codeblocks
it will be easier and more complete experience. Especially if you're a novice.

I agree the mingw way is more complete in C::B. However, some of us must use the MS compiler in order to be compatible with "other stuff". I have used the VC2010 express compiler with Code::Blocks Nightlies for a while now, and it works rather well. The main drawback compared to using mingw/gcc is that debugging isn't quite as integrated.

However, I have lived well for some time with the following compromise: The attached screenshot shows how I configured the VC2010 express IDE to be an external debugger acessible from the C::B Tools menu. So in Debug mode one may use "Tools | VCPP Debug" and then the VC2010 debugger pops up with the current source file. So for debugging, the VC2010 debugger is used without any other preparations.