Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. Proprocessor Definitions don't work?

Proprocessor Definitions don't work?

Scheduled Pinned Locked Moved Visual Studio
csharphelptutorialquestionlearning
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Erik Juhl
    wrote on last edited by
    #1

    I'm having a problem with preprocessor definitions in .net 2k3. Basically, if I add my custom define through the project settings dialog it doesn't seem to be noticed in code with a simple #ifdef check. Of course, if I do a #define in code then my #ifdef checks ok. This used to work fine through the vs6 project settings, so what happened to .net 2k3? Anyone know what changed or how to make this work?

    M 1 Reply Last reply
    0
    • E Erik Juhl

      I'm having a problem with preprocessor definitions in .net 2k3. Basically, if I add my custom define through the project settings dialog it doesn't seem to be noticed in code with a simple #ifdef check. Of course, if I do a #define in code then my #ifdef checks ok. This used to work fine through the vs6 project settings, so what happened to .net 2k3? Anyone know what changed or how to make this work?

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      That's very odd. Are you sure you're editing the options for the right configuration? I think if you've specified the /u (Undefine all predefined symbols) [case-sensitive, /U undefines a single symbol] switch, that overrides any definitions made on the command line with /D. If you check the build log that the compiler generates, that should show what options were passed to the compiler.

      E 1 Reply Last reply
      0
      • M Mike Dimmick

        That's very odd. Are you sure you're editing the options for the right configuration? I think if you've specified the /u (Undefine all predefined symbols) [case-sensitive, /U undefines a single symbol] switch, that overrides any definitions made on the command line with /D. If you check the build log that the compiler generates, that should show what options were passed to the compiler.

        E Offline
        E Offline
        Erik Juhl
        wrote on last edited by
        #3

        I don't have /u set and I definately didn't /U the one I am trying to add. All four default defines are present, but mine is not. This works for new projects, but seemingly not for VS6 projects that were converted to VS .NET. There must be a way somewhere to correct this! MS backwards compatability is a joke.

        E 1 Reply Last reply
        0
        • E Erik Juhl

          I don't have /u set and I definately didn't /U the one I am trying to add. All four default defines are present, but mine is not. This works for new projects, but seemingly not for VS6 projects that were converted to VS .NET. There must be a way somewhere to correct this! MS backwards compatability is a joke.

          E Offline
          E Offline
          Erik Juhl
          wrote on last edited by
          #4

          I finally found the problem in case anyone was or will be interested. It seems that individual files under the project can be set not to inherit from the project properties. For some reason, when I convert my VS6 projects to VS.NET, all cpp files got set to NOT inherit from the project. Go figure.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups