Compiling code from "Designing Audio Objects"

    Feb 19 2014 | 1:06 pm
    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?

    • Apr 07 2014 | 4:09 pm
      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:
    • Sep 25 2014 | 10:50 pm
      ** Ignore this - see my post later in the thread with a full fix for my issues **
      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)
    • Sep 25 2014 | 11: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.
      Ignore this, see my post below beginnig *FIX FOUND*
    • Sep 25 2014 | 11:31 pm
      Ignore - fix below
      ... 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?
    • Oct 31 2014 | 1:13 pm
      * FIX FOUND *
      Ignore my posts above. I came back to this with fresh eyes after working on other things for a while. The changes required to make the Lyons projects work for me on Windows under Visual Studio 2010 were as follow:
      1) The first issue is that the target file extension for the project is set to .dll, which is incorrect FIX: Go to properties for the project, go to General>target extension and change ".dll" to ".mxe"
      2) The project requires a .def file to tell it which parts of the code to export. A .def file is defined in the project (.def) but the defined file does not exist. FIX: Add a file (eg. depending on project name) mirror~.def to the project (in the Solution Explorer pane right click the emboldened "mirror~" beneath "Solution 'mirror~' and click "add". Select "C++ file" and type name as (eg.) mirror~.def (suffix will override .cpp)). Open this file, and add the following code (again changing "mirror~" to relevant project name)
      LIBRARY mirror~.mxe
    • Feb 21 2016 | 12:06 am
      Greetings people. I am facing for some time now an issue concerning a code I am formulating in VS 2013. I try to build my code in order to get a dll file, which I can later use to a simulation programm to get some results. The point is that the build isn't successful and an error apperas, which I don't know how to eliminate. That's why I need your help. The situation is as follows. Several messages appear, all of the same origin, one of which says the following:
      1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(1186,5): error MSB4018: The "VCMessage" task failed unexpectedly.
      Can you tell me how to fix this? I can't continue with my work, because I have stuck with this. Thank you in advance.
      I see that it has to do somehow with what you people are referring in this post, so I thought to put the post right after your answers.
    • Feb 22 2016 | 3:17 am
      no problem for compiling c but i've an another problem for change the extension .exe by .mxe; "simplemax.o" and "simplemax.def" are the linker input. The .def file is necessary to ensure that the function main will be exported.
      "-L../../c74support/max-includes" specifies an additional directory where library files will be found.
      "-lMaxAPI" means link to the MaxAPI.lib linker library for MaxAPI.dll
      cygwin is perhaps better than visual studio, i think this version of max is transitional for the extension but you can compile your object in 64 bit.
    • Feb 29 2016 | 11:38 pm
      Name="Release|x64" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops;..\..\..\c74support\max- includes\max_extern_common.vsprops;..\..\..\c74support\max-includes\max_extern_x64.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="2" WholeProgramOptimization="1" > Name="VCPreBuildEventTool" /> Name="VCCustomBuildTool" /> Name="VCXMLDataGeneratorTool" /> Name="VCWebServiceProxyGeneratorTool" /> Name="VCMIDLTool" PreprocessorDefinitions="NDEBUG" MkTypLibCompatible="true" SuppressStartupBanner="true" TargetEnvironment="3" GenerateTypeLibrary="false" TypeLibraryName="" HeaderFileName="" DLLDataFileName="" /> Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="2" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" OmitFramePointers="true" WholeProgramOptimization="true" AdditionalIncludeDirectories="$(C74SUPPORT)\max-includes,$(C74SUPPORT)\msp-includes" PreprocessorDefinitions="WIN_VERSION;WIN32;NDEBUG;_WINDOWS;_USRDLL;WIN_EXT_VERSION;" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="2" BufferSecurityCheck="false" EnableFunctionLevelLinking="false" EnableEnhancedInstructionSet="2" UsePrecompiledHeader="0" PrecompiledHeaderFile="$(IntDir)$(ProjectName).pch" AssemblerListingLocation="$(IntDir)$(TargetName).asm" ObjectFile="$(IntDir)" ProgramDataBaseFileName="$(IntDir)$(ProjectName).pdb" WarningLevel="3" SuppressStartupBanner="true" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" CompileAs="1" />
    • Mar 01 2016 | 5:09 pm
      Sorry to jump in here. There has been weird stuff going on with the formatting in the forums, which I've been working to address.
      If anything looks off to you guys, do let me know.
      Carry on!
    • Mar 10 2016 | 4:53 am
      no good, no good....
    • Mar 10 2016 | 8:15 am
      firstly have you tried the steps I described above? (6th post in thread) They worked for me on VS2010 at least.
      I've completely stopped using VS for C now. I just use Cygwin. Less pretty interface but it doesn't try to hide all the options from you.
    • Mar 10 2016 | 1:34 pm
      i've made a script with js but i use vs 2013 but i see more late, #define, c++ method contains and assembly-language. bye.
    • Mar 18 2016 | 9:00 am
      Hi all! does anybody been able to compile without errors with Mingw64 or Cygwin64? When i try to compile the sdk examples with Mingw64 i have a segmentation fault at runtime. many thanks a.
      ps...Cycling '74 SDK does not support Mingw 64 bit tho....too bad :-(
    • Mar 20 2016 | 10:00 pm
      i've installed cygwin and the compiler gcc is missing... i use vs express, now community...
    • Jun 18 2016 | 11:50 pm
      i use vs express 2013 for desktop (activate via you account Microsoft...) with sdk 7 for max 6, it enable easily. you don't have need to compile projects because on the cd, you found all informations : compilation, source, clic and open directly the corresponding maxpat (32 bit version installed) and it's allright. finally, for max, i prefer use native object from max. take an other object from the sdk with a similar template release, change data like he describe in the book, clic on generate the solution and job well done. for use 64 bits version it's explain at the end's pdf sdk.
    • Jun 19 2016 | 12:26 am
      there are x64 template in the sdk...