News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

symevent.cc : undefined references

Started by eldorico, July 20, 2013, 05:12:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

eldorico

Hi every one!


I have problems in linking libraries; using codeblocks - gcc, it compiles fine but then I got some errors with:


Quote
/aburch-simutrans-71a395c/simevent.cc|63|undefined reference to `sys_event'


in line ~63 of simevent.cc: ev->mx = sys_event.mx;


When I search the declaration of sys_event, I have to choices: "sys_event sys_event" or "class sys_event {...}".
I fall into the simsys.h:


Quote
struct sys_event
{
   unsigned long type;
   unsigned long code;
   int mx;                  /* es sind negative Koodinaten mgl */
   int my;
   int mb;
   unsigned int key_mod; /* key mod, like ALT, STRG, SHIFT */
};


extern struct sys_event sys_event;


What is going on? What should I do?
I thought I had to link external libraries only, but here the gcc wants me to link some simutrans libraries? (I work with the simsys_s.cc)


I'm such a beginner, but I love trying compiling simutrans in this way. The problem I have is it relied to simutrans? Or my beginner status compiling c  ?  :P
I have many undefined references related to the simutrans code. So I think I miss something big  :-X


Could you help me?


Thanks,
Eldorico

Ters

Simutrans is a complex program evolved over many years. There are several files of which you have to include one and only one in the build, depending on which platform you target. My guide for figuring out which files is to read the makefile.

eldorico

Thanks a lot Ters.
Regarding to the makefile, I used the wrong files.  ;)

You taught me a lot this week, really.   ;D
Keeping all your advises, I'll try compiling next week, and I'll be updating my posts.


Thank you very much, I've always willed to learn things this way, and the simutrans community helped a lot.


Best regards to all ^^