[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Compiling the server
. . -> [Subject]  Compile swfote 2.1.5 OSX Mavericks
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Compile swfote 2.1.5 OSX Mavericks

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by MattJ820   (32 posts)  [Biography] bio
Date Mon 30 Mar 2015 05:43 PM (UTC)

Amended on Mon 30 Mar 2015 07:01 PM (UTC) by MattJ820

Message
Hello,

I'm having problems getting swfote to compile using OSX Mavericks, which I believe I've concluded after my research compiles with C99. (Forgive me if I'm wrong)

Aside from Warnings which I believe I can fix, I'm getting an error out of mud.c for the following

typedef unsigned char bool - cannot combine with previous argument char.

After looking this up on the net, I believe the issue is that C99 doesn't like "bool" and wants me to use _Bool. I have tried rephrasing it to typedef _Bool Boolean and then replacing every instance of bool with _Bool, but that isn't working. I also tried including stdbool.h after I found that online, but that didn't work either.

Any suggestions to get this working? Also, is there a way to make the compiler reference a different version that doesn't conflict with the usage of bool instead?

I read online about doing gcc - std c90 in the makefile or something to that effect but it didn't work and I'm not confident I did it right. I used to code back in high school and I recall swfote compiling perfectly straight out of the box on my old system running Cygwin on a Windows XP machine.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 30 Mar 2015 08:59 PM (UTC)
Message
I thought it would C rather than C99.

Quote:

typedef unsigned char bool - cannot combine with previous argument char.


Do you have other typedefs for bool? Try omitting that line altogether.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by MattJ820   (32 posts)  [Biography] bio
Date Reply #2 on Mon 30 Mar 2015 10:19 PM (UTC)

Amended on Mon 30 Mar 2015 10:46 PM (UTC) by MattJ820

Message
Ya, I actually found an example on this site where someone had success commenting out that line with a dragon ball version of smuag. I didn't have any luck with it though. When I did that, I got an error from just about every C file about bool being undefined.

The errors would go on and on but the compiler stops at mud.h

.h:179:9: error: unknown type name 'bool'
typedef bool SPEC_FUN args( ( CHAR_DATA *ch ) );
^
./mud.h:560:5: error: unknown type name 'bool'
bool can_compress;
^
./mud.h:571:5: error: unknown type name 'bool'
bool fcommand;
^
./mud.h:840:5: error: unknown type name 'bool'
bool triggered;
^
./mud.h:860:2: error: unknown type name 'bool'
bool ifstate[MAX_IFS][DO_ELSE];
^
./mud.h:868:2: error: unknown type name 'bool'
bool single_step;
^
./mud.h:872:1: error: unknown type name 'bool'
bool MOBtrigger;
^
./mud.h:958:5: error: unknown type name 'bool'
bool flags;
[Go to top] top

Posted by MattJ820   (32 posts)  [Biography] bio
Date Reply #3 on Mon 30 Mar 2015 10:52 PM (UTC)
Message
I commented out the typedef line and #include <stdbool.h> and mud.c seemed to go through ok. I think I have to do the same with all the other C files that reference bool.

Hope this works..
[Go to top] top

Posted by MattJ820   (32 posts)  [Biography] bio
Date Reply #4 on Mon 30 Mar 2015 11:39 PM (UTC)
Message
I don't think it likes my 64 bit processor. Either that or I don't know what I'm talking about, which is possible. Any advice?

Other than that I fixed the typedef issue with bool and using the #include

Undefined symbols for architecture x86_64:
"xport-dynamic", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [swr] Error 1
make: *** [all] Error 2
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Tue 31 Mar 2015 02:15 AM (UTC)
Message
You might be able to tweak something in the Makefile to get that to compile/link.

Sounds like something to do with dynamic linking.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by MattJ820   (32 posts)  [Biography] bio
Date Reply #6 on Fri 03 Apr 2015 01:20 AM (UTC)
Message
Thank you for the pointer Nick.

Just to summarize for people who might be looking for the complete resolution..you need to do the following to run swfote2.1.5 for OSX.

In mud.h, #include <stdbool.h> at the top, comment out "typedef unsigned char bool;

In the make file, comment out NEED_DL = -ldl with a #. Also, find $(CC) -o $(SWR) $(O_FILES) $(L_FLAGS) -lm and take out the last part -lcrypt.

I had a ton of warnings but it compiled just fine without errors.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


4,104 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]