I have no problem with compiling my own projects, butsometimes I download a .cpp file from the internet and want to compile it and I can't seem to find a way to use visual c++ to compile the .cpp file. Does anyone know how to make the compiler compile a .cpp file.

thanks for any help

Re: Visual C++ Express Edition compiling a .cpp file



Try to use wx Widgets upgrade for VC++ 2005 express, becouse it don't have MFC grrr. You will need Windows Platform SDK 2003 to install and manual instal some files or buy Visual studio...


Re: Visual C++ Express Edition compiling a .cpp file


Create a "compatible" project type for your cpp, like Win32, Win32 console or CLR. So if you have a cpp which is not Windows specific and which is started from a command console use Win32 console project. For Windows UI apps use Win32 project. Depending on the "completeness" of the cpp, e.g. if it already has a main function or if it is just a cpp with some functions or classes you want to use, you will either add that cpp to your project or your would replace the content of the project wizard generated main cpp file.

A common problem for people is the usage of precompiled headers which is enabled by default. The easies way is to add #include "stdafx.h" as the first line to every cpp file you have in that project.

VC++ Express does not have MFC and ATL so samples which need those libraries won't work. Microsoft gives VC++ Express for free but they want to "push" new programmers to pick up .Net. There are some complaints about this, but well, Express is a free gift...

If you want to build Win32 apps you will need to download the Platform SDK. You will realize that you need the Platform SDK if headers like windows.h are included by your cpp files.