Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

VC# compile problem


  • Please log in to reply
6 replies to this topic

#1 BobLewiston

BobLewiston

  • Members
  • 69 posts
  • OFFLINE
  •  
  • Local time:09:30 PM

Posted 16 November 2008 - 06:51 PM

I installed VC# 2008 Express. Following the lessons at C# School at programmersheaven.com, I tried to compile the sample app HelloWorld from the command prompt via:

csc HelloWorld.cs

but I got back:

'csc' is not recognized as an internal or external command, operable program or batch file.

As far as I know, the VC# install is OK. When I did the install, it said it was also installing .Net 3.5, SQL and a lot of other stuff, so I assume it also installed the actual compiler(s). When I click on the desktop icon, the IDE comes up without any error messages.

I didn't try to compile from the IDE though, because it looked a bit more involved, so I thought I'd follow the lessons in order.

Any idea where I went wrong?

P.S. I'm running under Windows XP Professional, Service Pack 2.

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:30 PM

Posted 16 November 2008 - 07:57 PM

Could you post the code?

#3 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:06:30 PM

Posted 16 November 2008 - 08:10 PM

You need to add the compiler directory to your system's PATH or reference the full path of the compiler.


Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:30 PM

Posted 16 November 2008 - 10:15 PM

If he is using Visual Studio, he shouldn't have to add anything. It should have added itself.

(Doh.. never mind. I just read that he didn't the IDE...you're right Billy)

Use the IDE. It is essentially just a text editor, and it will catch any typos that you wouldn't other wise catch.

There is a video tutorial here that may help you with the IDE:
Video

EDIT: You will need a Windows Live Login, but it is free.

#5 BobLewiston

BobLewiston
  • Topic Starter

  • Members
  • 69 posts
  • OFFLINE
  •  
  • Local time:09:30 PM

Posted 16 November 2008 - 10:42 PM

Billy:

Sounds reasonable but I'm not sure of the path since I can't find the C# compiler in either C:\Program Files\Microsoft Visual Studio 9.0\VC# or
C:\Program Files\Microsoft Visual Studio 9.0\Microsoft Visual C# 2008 Express Edition with SP1 - ENU (not that I know the compiler's name). Does ANYBODY know the Visual C# 2008 Express compiler's name and/or path?

groovicus:

I'm sure I'll use the IDE pretty much exclusively, but since I don't know if the author of "C# School" had some purpose down the road in mind when he demanded the use of the command prompt, I'd like to see if I can't make that work.

#6 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:06:30 PM

Posted 16 November 2008 - 10:43 PM

I've done plenty of stuff in C and Visual Basic (Both part of Visual Studio).

I've never used the command line compiler ;)

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#7 BobLewiston

BobLewiston
  • Topic Starter

  • Members
  • 69 posts
  • OFFLINE
  •  
  • Local time:09:30 PM

Posted 16 November 2008 - 10:56 PM

Never mind. Of course: it's called "csc.exe".




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users