Results 1 to 4 of 4

Thread: Plain old C in .Net

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    258

    Plain old C in .Net

    Sorry about posting this here, couldn't find anywhere more appropriate.

    I'm just getting familiar with .net and c#, but now I want to create, compile and run a simple C program from the .Net IDE.

    I have created a Win32 Empty App and have entered the test code:

    #include <stdio.h>
    int main()
    {
    printf("Hello World\n");
    return 0;
    }

    ... and built it fine, but it does not create the .exe for me to run it.

    Can anyone offer some help with this? Or better still, point me to a site that actually shows you have to build a C project from .Net IDE, I'm fumbling my way through it at the minute.

    Thanks in advance.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Plain old C in .Net

    VS.NET 03?

    To build a C app (as opposed to C++) go into Project -> Properties -> Configuration Properties -> C/C++ -> Advanced and for "Compile As" choose "Compile as C code (/TC)".

    It will build in you /Debug or /Release directories depending on which build configuration is active.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    258

    Re: Plain old C in .Net

    Yes, VS.NET 2003.

    With this project, Win32 > Application Settings > Empty Project

    I don't have the C/C++ menu under Config Properties. :S

    If I create a Win32 default project (Not empty) and switch to compile c, it brings up a host of errors due to the printf source.

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Plain old C in .Net

    are you sure you're doing that exactly as said? cuz thats what I always do to make C project. Are you sure your file's extension is .C ?

    do you want to test the file I attached?
    Attached Files Attached Files
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width