locked
Compiling .c with Visual Express C++

    Question

  • Version: 9.0

    I am new to C and C++. I am taking a C class which requires us to write, compile and execute our program on a terminal server. 

    I want to start writing and testing on my home pc and then transfering to the term server but I can't figure out how to compile the code. Documentation doesn't seem to help.

    Thanks.
    Wednesday, March 26, 2008 4:14 PM

Answers

  • Hi,

     

    To compile C/C++ code, you should firstly get a C/C++ compiler. Visual C++ 2008 Express Edition is a good choice. And from your above description, it seems you have installed it.

     

    With Visual C++ 2008 Express Edition installed, you can compile your code through cl command line or IDE. For beginners, I suggest you use the IDE.

     

    To compile C/C++ code with Visual C++ IDE, you should create a project, add your code files to the project, and then you can build your project through IDE menus or Toolbars.

     

    On how to use Visual C++ IDE, you can refer to

    http://msdn2.microsoft.com/en-us/library/ms235632(VS.80).aspx

     

    Depending on your application type, the compiler generates an execution file (.exe), dynamically link library (.dll), or static library (.lib). To make the generated execution file run on the terminal server, you can either use static C/C++ runtime library (set “Properties->C/C++->Code Generation->Runtime Library” to “/MT” or “/MTd) or build the retail version of your application(/MD) and install the Visual C++ runtime redistributable package on the terminal server.

     

    You can download the Visual C++ runtime redistributable package at

    http://www.microsoft.com/Downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en

     

    You can get detail information of VC++ application deployment at

    http://msdn2.microsoft.com/en-us/library/zebw5zk9.aspx

     

    Hope this helps!

     

    Tuesday, April 01, 2008 9:07 AM

All replies

  • Hi

     

    Step 1:  Ask this question in the appropriate forum:  http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=161&SiteID=1

     

    Step 2:  Good Luck!

     

    Chris

    Wednesday, March 26, 2008 4:47 PM
  •  Chris Dunaway wrote:

    Hi

     

    Step 1:  Ask this question in the appropriate forum:  http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=161&SiteID=1

     

    Step 2:  Good Luck!

     

    Chris



    Are you serious? Steps to solving the problem?

    Please select a more appropriate message below that adds a couple of years to age and replace above:

    Choice A: I think you need to be here - http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=161&SiteID=1

    Choice B: Hey I see your new to the forums with 0 posts.  I think your question will be better answered here - http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=161&SiteID=1

    Good luck was not even a good addition to the statement let alone a step. Especially when you didn't even offer to solve the issue.

    Have a good day Chris!
    Wednesday, March 26, 2008 6:50 PM
  • I apologize if my response seemed rude.  It was not meant to be.  It was more an attempt at levity which apparently failed.

     

    The reason that I didn't attempt to offer a solution is because I don't know C++, nor do the majority of the posters here.  I provided a link to the proper forum because clearly this forum is not the correct one as is evident from its title:  "Microsoft Visual Basic Express Edition".

     

    Regards,

     

    Chris

    Wednesday, March 26, 2008 8:37 PM
  • I apologize also, it has been a long effort to get somebody to explain how to compile code that requires compiling to someone who has programmed in PHP where no compilation is required. 

    Have a good day.
    Wednesday, March 26, 2008 8:47 PM
  • Hi,

     

    To compile C/C++ code, you should firstly get a C/C++ compiler. Visual C++ 2008 Express Edition is a good choice. And from your above description, it seems you have installed it.

     

    With Visual C++ 2008 Express Edition installed, you can compile your code through cl command line or IDE. For beginners, I suggest you use the IDE.

     

    To compile C/C++ code with Visual C++ IDE, you should create a project, add your code files to the project, and then you can build your project through IDE menus or Toolbars.

     

    On how to use Visual C++ IDE, you can refer to

    http://msdn2.microsoft.com/en-us/library/ms235632(VS.80).aspx

     

    Depending on your application type, the compiler generates an execution file (.exe), dynamically link library (.dll), or static library (.lib). To make the generated execution file run on the terminal server, you can either use static C/C++ runtime library (set “Properties->C/C++->Code Generation->Runtime Library” to “/MT” or “/MTd) or build the retail version of your application(/MD) and install the Visual C++ runtime redistributable package on the terminal server.

     

    You can download the Visual C++ runtime redistributable package at

    http://www.microsoft.com/Downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en

     

    You can get detail information of VC++ application deployment at

    http://msdn2.microsoft.com/en-us/library/zebw5zk9.aspx

     

    Hope this helps!

     

    Tuesday, April 01, 2008 9:07 AM
  • Thank you very much. Firstly for the link to the help site and second for the good info. I think my biggest thing is not throwing it into a project first.  I will try this and see if I can make it work now.

    Also, I am wanting to run this on my local machine rather than a terminal server. I don't need to do anything special, right? Well I guess it depends on how the C is implemented? I don't know how the platform dependencies are in C/C++
    Tuesday, April 01, 2008 1:11 PM