![]() |
|
|
|||||||
![]() |
C Programming - Compile C program in Visual Studio 2005 |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Sorry if this sounds stupid. I am a total newbie....
Can I compile C program in Visual Studio 2005 IDE? I wrote the simple "Hello World" program in it: ------------------------------------ #include <stdio.h> main() { printf("hello, world!\n"); } -------------------------------------- When I run it, it gives me the following: ------------------------------------------------------------------------- 'HelloWorld2.exe': Loaded 'D:\VS\Projects\HelloWorld2\debug\HelloWorld2.exe' , Binary was not built with debug information. 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded. 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded. 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\apphelp.dll', No symbols loaded. 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded. The thread 'Win32 Thread' (0x4e The program '[5968] HelloWorld2.exe: Native' has exited with code 0 (0x0). ------------------------------------------------------------------------- Any suggestions? Please advice. Thanks a million! Regards, Nick Nicholas Zhou |
|
|
|
|
#2 |
|
Posts: n/a
|
Yes you can
The program compiled and lin ked properly. When you created the project did you create it as a console application. Also run the application from the command line not inside the ide. inside the ide the program will end and close the console window. Nicholas Zhou wrote: > Sorry if this sounds stupid. I am a total newbie.... > > Can I compile C program in Visual Studio 2005 IDE? I wrote the simple > "Hello World" program in it: > > ------------------------------------ > > #include <stdio.h> > > main() > { > printf("hello, world!\n"); > } > > -------------------------------------- > > When I run it, it gives me the following: > > ------------------------------------------------------------------------- > 'HelloWorld2.exe': Loaded > 'D:\VS\Projects\HelloWorld2\debug\HelloWorld2.exe' , Binary was not built > with debug information. > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols > loaded. > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols > loaded. > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\apphelp.dll', No symbols > loaded. > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols > loaded. > The thread 'Win32 Thread' (0x4e > The program '[5968] HelloWorld2.exe: Native' has exited with code 0 (0x0). > > ------------------------------------------------------------------------- > > > Any suggestions? Please advice. Thanks a million! > > Regards, > > Nick Scooter |
|
|
|
#3 |
|
Posts: n/a
|
Scooter wrote:
> Yes you can Please don't top-post. Your replies belong following or interspersed with properly trimmed quotes. See the majority of other posts in the newsgroup, or: <http://www.caliburn.nl/topposting.html> Default User |
|
|
|
#4 |
|
Posts: n/a
|
"Scooter" <> wrote in message news: ups.com... > Yes you can > > The program compiled and lin ked properly. When you created the project > did you create it as a console application. Also run the application > from the command line not inside the ide. inside the ide the program > will end and close the console window. > > Nicholas Zhou wrote: >> Sorry if this sounds stupid. I am a total newbie.... >> >> Can I compile C program in Visual Studio 2005 IDE? I wrote the simple >> "Hello World" program in it: You're gonna get flamed if you continue to go on about the details of your IDE, which has nothing to do with ISO C. At least have a proper main call which is int main(void) There's certainly a NG with the word microsoft in it where you'll find that your questions find a better response. LS Lane Straatman |
|
|
|
#5 |
|
Posts: n/a
|
Nicholas Zhou <> wrote:
> Sorry if this sounds stupid. I am a total newbie.... > > Can I compile C program in Visual Studio 2005 IDE? I wrote the simple > "Hello World" program in it: Yes. Make sure the files have the .c extension instead of .cpp so it compiles the source as C and not as C++. > #include <stdio.h> > > main() If you write it as int main(void) you would remember that you should return something when the function ends and main returns int. > { > printf("hello, world!\n"); add: getchar(); so you make sure that the console stays opened until you press Enter. This way you get to read the output. Make sure you have a console project. add: return 0; > } > > -------------------------------------- > > When I run it, it gives me the following: > > ------------------------------------------------------------------------- > 'HelloWorld2.exe': Loaded > 'D:\VS\Projects\HelloWorld2\debug\HelloWorld2.exe' , Binary was not built > with debug information. > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols > loaded. > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols > loaded. > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\apphelp.dll', No symbols > loaded. > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols > loaded. > The thread 'Win32 Thread' (0x4e > The program '[5968] HelloWorld2.exe: Native' has exited with code 0 (0x0). The last line says that your program ran and returned with code 0. -- Ioan - Ciprian Tandau tandau _at_ freeshell _dot_ org (hope it's not too late) (... and that it still works...) Nelu |
|
|
|
#6 |
|
Posts: n/a
|
u write the program in console project. that is when u would select the new project, u select the console application. u try it and reply to me. On Jan 17, 6:10 am, Nelu <spamah...@gmail.com> wrote: > Nicholas Zhou <zhou....@osu.edu> wrote: > > Sorry if this sounds stupid. I am a total newbie.... > > > Can I compile C program in Visual Studio 2005 IDE? I wrote the simple > > "Hello World" program in it:Yes. Make sure the files have the .c extension instead of .cpp so it > compiles the source as C and not as C++. > > > #include <stdio.h> > > > main()If you write it as > int main(void) > you would remember that you should return something when the function > ends and main returns int. > > > { > > printf("hello, world!\n");add: > > getchar(); > > so you make sure that the console stays opened until you press Enter. > This way you get to read the output. Make sure you have a console > project. > > add: > return 0; > > > > > > > } > > > -------------------------------------- > > > When I run it, it gives me the following: > > > ------------------------------------------------------------------------- > > 'HelloWorld2.exe': Loaded > > 'D:\VS\Projects\HelloWorld2\debug\HelloWorld2.exe' , Binary was not built > > with debug information. > > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols > > loaded. > > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols > > loaded. > > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\apphelp.dll', No symbols > > loaded. > > 'HelloWorld2.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols > > loaded. > > The thread 'Win32 Thread' (0x4e > > The program '[5968] HelloWorld2.exe: Native' has exited with code 0 (0x0).The last line says that your program ran and returned with code 0. > > -- > Ioan - Ciprian Tandau > tandau _at_ freeshell _dot_ org (hope it's not too late) > (... and that it still works...)- Hide quoted text -- Show quoted text - madhawi |
|
|
|
#7 |
|
Posts: n/a
|
madhawi wrote:
> u write the program in console project. that is when u would select the > new project, u select the console application. > u try it and reply to me. Please use proper English words instead of indecipherable abbreviations like 'u', '4' etc. santosh |
|
|
|
#8 |
|
Posts: n/a
|
madhawi wrote:
> > u write the program in console project. that is when u would select > the new project, u select the console application. > u try it and reply to me. The combination of rude top-posting and incomprehensible geek-speek makes this a totally useless reply to a patently off-topic article. Please review the following links before further disruption of newsgroups. -- Some informative links: <http://members.fortunecity.com/nnqweb/> (newusers) <http://www.catb.org/~esr/faqs/smart-questions.html> <http://www.caliburn.nl/topposting.html> <http://www.netmeister.org/news/learn2quote.html> <http://cfaj.freeshell.org/google/> (taming google) CBFalconer |
|
|
|
#9 |
|
Posts: n/a
|
CBFalconer wrote:
> madhawi wrote: >> u write the program in console project. that is when u would select >> the new project, u select the console application. >> u try it and reply to me. > > The combination of rude top-posting and incomprehensible geek-speek > makes this a totally useless reply to a patently off-topic > article. Please review the following links before further > disruption of newsgroups. Could you stop recommending this one: <http://members.fortunecity.com/nnqweb/> You are telling people to visit a site which contains some links to somewhere; that "somewhere" is something you have to discover by clicking those links and getting popups or "Click to skip advertisement" garbage. Note, try this link with a virgin browser without any fancy network settings you told you have. Try it as an innocent guy with mozilla or IE would do. By doing this you are doing more harm than good: most people getting this template response from you simply ignore you (naturally), but those who do not will get to that garbage site, and will ignore you too; and they won't try next links even though they are actually not bad. And as the result you simply add to the "further disruption of newsgroups". Regards, Yevgen Yevgen Muntyan |
|
|
|
#10 |
|
Posts: n/a
|
Yevgen Muntyan wrote:
> .... snip ... > > Could you stop recommending this one: > > <http://members.fortunecity.com/nnqweb/> > > You are telling people to visit a site which contains some links > to somewhere; that "somewhere" is something you have to discover > by clicking those links and getting popups or "Click to skip > advertisement" garbage. > > Note, try this link with a virgin browser without any fancy network > settings you told you have. Try it as an innocent guy with mozilla > or IE would do. > > By doing this you are doing more harm than good: most people > getting this template response from you simply ignore you > (naturally), but those who do not will get to that garbage site, > and will ignore you too; and they won't try next links even though > they are actually not bad. And as the result you simply add to the > "further disruption of newsgroups". I compromised. I moved it to the last of the links. It does lead to valuable information. -- Chuck F (cbfalconer at maineline dot net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> CBFalconer |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MCTS on Visual Studio 2005 Exams soon to be Discontinued? | IT.VP | MCTS | 0 | 08-21-2009 09:32 PM |
| Crytal Reports and Visual Studio 2005 Images not displaying | peterc | Software | 2 | 01-21-2009 07:00 AM |
| Fox Studio Classics - R1 vs R2 | ayric | DVD Video | 1 | 05-10-2006 05:56 PM |
| A-1 Cheap Dvds | CHEAPDVDS | DVD Video | 0 | 06-19-2005 03:30 AM |
| requesting a hand up - read for your Mom [short message with Quotes] | Miss Marple | DVD Video | 1 | 03-17-2005 10:07 PM |