Skip to main content
GameDev.net gamedev.net
🔒 Locked

lame question about #include dependecies

Started by _WeirdCat_ Dec 29, 2016 at 1:33 AM 2 replies 2k views
Original Post
_WeirdCat_
_WeirdCat_

lets say i have 3 headers


one

header1.h
#ifndef header1H
#define header1H

#define ALOHA 1

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

#endif


second

header2.h
#ifndef header2H
#define header2H

#include "header1.h"

some random code
#endif


and third last file header3.h
#ifndef header3H
#define header3H

#include "header2.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]

https://forums.embarcadero.com/thread.jspa?threadID=245303&stqc=true

[/spoiler]

_the_phantom_
_the_phantom_
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.
fleabay
fleabay
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.
🙂🙂🙂🙂🙂<←The tone posse, ready for action.

Topic Locked

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

Sign in to reply to this topic.