Compiling Dreams Of Demis using Linux(Fedora)

Posted by Niklaren on Tue 15 Jan 2008 02:34 AM — 10 posts, 37,521 views.

#0
I am trying to compile dreams of demise using linux, however I have been getting this error.


gcc -c -g3 -ggdb -Dlinux act_comm.c
In file included from act_comm.c:12:
merc.h:890: error: array type has incomplete element type
In file included from act_comm.c:12:
merc.h:6400: error: array type has incomplete element type
make: *** [act_comm.o] Error 1
[Timothy@localhost src]$


/*
* J.O.P.E - Jobo Online Playerfile Editor
*/
bool jope_load_char args ((CHAR_DATA * ch, char *arg));
void jope_free_char args ((CHAR_DATA * ch));
void jope_interp args ((CHAR_DATA * ch, char *argument));

890>extern const struct jope_type jope_table[];
extern ALIAS_DATA * alias_free;
struct jope_type




void load_immortals ();
extern const char *imm_ranks[];
6400>extern struct immortal_list immlist[999];

any help would be appreciated
USA #1
You need to define what "jope_type" is before you declare an array of jope_type elements.
#2
Thank you so much for your help David, both in this topic as well as my previous topic.

As I am still very new to coding, I was wondering if you could go in to further depth in regards to what to do.

Again I appreciate your help
USA #3
Sure. When you compile code, every type you use (well, really, pretty much everything you use) has to be something the compiler has seen before. If I tell you: here is an object of type "foobar", you will look at me and go "huh? what's a foobar?" The compiler works just the same way.

So, when you define a structure of type "jope_type", that definition has to come before any case where you use that structure. So, the following code is not going to work:

jope_type theStructure;
struct jope_type {
  int member1;
  int member2;
  /* ... */
};

But if you reverse the order, it will work, since the compiler knows what a "jope_type" is when you try to create the object of that type.

Let me know if this clears things up. I suspect you are using a code snippet (given the "Jobo Online Playerfile Editor" name), so one recommendation is to make sure you followed it exactly -- these things tend to be extremely finnicky and even a slight variation (that seems trivial to you) can be enough to break the code.
USA #4
One might also keep in mind that the instructions probably worked just fine before the days of gcc 4 when this situation would not be detected and the code would actually compile properly. Old snippets and codebases cause nightmares like this all the time when nobody sees fit to update them. :)
USA #5
Having never heard of this one, and being somewhat curious, what is this "J.O.P.E - Jobo Online Playerfile Editor" and where might one find a copy of it? (If you don't mind my asking...)
USA #6
Google is your friend. ;-)

http://www.google.com/search?hl=en&safe=off&q=jobo+online+editor+jope&btnG=Search

2nd result:
http://www.dystopiamud.dk/snippets.php

5th snippet.
USA #7
Weird, I'd tried googling it almost exactly like that before I'd posted that and the only hits I found that appeared pertinent were to this thread. :(

Oh well, in any event, thanks for the link, David, now if I can just reach that site... *sigh*
USA #8
The link works for me as of this posting (and when I posted it in the first place). It's possible that the server is a little flaky, though...
USA #9
Nah, problem with my firewall, and it's all fixed. Looks like an interesting snippet, but I think Smaug's loadup command really already covers it. *shrug*