Code::Blocks Forums

User forums => Help => Topic started by: kiwiDude on July 15, 2010, 02:10:47 pm

Title: Code::Blocks 10.05 && VC++ 2010 compiler setup
Post by: kiwiDude on July 15, 2010, 02:10:47 pm
Hey there having a little difficulty setting up C::B with VC++2010, reason I'm using C::B over the VC++ 2010 IDE is that my laptop isn't very fast (Pentium III, 512MB RAM) so C::B runs/loads alot faster than VC++2010. 

Basically the "default" VC++ compiler location sets it self to the VC++ 2008 edition, and so I have to manually enter the path for the toolchain etc.  I'm a hobbyist programmer so I'm not sure what the extra options really mean in regards to what additional options I should be setting (sorry if thats a bit vague), I have the windows platform SDK installed but whenever I try to compile including the "windows.h" header file it says:

Quote
fatal error C1083: Cannot open include file: 'windows.h': No such file or directory|

Now I'm not sure if this is because I haven't configured C::B correctly or if its something else, because of this sorry if this is the wrong section to post this in.  What I have done though is replaced the path of the default VC++ 2008 toolchain with the 2010 edition (where the compiler etc resides), although I'm still getting the error when trying to compile.

Trying with the standard headers for example like this:

Code
#include <stdio.h>

int main(void){

    return 0;
}

And i get this from the build message box:

Quote
LINK||fatal error LNK1104: cannot open file 'kernel32.lib'|

Bit stuck..
Title: Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
Post by: MortenMacFly on July 15, 2010, 02:31:22 pm
Quote
fatal error C1083: Cannot open include file: 'windows.h': No such file or directory|
Add the path to the platform SDK (header files) to the project's build options under compiler include paths.

Quote
LINK||fatal error LNK1104: cannot open file 'kernel32.lib'|
Add the path to the platform libraries to the project's build options under linker include paths.
Title: Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
Post by: kiwiDude on July 15, 2010, 04:21:48 pm
Quote
fatal error C1083: Cannot open include file: 'windows.h': No such file or directory|
Add the path to the platform SDK (header files) to the project's build options under compiler include paths.

Quote
LINK||fatal error LNK1104: cannot open file 'kernel32.lib'|
Add the path to the platform libraries to the project's build options under linker include paths.


Aha that did it, sorry about this thread, still feeling my way around IDE's and such.
Title: Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
Post by: ysg on February 26, 2013, 07:07:00 pm
Quote
fatal error C1083: Cannot open include file: 'windows.h': No such file or directory|
Add the path to the platform SDK (header files) to the project's build options under compiler include paths.

Quote
LINK||fatal error LNK1104: cannot open file 'kernel32.lib'|
Add the path to the platform libraries to the project's build options under linker include paths.

Hi, I know that this thread is quite old, but I'm having the same problem as OP (and didn't want to make another thread, I can if that would be more appropriate).

But, honestly, I don't know where my SDK header files are on my machine.  The same goes for the libraries on my machine.  I'm running Win 7 32-bit at work and Vista 64-bit at home (if that helps).

And yes, I've googled and have yet to find a good solution to my problem.  This is the contents of C:\Program Files\Microsoft SDKs\Windows as printed out by cygwin:
http://bin.cakephp.org/view/1135131447 (http://bin.cakephp.org/view/1135131447)

And yes, I'd like to use VC++ 2010 for my compiler.

Thanks in advance.
Title: Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
Post by: stahta01 on February 26, 2013, 07:34:52 pm
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)
Title: Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
Post by: hawsang on May 25, 2013, 09:58:32 am
i have just met and solved this problem. Maybe i can help u~
click into the "setting" button, and get into "Compiler…" ,there is a "Linker settings" in the horizontally lied menu, get into it.

then "add" "link libraries", find the kernel32.lib in your computer,(usually C:\Program Files\Microsoft SDKs\Windows\"version"\Lib\Kernel32.Lib, find it and click it into the link library sheet).

click"OK"

maybe your program can execute now!

forgive my poor English  :(  wish you can solve this problem too!

Title: Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
Post by: cacb on May 26, 2013, 01:47:07 am
VC2010, either full version or free express version works very well with Code::Blocks, I am using both. Attached files show the compiler configuration settings needed to make it work.

Notice that this is for a recent Nightly Build on Windows, 8982 in this case. Notice also that using the VC2010 compiler may require debugging to be done in the VC2010 IDE. I have configured an entry in the Tools menu for this purpose.
Title: Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
Post by: cacb on May 26, 2013, 01:48:13 am
Additional configurations for VC2010


Title: Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
Post by: cacb on May 26, 2013, 01:48:48 am
Final configuration
Title: Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
Post by: oBFusCATed on May 26, 2013, 06:42:35 pm
cacb:
Don't attach images please, instead use a image upload service.
Forum space is limited and files are deleted at random. So your posts might get none-informational in the future.