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. C / C++ / MFC
  4. #pragma once

#pragma once

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiolinux
2 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.
  • D Offline
    D Offline
    Dean Goodman
    wrote on last edited by
    #1

    I've noticed in VS.NET 2003 when you use the app-wizard to generate a new C++ class, the header of the new class begins with #pragma once rather than and #ifndef, #define pair. Anyone know if there is a way to make it go back to using the #ifndef instead? #pragma once is fine for VS.NET, but when I want to port code to Linux, GCC always complains that it is obsolete.

    B 1 Reply Last reply
    0
    • D Dean Goodman

      I've noticed in VS.NET 2003 when you use the app-wizard to generate a new C++ class, the header of the new class begins with #pragma once rather than and #ifndef, #define pair. Anyone know if there is a way to make it go back to using the #ifndef instead? #pragma once is fine for VS.NET, but when I want to port code to Linux, GCC always complains that it is obsolete.

      B Offline
      B Offline
      bneacetp
      wrote on last edited by
      #2

      To my knowledge, there is no way to make the wizards in VC++.NET 2003 use the #ifndef, #define, #endif inclusion guards instead of #pragma once which is pain. I have had issues with this myself when porting code to Linux. If someone out there knows of a way to do it, I wouldn't mind knowing how to do that myself. :) Happy Programming! WWW::CodeProject::BNEACETP

      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