The Mud Connector

Author Topic: compiler issues  (Read 3284 times)

Daemonus

  • New to TMC
  • *
  • Posts: 39
    • View Profile
    • Twist of FaTE MUDS
compiler issues
« on: January 03, 2018, 1:43 PM »
So here we go. Last I ran this code was clear back in 2006. I go to boot it up. And for the LIFE of me cannot figure out why it is giving me this:

Code: [Select]
gcc -c -ggdb -Wall -O   act_comm.c
In file included from act_comm.c:34:0:
lookup.h:22:50: warning: 'struct flag_type' declared inside parameter list [enabled by default]
 int flag_lookup args( (const char *,const struct flag_type *)
                                                  ^
merc.h:17:25: note: in definition of macro 'args'
 #define args( list )    list
                         ^
lookup.h:22:50: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
 int flag_lookup args( (const char *,const struct flag_type *)
                                                  ^
merc.h:17:25: note: in definition of macro 'args'
 #define args( list )    list
                         ^
In file included from act_comm.c:37:0:
tables.h:2:35: error: array type has incomplete element type
 extern const struct position_type position_table[];
                                   ^
tables.h:3:31: error: array type has incomplete element type
 extern const struct sex_type  sex_table[];
                               ^
tables.h:4:32: error: array type has incomplete element type
 extern const struct size_type  size_table[];
                                ^
tables.h:7:32: error: array type has incomplete element type
 extern const struct flag_type  act_flags[];
                                ^
tables.h:8:32: error: array type has incomplete element type
 extern const struct flag_type  plr_flags[];
                                ^
tables.h:9:32: error: array type has incomplete element type
 extern const struct flag_type  affect_flags[];
                                ^
tables.h:10:32: error: array type has incomplete element type
 extern const struct flag_type  off_flags[];
                                ^
tables.h:11:32: error: array type has incomplete element type
 extern const struct flag_type  imm_flags[];
                                ^
tables.h:12:32: error: array type has incomplete element type
 extern const struct flag_type  form_flags[];
                                ^
tables.h:13:32: error: array type has incomplete element type
 extern const struct flag_type  part_flags[];
                                ^
tables.h:14:32: error: array type has incomplete element type
 extern const struct flag_type  comm_flags[];
                                ^
tables.h:15:32: error: array type has incomplete element type
 extern const struct flag_type  extra_flags[];
                                ^
tables.h:16:32: error: array type has incomplete element type
 extern const struct flag_type  wear_flags[];
                                ^
tables.h:17:32: error: array type has incomplete element type
 extern const struct flag_type  weapon_flags[];
                                ^
tables.h:18:32: error: array type has incomplete element type
 extern const struct flag_type  container_flags[];
                                ^
tables.h:19:32: error: array type has incomplete element type
 extern const struct flag_type  portal_flags[];
                                ^
tables.h:20:32: error: array type has incomplete element type
 extern const struct flag_type  room_flags[];
                                ^
tables.h:21:32: error: array type has incomplete element type
 extern const struct flag_type  exit_flags[];
                                ^
tables.h:22:47: error: array type has incomplete element type
 extern        const   struct  flag_type       mprog_flags[];
                                               ^
tables.h:23:47: error: array type has incomplete element type
 extern        const   struct  flag_type       area_flags[];
                                               ^
tables.h:24:47: error: array type has incomplete element type
 extern        const   struct  flag_type       sector_flags[];
                                               ^
tables.h:25:47: error: array type has incomplete element type
 extern        const   struct  flag_type       door_resets[];
                                               ^
tables.h:26:47: error: array type has incomplete element type
 extern        const   struct  flag_type       wear_loc_strings[];
                                               ^
tables.h:27:47: error: array type has incomplete element type
 extern        const   struct  flag_type       wear_loc_flags[];
                                               ^
tables.h:28:47: error: array type has incomplete element type
 extern        const   struct  flag_type       res_flags[];
                                               ^
tables.h:29:47: error: array type has incomplete element type
 extern        const   struct  flag_type       imm_flags[];
                                               ^
tables.h:30:47: error: array type has incomplete element type
 extern        const   struct  flag_type       vuln_flags[];
                                               ^
tables.h:31:47: error: array type has incomplete element type
 extern        const   struct  flag_type       type_flags[];
                                               ^
tables.h:32:47: error: array type has incomplete element type
 extern        const   struct  flag_type       apply_flags[];
                                               ^
tables.h:33:47: error: array type has incomplete element type
 extern        const   struct  flag_type       sex_flags[];
                                               ^
tables.h:34:47: error: array type has incomplete element type
 extern        const   struct  flag_type       furniture_flags[];
                                               ^
tables.h:35:47: error: array type has incomplete element type
 extern        const   struct  flag_type       weapon_class[];
                                               ^
tables.h:36:47: error: array type has incomplete element type
 extern        const   struct  flag_type       apply_types[];
                                               ^
tables.h:37:47: error: array type has incomplete element type
 extern        const   struct  flag_type       weapon_type2[];
                                               ^
tables.h:38:47: error: array type has incomplete element type
 extern        const   struct  flag_type       apply_types[];
                                               ^
tables.h:39:47: error: array type has incomplete element type
 extern        const   struct  flag_type       size_flags[];
                                               ^
tables.h:40:47: error: array type has incomplete element type
 extern        const   struct  flag_type       position_flags[];
                                               ^
tables.h:41:47: error: array type has incomplete element type
 extern        const   struct  flag_type       ac_type[];
                                               ^
tables.h:42:47: error: array type has incomplete element type
 extern        const   struct  bit_type        bitvector_type[];
                                               ^
tables.h:48:38: error: array type has incomplete element type
 extern  const struct struct_channel  tab_channel[];
                                      ^
tables.h:51:41: error: array type has incomplete element type
 extern  const   struct  race_talk_type  race_talk_table[MAX_PC_RACE];

Generally, I know this is definitely a compiler issue with compatibility. Here are the compilers on the system. Which is Ubuntu 14.04.

Code: [Select]
ii  g++                             4:4.8.2-1ubuntu6                     i386         GNU C++ compiler
ii  g++-3.4                         3.4.6-6ubuntu3                       i386         The GNU C++ compiler
ii  g++-4.8                         4.8.4-2ubuntu1~14.04.3               i386         GNU C++ compiler
ii  g++-4.8-multilib                4.8.4-2ubuntu1~14.04.3               i386         GNU C++ compiler (multilib files)
ii  g++-multilib                    4:4.8.2-1ubuntu6                     i386         GNU C++ compiler (multilib files)
ii  gcc                             4:4.8.2-1ubuntu6                     i386         GNU C compiler
ii  gcc-3.4                         3.4.6-6ubuntu3                       i386         The GNU C compiler
ii  gcc-4.8                         4.8.4-2ubuntu1~14.04.3               i386         GNU C compiler
ii  gcc-4.8-multilib                4.8.4-2ubuntu1~14.04.3               i386         GNU C compiler (multilib files)
ii  gcc-multilib                    4:4.8.2-1ubuntu6                     i386         GNU C compiler (multilib files)
ii  libxkbcommon0:i386              0.4.1-0ubuntu1                       i386         library interface to the XKB compiler - shared library

If I try to use version 3.4 it comes up with all kinds of screwey errors that I'd never seen before. Yes, the extern entries are above the struct entries.

Any help would be appreciated, thank you all.

Rhien

  • New to TMC
  • *
  • Posts: 21
    • View Profile
Re: compiler issues
« Reply #1 on: January 03, 2018, 5:26 PM »
For the "array type has incomplete element type", try moving all the extern const struct lines to the end table.h.

Daemonus

  • New to TMC
  • *
  • Posts: 39
    • View Profile
    • Twist of FaTE MUDS
Re: compiler issues
« Reply #2 on: January 03, 2018, 10:55 PM »
Thank you for the response Rhien. Got it figured out. Some of it was forgetting the zlibs, as well as something in Ubuntu wasn't letting us get it rollin. Put in CentOS 6 and boom, there we have it, one simple line of code in the makefile and it runs great. Few errors need fixing, but it'll get there.

Tijer

  • Community Manager
  • TMC Veteran
  • *****
  • Posts: 729
    • View Profile
Re: compiler issues
« Reply #3 on: January 06, 2018, 6:39 AM »
in ubuntu and the more recent versions you need to have the libs used after the executable in the makefile...
--Tijer
War of Legend    • Mud • Waroflegend.net port 4200   • Web • http://www.waroflegend.net
Aadarian Realms • Mud • Aadaria.net port 1111/1114  • Web • http://www.aadaria.com

Zividave

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • AnsalonMUD
Re: compiler issues
« Reply #4 on: January 06, 2018, 2:34 PM »
Gah, I remember that update... was a big headache for a lot of people heh.
Thanks for the reminder down memory lane on that Rhien :)
Was a... but it worked fine, code hasn't changed... oh order of things.. ;)