Results 1 to 8 of 8

Thread: switches in Visual Studio

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    183

    switches in Visual Studio

    Anyone know how to change the compiler switches in visual studio.net? I have been looking as I keep getting this error
    ": Unsafe code may only appear if compiling with /unsafe:

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Here you go, this will get you started:
    http://msdn.microsoft.com/library/de...harpspec_A.asp

    When this loads up, you will get just a general description of unsafe code. To get more detailed about it, click on the sub items on the left hand side. There are 8 different topics under the unsafe heading.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    183
    read through it- I understand what unsafe code is... I just can't figure out how to set compiler switches from inside the visual studio environment to allow the compilation of unsafe code.

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Sorry, I misunderstood your post. I haven't had to do this yet, so I don't have the answer for you. Sorry. Maybe this reply will bump up this thread so others that have done it will reply.

  5. #5
    Hyperactive Member Scott Penner's Avatar
    Join Date
    Dec 2000
    Location
    Mountain View
    Posts
    327

    Lightbulb allow unsafe blocks

    To set the unsafe switch, you will need to look at the project properties. Under the configuration properties\build there is a property allow unsafe code blocks which needs to be set to true to compile unsafe code.
    -scott
    he he he

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    183
    hummm I hunted around for any of those terms... am I looking in the right window? I don't even see those headers in the menu bar.....
    Attached Images Attached Images  

  7. #7
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403
    Right click on your project (looks like you clicked on the solution) in the Project Explorer and choose "properties."
    You should see this. Make sure you choose "For All Configurations" otherwise it will only work on Debug or Release.
    Attached Images Attached Images  
    Last edited by sunburnt; Oct 5th, 2002 at 11:39 AM.
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    183
    awesome thanks I have been hunting for that for some time now!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width