Skip to main content
gamedev.net
🔒 Locked

C - Compiler Error

Started by I_Smell_Tuna 2 replies 450+ views
Original Post
I_Smell_Tuna
I_Smell_Tuna
I'm coding in C using the Code::Blocks IDE, and the GCC compiler. I have a header file that has some functions in it, and whenever I include it in more than one of my code files in a project it give me a linker error such as this one. .objs\network.o:network.c:(.text+0x0): multiple definition of `nameoffunction' It says that for every function that is in the header file. Any idea why my program won't link?
nullsquared
nullsquared
Or, in all your headers do: (I'm not the type that would read all of that [grin], no offence)
#ifndef HEADERNAME_H#define HEADERNAME_H// INCLUDES// CODE#endif
I_Smell_Tuna
I_Smell_Tuna
Excellent.

Sneftel++ for the article.
agi_shi++ for the nice summary.

Topic Locked

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

Sign in to reply to this topic.