1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: C in visual studio

Discussion in 'Software Development' started by php guy, Oct 13, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. php guy

    php guy Thread Starter

    Joined:
    Dec 17, 2004
    Messages:
    606
    So I installed visual studio 2005 on my desktop and have been able to create and compile C programs just fine. I recently put it on my laptop and installed the SPs. I create a win32 Console Application and make it a blank project, same as I do on my desktop.

    Only problem is, when I go to add a new item then use a .c extension (again, same as my pc), I get this error that says "You are adding a CLR component to a native project. Your project will be converted to have Common Language Runtime support. Do you wish to continue?" If I hit yes, it creates a .cpp and .h file instead of a .c file. So what am I doing wrong here? :confused:

    Thanks
     
  2. mt2002

    mt2002

    Joined:
    Sep 14, 2005
    Messages:
    919
    How exactally are you adding the new .c file?
     
  3. php guy

    php guy Thread Starter

    Joined:
    Dec 17, 2004
    Messages:
    606
    Right clicking Source Files in the Solution Explorer, add > new item, then typing out whatever.c

    Is there a better way?
     
  4. pvc_

    pvc_

    Joined:
    Feb 17, 2008
    Messages:
    490
    can't you just create a console cpp file, and then rename it? if it converts it to a .net class, just goto the application dependencies and remove the .net namespaces. Although, it sounds really odd that it does that.
     
  5. shannon08

    shannon08

    Joined:
    Jul 30, 2008
    Messages:
    355
    Hey, thanx for sharing actually I wanted to add my laptop, your tips helps a lot to add.
     
  6. IMM

    IMM

    Joined:
    Feb 1, 2002
    Messages:
    3,257
  7. mt2002

    mt2002

    Joined:
    Sep 14, 2005
    Messages:
    919
    Rather then creating a win32 Console Application, try just creating a "blank project":

    1. Go to File->New project;
    2. On the left pane under project types, go to Visual C++ -> General. The right pane should update.
    3. On the right pane, select Empty project. Type in your new project name (And select create new directory for solution if you want it), and hit Ok to create the project.

    Try to add your C files after doing this and let us know what happens.

    I know my version of Visual C++ comes with CLR templates that, if selected, will enable CLR for your project--which doesnt seem to be what you want. Creating a blank project will only have basic default settings applied to your project and adds no additional files.

    You can create any type of project--Win32 console, Win32 application, driver, et al... from an empty project so you are not limited.
     
  8. php guy

    php guy Thread Starter

    Joined:
    Dec 17, 2004
    Messages:
    606
    Thanks for the replies.

    I got it to work by just adding a c++ file from the start then changing the extension after it was added.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/758909

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice