Author Topic: Code::Blocks 10.05 && VC++ 2010 compiler setup  (Read 21750 times)

Offline kiwiDude

  • Single posting newcomer
  • *
  • Posts: 2
Code::Blocks 10.05 && VC++ 2010 compiler setup
« 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: [Select]
#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..

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
« Reply #1 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline kiwiDude

  • Single posting newcomer
  • *
  • Posts: 2
Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
« Reply #2 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.

ysg

  • Guest
Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
« Reply #3 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

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

Thanks in advance.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6951
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

hawsang

  • Guest
Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
« Reply #5 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!


Offline cacb

  • Regular
  • ***
  • Posts: 426
Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
« Reply #6 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.

Offline cacb

  • Regular
  • ***
  • Posts: 426
Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
« Reply #7 on: May 26, 2013, 01:48:13 am »
Additional configurations for VC2010



Offline cacb

  • Regular
  • ***
  • Posts: 426
Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
« Reply #8 on: May 26, 2013, 01:48:48 am »
Final configuration

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12701
    • Travis build status
Re: Code::Blocks 10.05 && VC++ 2010 compiler setup
« Reply #9 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.
(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!]