Alex
Still Fresh
Hello!
I've decided to structure my program a little so I created several *.c files that contain my programs function in a sorted way.
Because I needed some global variables I created a *.h file, which is included in all *.c files to make this global variables accessible for all functions. To prevent redefintions i used
That did it for compiling but when it comes to linking the different object files i get
"multiple definition of `i'" style error messages.
I wonder if it's possible to use the same header file in different *.c files. What makes me wonder is that gcc reports that linking error, when VC++ with the GP32 SDK compiles and links without errors and warnings.
I hope somebody can help me...Thx in advance.
Im using the devkitadv package and a slightly modified makefile of the example included.
h34r:
I've decided to structure my program a little so I created several *.c files that contain my programs function in a sorted way.
Because I needed some global variables I created a *.h file, which is included in all *.c files to make this global variables accessible for all functions. To prevent redefintions i used
Code:
#ifndef ___example___
#define ___example___
.
.
.
#endif
That did it for compiling but when it comes to linking the different object files i get
"multiple definition of `i'" style error messages.
I wonder if it's possible to use the same header file in different *.c files. What makes me wonder is that gcc reports that linking error, when VC++ with the GP32 SDK compiles and links without errors and warnings.
I hope somebody can help me...Thx in advance.
Im using the devkitadv package and a slightly modified makefile of the example included.
h34r: