Thread: Executing C Program in Visual Studio 2008

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    14

    Executing C Program in Visual Studio 2008

    I am trying to teach myself C Programming. I need to know how to execute an application in Visual Studio 2008. I can't find a way to do this!!! It is only the first example aswell which is to simply print out hello

  2. #2
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    Well in VS2005 you press F5 to run with debug, or CTRL + F5 to run without it.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Same thing with 2008.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Registered User
    Join Date
    Feb 2008
    Posts
    14
    The option is greyed out in the menu. Don't know if it's down to the type of file i opened, i opened up a text file in the C++ development IDE and then saved it as a .c file.
    Last edited by rory-uk; 02-04-2008 at 01:51 PM.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    You need to create a project first, then add files to the project and compile through F7, then run through F5 or Ctrl+F5.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    Feb 2008
    Posts
    14
    Getting build errors with attempting to do the above. In fact I'm not sure if this version of Visual Studio will allow me to create a C Program. Can anyone give me a link to an IDE for C Programming which I can download for free that works on 64 Bit Home Premium Vista?

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    It does work. Post your compile errors.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Registered User
    Join Date
    Feb 2008
    Posts
    14
    1>------ Build started: Project: Test3, Configuration: Debug Win32 ------
    1>Compiling manifest to resources...
    1>Project : error PRJ0003 : Error spawning 'rc.exe'.
    1>Build log was saved at "file://c:\Users\Rory\Documents\Visual Studio 2008\Projects\Test3\Test3\Debug\BuildLog.htm"
    1>Test3 - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  9. #9
    Registered User
    Join Date
    Feb 2008
    Posts
    14
    The original file that gets created is a .cpp file, which is a C++ extension and the other file I created is a .c Isn't this not going to work

  10. #10
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Does Visual Studio Express come with a recourse compiler (rc.exe)?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  11. #11
    Registered User
    Join Date
    Feb 2008
    Posts
    14
    reverse-compiler??? It's not Visual Studio Express, it's a trial version of Visual Studio 2008 Pro. Like I said earlier could anyone give me a link to a C programming IDE environment that I could download

  12. #12
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Resource compiler.
    Visual Studio is fine. You just seem to have an issue.
    Did you create a new project? Do you have an .rc file in the project?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  13. #13
    Registered User
    Join Date
    Feb 2008
    Posts
    14
    What's a .rc? I am simply creating a basic hello program. Below is the code:

    Code:
    #include <stdio.h>
    
    main()
    {
    	printf("Hello");
    }

  14. #14
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Main should return int.
    Obviously it's expecting to run the resource compiler... Hmmm. So you've created a new project? You are sure rc.exe exists? You're sure you have sufficient security privileges to run (create data)?
    Because it works fine if I create a new project and compile it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  15. #15
    Registered User
    Join Date
    Feb 2008
    Posts
    14
    How did you create the project? Was it a Win32 console application?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OutputDebugString not working in Visual Studio 2008
    By jw232 in forum Windows Programming
    Replies: 3
    Last Post: 07-02-2009, 07:13 PM
  2. C & visual studio 2008
    By Red Maw in forum C Programming
    Replies: 2
    Last Post: 04-02-2009, 09:06 PM
  3. Visual Studio Express 2008 problems.
    By Normac in forum C++ Programming
    Replies: 2
    Last Post: 08-08-2007, 10:41 AM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  5. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM