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
Printable View
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
Well in VS2005 you press F5 to run with debug, or CTRL + F5 to run without it.
Same thing with 2008.
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.
You need to create a project first, then add files to the project and compile through F7, then run through F5 or Ctrl+F5.
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?
It does work. Post your compile errors.
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 ==========
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
Does Visual Studio Express come with a recourse compiler (rc.exe)?
--
Mats
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
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?
What's a .rc? I am simply creating a basic hello program. Below is the code:
Code:#include <stdio.h>
main()
{
printf("Hello");
}
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.
How did you create the project? Was it a Win32 console application?
Yes, a pure Win32 Console app.
Still can't get it to work. Could someone please just send me a link to another C compiler
There are a couple out there. Google is a good resource to use. Personally, I prefer lcc-win32 for windows, which can be found at http://www.cs.virginia.edu/~lcc-win32/.
That's a shame it doesn't work for you. You're missing out of a terrific IDE.
i also am not getting c to run from VS 2005. can someone give me the steps
i go to new project, click c++ and then WIN 32 console app. it opens up a few c++ files and a header file. i then try to add my file, main.c and put in a hello world, and doesnt compile, do you have to compile from command line, thanks for your help
Jeremy
EDIT: This is answering jjfait, who is the poster above me. :)
"it opens up a few c++ files and a header file"
This is because it's opening the project as a C++ project, so adds some additional C++ code.
File > New Project > WIN 32 console app > OK > Welcome to win32 application wizard > next > console ap + empty project > finish.
This will create an empty project, with no C++ codes/files.
HAPPYCLOWN I COULD KISS YOU!!!!!!!!!!!!
I love Visual Studio it's the only place I feel at home and now that I can program C in this baby I'm completely over the moon!
Well... not completely over the moon... I don't really get kicks out of writing code... but let's just say you've solved a big problem of mine :)
You just need Visual C++ 2008 Express Visual Studio 2008 Express Editions and when you create new projects, do an EMPTY project from GENERAL projects, then when you add files, right click on SOURCE FILES and ADD NEW ITEM, then just name your file <filename>.c (remember to specify the extension when you name the file!) to override the default extension .cpp and the IDE and everything else will treat your code as C.
Regards,
FSX
F5 starts the debugger. Obviously, the program runs slower in the debugger than without. Furthermore, in Debug mode, the console window disappears when the program does as opposed to non-debug mode (but you can use a breakpoint to avoid that).
Also, you DON'T need an empty project. It will create a default project for you that will compile fine (although it creates a C++ file, but you can rename them). Remember that by default it also creates a precompiled header, which means you must add #include "stdafx.h" at the beginning of every source file.
I'm not certain if it includes C++ headers in stdafx.h by default. I don't think so...
I agree that you should just use Visual Studio C++ Express Edition.
It's a complete program, not a trial - and as a beginner I am finding it to be an absolutely superb IDE for learning how to program in C and C++. I've used various other IDEs with other languages and VSC++ is by far and away the best I've ever used. Intellisense is fantastic as a learning tool when you're starting out with things such as passing pointers to structs around and the like. There's many a time it's made me realize exactly what I was doing wrong. I love it.
You do know what a debugger is, I hope?
The only difference is that your program will crash or you will get a runtime error dialog if something goes wrong in non-debugging mode. In debugging mode, the debugger will break where the error occurred.
And debugging mode gives you access to debugging features, naturally.
Hi,
My first post.
I am trying to compile a C program in VS 2008. When I try to compile my simple "Hello World" program in C I get the following error.
Error spawning rc.exe
I created an empty win32 console application, then added a file Test.c
Thanks,
RFederer