Go Back   Velocity Reviews > Newsgroups > C Programming
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

C Programming - Compile C program in Visual Studio 2005

 
Thread Tools Search this Thread
Old 01-16-2007, 11:48 PM   #1
Default Compile C program in Visual Studio 2005


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 has exited with code 0 (0x0).
The program '[5968] HelloWorld2.exe: Native' has exited with code 0 (0x0).

-------------------------------------------------------------------------


Any suggestions? Please advice. Thanks a million!

Regards,

Nick


Nicholas Zhou
  Reply With Quote
Old 01-17-2007, 12:17 AM   #2
Scooter
 
Posts: n/a
Default Re: Compile C program in Visual Studio 2005
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 has exited with code 0 (0x0).
> The program '[5968] HelloWorld2.exe: Native' has exited with code 0 (0x0).
>
> -------------------------------------------------------------------------
>
>
> Any suggestions? Please advice. Thanks a million!
>
> Regards,
>
> Nick




Scooter
  Reply With Quote
Old 01-17-2007, 12:20 AM   #3
Default User
 
Posts: n/a
Default Re: Compile C program in Visual Studio 2005 - TPA
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
  Reply With Quote
Old 01-17-2007, 01:02 AM   #4
Lane Straatman
 
Posts: n/a
Default Re: Compile C program in Visual Studio 2005

"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
  Reply With Quote
Old 01-17-2007, 01:10 AM   #5
Nelu
 
Posts: n/a
Default Re: Compile C program in Visual Studio 2005
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 has exited with code 0 (0x0).
> 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
  Reply With Quote
Old 01-18-2007, 09:54 AM   #6
madhawi
 
Posts: n/a
Default Re: Compile C program in Visual Studio 2005

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 has exited with code 0 (0x0).
> > 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
  Reply With Quote
Old 01-18-2007, 09:58 AM   #7
santosh
 
Posts: n/a
Default Re: Compile C program in Visual Studio 2005
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
  Reply With Quote
Old 01-18-2007, 01:15 PM   #8
CBFalconer
 
Posts: n/a
Default Re: Compile C program in Visual Studio 2005
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
  Reply With Quote
Old 01-18-2007, 06:02 PM   #9
Yevgen Muntyan
 
Posts: n/a
Default Re: Compile C program in Visual Studio 2005
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
  Reply With Quote
Old 01-19-2007, 12:20 AM   #10
CBFalconer
 
Posts: n/a
Default Re: Compile C program in Visual Studio 2005
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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46