🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Newbie needs help with variables

Started by
1 comment, last by GameDev.net 24 years, 7 months ago
If I understand what you are saying, then all you need to do is when you are declaring the variable in the H file, just declare
extern bool BIT555 instead of
bool BIT555

Hope that works!

------------------
http://qoy.tripod.com

Advertisement
Hi everybody !!!
My problem is:
I'm starting to do things in DirectX 7 and VC++ 6.0 and I was doing things about the 16 bits video problem (555, 565, RGB, GRB...) and I saw a function with macros on a post and based on that code I programmed the mine. What is getting me crazy is that I want to put in separate files and the macros on the .h file that I use on the code (where the functions to manange the video are) file and the run (where the GAME CODE only is) file. Those macros utilize a variable named BIT555 that is boolean type and define if its 555 or 565. If I put the declaration of the variable (that is utilized by a function named 16BITS()[on the code file], this one returns if its 555 or 565 on the BIT555 var and a structure that is utilized on the macros either, to see if its RGB or BGR...)
on the .h file an error ocurs "redeclaration of var on the run file..." when linking, if I put it on the code file "var not declared..." when compiling the .h file. If I move the macros to the code file "undeclared identifier..." when compiling the run file (that use the macros to get right rgb value and put then too)
I don't know what to do. Can anyone tells me , please ?
Sorry about my english, I'm brazilian...

Thanks

Hei thanks Qoy !!!
It worked...
My code compiled and linked ( it weren't doing this !) but didin't run (I did so many functions at the same time and because of that problem I couldn't TEST them) I will continue to fix the run-time problems, thanks again !!!
Nepheus

This topic is closed to new replies.

Advertisement