Smilediver
Smilediver

Reputation: 1818

How to compile different extension files as C++ in Visual Studio C++ 2010?

In my Visual Studio 2010 project I have files with .mm file extension, that need to be compiled as normal C++ files. Is there a way to make a build rule for new extensions or something like that? In VS 2008 there were options for that, but they are gone in 2010.

Upvotes: 1

Views: 3335

Answers (3)

Marcin Skoczylas
Marcin Skoczylas

Reputation: 19

  • in vs2008 you can set in project properties (simply select extensions that should be treated as C++ via menu)
  • in vs2010 and vs2012 I've never been able to configure this properly, I tried all these walkthroughs, tutorials and tricks. They simply do not work as expected and my *.mm files are not compiled.

Upvotes: 0

KTC
KTC

Reputation: 9003

For an individual file: Right click on the file > Properties > Configuration Properties - General > Item Type : C/C++ compiler.

In general for a project: How to: Select the Files to Build, Walkthrough: Using MSBuild, Walkthrough: Creating an MSBuild Project File from Scratch.

Upvotes: 5

Brian R. Bondy
Brian R. Bondy

Reputation: 347416

You can set how the file will be compiled for any unknown file type by:

  1. Right click on the file in your solution explorer
  2. Click on properties on the file
  3. Go to the General tab
  4. Set exclude from build to: No
  5. Set Item type: to C/C++ compiler

Upvotes: 3

Related Questions