# lame question about #include dependecies

## Recommended Posts

lets say i have 3 headers

one

#define ALOHA 1

inline int sum() { return 2+2; }

#endif

second

some random code
#endif

and third last file header3.h

some random code
#endif

now my question is while in header3.h

can i access

these two defined in header1.h? (where i header3.h i included only header2.h which includes header1.h)


#define ALOHA 1

inline int sum() { return 2+2; }

i need to know that coz i have a tough time to resolve unresolved external __glewDeleteProgram.

[spoiler]

[/spoiler]

Edited by WiredCat

##### Share on other sites
Yes, you can access them just fine.

Your problem is not an include problem, but a linker one.

You have failed to link the object file which contains the definition of the variable you wish to use - you have only told the compiler 'this value will exist'.

Also, the problem you link to is NOT the same as the problem you are describing - the linked to problem has the key word 'extern' in it which changes things significantly from the given example here.

##### Share on other sites
My Google Fu says it could be because your using the libs under 'Release MX' instead of 'Release'

And of course, if your not building static, you have to put the dll somewhere the executable can find it. Edited by fleabay

##### Share on other sites

yeah it might be also compilation order thing need to check that though

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• ### Forum Statistics

• Total Topics
628688
• Total Posts
2984243

• 16
• 13
• 13
• 10
• 10