Skip to main content
gamedev.net
🔒 Locked

Includes

Started by hello_there May 29, 2002 at 8:45 PM 4 replies 200+ views
Original Post
hello_there
hello_there
is there any way to make a file that any file can use and not have to include it? that makes no sence i know but someone might anderstand if so please help!!!
____________How could hell be worse?
Cherez
Cherez
Why not just include it?
Neodraco
Neodraco
Yeah, that really does not make sense.

Could you explain a little more?
hello_there
hello_there
i mean a file that you say include in the main file but every other file can use it even if they don''t include the main function. i want to include it twice but you get linking errors.
____________How could hell be worse?
Neophyte
Neophyte
Use ifndef define and endif in your headers, like this:

  
#ifdnef SOMETHING_HERE
#define SOMETHING_HERE

// Here goes all your header-contents


#endif


-Neophyte

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GED d- s:+ a- C++$ UL++ P++ L++ E W+ N+ o K? w !O M--(+) V-- PS+
PE Y+ PGP t-- 5++ X+ R(+) rv+(++) b+++ DI+ D(+) G e+>++ h r--> y+
----- END GEEK CODE BLOCK-----
geekcode.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.