Closed themuntdregger closed 9 years ago
Hmm... that's strange I'm not seeing any errors on gcc 4.9 ? What does it complain about ?
I've also got 4.9 so sounds like something i'm doing wrong. However, for example, if I add extern to the client struct, I get:
||=== Build: server-debug in unoff-landz (compiler: GNU GCC Compiler) ===|
.objs/Server/main.o||In function socket_accept_callback':| main.c|| undefined reference to
clients'|
main.c|| undefined reference to clients'| main.c|| undefined reference to
clients'|
.objs/Server/main.o||In function timeout_cb':| main.c|| undefined reference to
clients'|
.objs/Server/main.o||In function socket_read_callback':| main.c|| undefined reference to
clients'|
.objs/Server/main.o:main.c|| more undefined references to `clients' follow|
||=== Build failed: 6 error(s), 0 warning(s) (0 minute(s), 3 second(s)) ===|
Most likely you've not included all those .c files I've created, that are holding defined structs. In this example clients struct is defined in clients.c
Aha - sorted
thx nemerle
eg : struct attribute_ { int night_vision[MAX_PICKPOINTS]; int day_vision[MAX_PICKPOINTS]; int carry_capacity[MAXPICKPOINTS]; }; extern struct attribute attribute[MAX_RACES];
Causes error under GCC.