Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

hello_there

include problem

This topic is 5572 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have two files that include gl.h and those files are included in main but i get and error saying redefinition on variables. eg error C2086: ''int APIENTRY'' : redefinition it says that heaps of times how do you stop this from happening. it works in my other programe but not in this one.

Share this post


Link to post
Share on other sites
Advertisement


main.c

#include "main.h"

int whatever;


-----------

main.h

#ifndef _MAIN_H
#define _MAIN_H

extern int whatever;


#endif
------------

other.c

include "main.h"


Share this post


Link to post
Share on other sites
yeah i know but it's more like this. i don't have a main.h just a file that has the variable and function definitions.

main.c

#ifndef _MAIN_C
#define _MAIN_C

#include "file.h"
#include "file2.h"

#endif

-----------------

file.h

#ifndef _FILE_H
#define _FILE_H

#include <gl/gl.h>

#endif

-----------------

file2.h

#ifndef _FILE2_H
#define _FILE2_H

#include <gl/gl.h>

#endif

[edited by - hello_there on March 18, 2003 4:21:49 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!