example "uires" on the sdk

    Nov 24 2013 | 3:24 pm
    Hi all,
    The example "uires" provided with the sdk 6.1.4 does not compile with Xcode5: I get the following error:
    error: first parameter of 'main' (argument count) must be of type 'int' int C74_EXPORT main(void *moduleRef)
    This issue is similar to one mentioned in an old post (https://cycling74.com/forums/help-with-svg-image/). However, I don't get a warning but an error here. Any clues about how to get rid of this?
    Thanks in advance,

    • Nov 25 2013 | 1:47 pm
      Xcode 5.0 comes with LLVM 5.0 which doesn't let you have a different main signature. You'll have to find your resources manually. With something like CFBundle utilities.
    • Nov 25 2013 | 2:08 pm
      Thanks Emmanuel.
      Your solution works however only for mac, not for windows. Ok, I'll dive into it.
    • Nov 25 2013 | 4:09 pm
      You won't have the same problem on windows. It's only xcode 5.0's llvm compiler which is being picky.
    • Nov 30 2013 | 11:04 pm
      Hi Emmanuel and all,
      Since I didn't want to have two separate sources for windows and mac, I searched a bit and found (hopefully) a way to compile again with the old LLVM-GCC4.2 on Xcode 5. It was a little bit tricky, I summarize the steps below for those who may be interested, until Max'SDK is updated:
      1/ install LLVM-GCC4.2: I did that using macports, since the Fink and Homebrew do not seem to allow to build it in universal i386/x86_64 (and the homebrew version is somehow suspicious). I used the following command:
      $ port install apple-gcc42 +universal +gpl3
      This should install the compiler at /opt/local/bin/llvm-gcc-4.2
      2/ allow Xcode 5 to compile with it. For this you have to install a plugin. I did the hard work, the plugin is attached to this post, you have to decompress it and put it into "/Applications/Xcode.app/Contents/Plugins/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/". Not sure if it's 100% clean (I took an example on the web and modified it according to my needs), but it seems to work.
      3/ In the build settings of the xcode project of the external (here "uires.xcodeproj"): a/ "Compiler for C/C++/Objective-C" should be set to the new entry "LLVM-GCC 4.2" b/ "Path to Linker Dependency Info File" should be unset (otherwise you get an error about ld not understanding "-dependency_info").
      And here it goes, at least on my machine.