Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 beta is now available for download.
    Dismiss Notice

Setting Compiler Options

Discussion in 'Scripting' started by DarkOmega, Feb 18, 2010.

  1. DarkOmega

    DarkOmega

    Joined:
    Feb 17, 2010
    Posts:
    11
    Hello, I'm new to Unity, so maybe you guys could help me get some issues off of the ground. This is all C#.

    In order to use an existing library I have, I believe I need to modify compiler settings to accomplish two goals:

    -Enabling use of unsafe. At the points where my code uses 'unsafe,' I get the error "Unsafe code requires the 'unsafe' command line option to be specified."

    -Enabling use of System.Linq. Is there a way to do this, or is this not supported? "The type or namespace name 'Linq' does not exist in the namespace 'System'.

    I have tried modifying compile_any.pl, based on what I read elsewhere in the forums. In particular, in the region
    # Run the csharp compiler

    I added '-unsafe' and '-langversion:linq' to @base_args.

    This did nothing. I later got rid of the file compile_any.pl altogether (or rather, renamed it to compile_any2.pl) and it still doesnt make a difference, it compiles just as it used to.

    I have indeed modified and re-saved the files to make sure they are compiling, and it appears that they are. So maybe I'm modifying the wrong file?

    The one I have was found in, with my directory structure:
    C:\Program Files\Unity\Editor\Data\MonoCompiler.framework\compile_any.pl

    If it matters, Unity 2.6.1f3, Pro.

    Thanks!
     
  2. Mat

    Mat

    Joined:
    Dec 4, 2009
    Posts:
    30
  3. pfiguero

    pfiguero

    Joined:
    Jun 12, 2013
    Posts:
    1
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    2,584
    six and a half year too late to the party, but I'm sure two posters that last visited the forum in 2011 appreciates the help.
     
  5. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    573
    Better late then never.
    ¯\_(ツ)_/¯