Forums > Dev

Compiling code from "Designing Audio Objects"

February 19, 2014 | 5:06 am

I just received a copy of the book "Designing Audio Objects" by Eric Lyon and was trying to compile one of the examples with Visual Studio 2013, but I’m getting the following errors:

Warning 1 warning MSB8012: TargetPath(C:\Data\Visual Studio\Code\MaxMSP Code\Windows Projects\mirror~\.\..\..\sdk-build\mirror~.dll) does not match the Linker’s OutputFile property value (C:\Data\Visual Studio\Code\MaxMSP Code\sdk-build\mirror~.mxe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile). C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets 1186 5 mirror~
Warning 2 warning MSB8012: TargetExt(.dll) does not match the Linker’s OutputFile property value (.mxe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile). C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets 1187 5 mirror~
Error 3 error LNK1104: cannot open file ‘.\mirror~.def’ C:\Data\Visual Studio\Code\MaxMSP Code\Windows Projects\mirror~\LINK mirror~

The first two errors may be due to the directory structure I set up and the way I’ve configured Visual Studio, but I couldn’t find the missing file ‘mirror~.def’ anywhere. I’m not even sure what a ‘def" file is, or whether it’s created when you compile, or it’s supposed to exist beforehand. I haven’t used Visual Studio before, but I believe I installed it correctly (I was able to compile a small stand-alone C program successfully).

Is the code on the CD compatible with this version of Visual Studio? This is the compiler/IDE recommended in the book for Windows systems, but it seems the code in the book was compiled and tested with an earlier version. When I opened the project I got a warning saying that the project uses an earlier version of the C++ compiler and libraries, and that the project would be upgraded to use VS 2013 compiler and libraries. Has anyone been able to compile the code with the latest version of VS?


April 7, 2014 | 9:09 am

I don’t have a Windows system to test this, but I would start fresh with the latest Max/MSP SDK (6.1.4), and first try compiling the audio examples that come with the SDK. Once that works, you can use the new Visual Studio projects as a model to create new projects for the code from my book. (It is expected that projects will regularly become obsolete due to changes in the SDK and/or IDE, unfortunately.) Also, see this update to the book’s code:


September 25, 2014 | 3:50 pm

I have exactly the same issue on Vis Studio 2010 express
The first issue is because target file extension is set to .dll
Go to properties for the project, go to "target extension" under "general" and change .dll to .mxe

the issue with mirror~.def has me puzzled though
Restarting with the latest sdk won’t work for me as I can’t afford max 6 – I’m working through this on max 5

If anyone has any advice that’d be appreciated – otherwise it’s time for a crash course in Vis Studio. Already pining for the ultraminimal approach of bash, Makefile and gcc.
(Another voice added to the "port Max to Linux please!" chorus)

September 25, 2014 | 4:05 pm

ok .def requirement comes from :
Project Properties -> Configuration Properties -> Linker -> Input -> Module Definition File.

remove the reference to the nonexistent {projectname}.def (leave it blank) under "module definition file" and you should be ok. Or at least I was.

It’s not that easy to find this because the mirror~.def doesn’t actually appear anywhere as a text string in the solution (at least not exposed to vis studio’s text search function).
This is what I dislike about learning on IDEs, and particularly Microsoft products (and I earn my a good part of my living coding using Microsoft products) – you have to learn 100 exceptional cases rather than learn a handful of (admittedly less handholding) approaches that you can then apply to solve anything.

  • This reply was modified 3 weeks by  dan b.

September 25, 2014 | 4:31 pm

… only when I open in Max5 I get:
invalid external mirror~, undefined main

I may try with Cygwin and Notepad++ rather than try to learn vis studio’s nooks and crannies. Given that I’m already going to have to fiddle with the provided projects, is there any reason to persist with Vis Studio rather than go with Cygwin – am I making life painful for myself later on?

Viewing 5 posts - 1 through 5 (of 5 total)