Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 3 results for
2dgraphics
- Page 1
Re: Using define's to turn on/off functionality
Programming
Software Development
15 Years Ago
by Duoas
That is typically something handled by the build process. If you want to have the #defines in every file, you can specify the flag, or not, in your Makefile(s). Here's an example makefile that builds a program "foo" from the following files: foo.cpp baz.h baz.cpp quux.h quux.cpp If compiling on Windows, it will automatically…
Re: Using define's to turn on/off functionality
Programming
Software Development
15 Years Ago
by daviddoria
ah great! so g++ -DGRAPHICS is the same as having all the files being compiled having a #define GRAPHICS 1 ? so then I could even use if(GRAPHICS) instead of #ifdef GRAPHICS ? Thanks, Dave
Re: Using define's to turn on/off functionality
Programming
Software Development
15 Years Ago
by Duoas
No, it is the same as all the files having a [inlinecode]#define GRAPHICS[/inlinecode] To have a value: [inlinecode]g++ -DGRAPHICS=1[/inlinecode] --> [inlinecode]#define GRAPHICS 1[/inlinecode] [inlinecode]if (GRAPHICS)[/inlinecode] will work if and [i]only[/i] if GRAPHICS is [i]always[/i] defined to have some value (such as 0 or 1). That …
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC