Staredit Network > Forums > Modding Discussion > Topic: Compile SFmpq for Mac
Compile SFmpq for Mac
Aug 26 2010, 1:00 am
By: poiuy_qwert  

Aug 26 2010, 1:00 am poiuy_qwert Post #1

PyMS and ProTRG developer

Not many people will probably care, but I though I might as well share the information I have just in case someone is looking for info. These are the steps I took to fix some small compatibility errors and compile SFmpq on OS X:

1) Download SFmpqapi, SComp, bzip, and zlib
2) Replace #include <malloc.h> with #include <stdlib.h> in windows.cpp/.h, SMem.cpp/.h, and SFmpqapi.cpp/.h
3) Replace #include <windows.h> with #include "windows.h" in SFmpqapi.cpp/.h
4) Compile files in this order:
windows
SErr
SMem
explode
implode (there was a cast from unsigned char* to char* "error" on line 452 for me, easy fixes though)
huffman
crc32
wave
SComp
SFmpqapi
bzip (a simple "make" works to compile it. i needed to compile it or else I would get missing symbol errors, but didn't need to do this for zlib)
5) Compile it all together. I used:
g++ -dynamiclib -o SFmpq.dylib -lz windows.o SFmpqapi.o crc32.o explode.o huffman.o implode.o SComp.o SErr.o SMem.o wave.o bzip2/blocksort.o bzip2/compress.o bzip2/decompress.o bzip2/randtable.o bzip2/bzip2.o bzip2/bzlib.o bzip2/crctable.o bzip2/huffman.o


Thank you to ShadowFlare for making such an awesome dll (or dylib ;P)!




Sep 3 2010, 3:14 am ShadowFlare Post #2



I had fixed some occurrences of malloc.h already, but there was one remaining in the windows.h file, which I changed to stdlib.h just a few minutes ago.



None.

Sep 3 2010, 3:15 am Jack Post #3

>be faceless void >mfw I have no face

I might give a go at compiling this for linux, as I mostly use linux nowadays and every now and then could do with a working MPQ tool.
I'll let ya'll know how it goes.



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Sep 3 2010, 3:56 am Jack Post #4

>be faceless void >mfw I have no face

Sorry for double post, but you might miss the edit:

In windows.h, you define __declspec twice.
Code
#define __declspec(dllimport)
#define __declspec(dllexport)

Why is this? It's throwing up an error when I try to compile windows.cpp.

And I also get this error:
Code
windows.cpp: In function ‘char* strdup(const char*)’:
windows.cpp:160: error: declaration of ‘char* strdup(const char*)’ throws different exceptions
windows.h:141: error: from previous declaration ‘char* strdup(const char*) throw ()’


I'm not very good at programming, so yeah :/



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Sep 3 2010, 4:36 am ShadowFlare Post #5



At the time, I must not have realized that I didn't need a different one for each of those cases.

As for strdup, try removing it from windows.cpp/.h. Maybe I didn't used to have it including the header that defined it and now it is?

The last time I had tried compiling it in Linux was maybe when I had a computer with Red Hat Linux 7.something installed on another partition.

Post has been edited 1 time(s), last time on Sep 3 2010, 4:42 am by ShadowFlare.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:43 pm]
Zoan -- NudeRaider
NudeRaider shouted: Zoan yes you can.
oh, yeah you’re right. Then yeah if you use an ai script it should be easy to farm unfinished buildings in some unused area on the map and just move them around, right?
[2019-10-17. : 6:06 am]
NudeRaider -- KrayZee
KrayZee shouted: Voyager7456 Somehow I misread your shout. "Glad I can entertain you in Nude" as if you sent a racy photo, video or something.
nah, he just made a comment that had us laughing very hard.
[2019-10-17. : 6:02 am]
NudeRaider -- Zoan
Zoan shouted: sraw531 you can’t move buildings afaik
yes you can.
[2019-10-16. : 10:03 pm]
Dem0n -- no
[2019-10-16. : 8:26 pm]
GGmano -- Is here a forum only for temple siege?
[2019-10-16. : 4:20 pm]
KrayZee -- Voyager7456
Voyager7456 shouted: Glad I can entertain you Nude
Somehow I misread your shout. "Glad I can entertain you in Nude" as if you sent a racy photo, video or something.
[2019-10-16. : 2:26 pm]
martosss -- Moose
Moose shouted: martosss IIRC, the plan was to go 64-bit only eventually so they're interested in differences between the versions
well I might have found 1 bug for them to fix - some maps load on 32 bit, but not on 64 bit game version
[2019-10-16. : 2:19 pm]
Zoan -- sraw531
sraw531 shouted: I'm pretty sure you would move the building away at some point. When you do so, you can give it to someone else. I was thinking nexi because its possible you could encourage the computer to expand to a specific spot
you can’t move buildings afaik
[2019-10-16. : 10:10 am]
Moose -- martosss
martosss shouted: jjf28 OK, I have 1 more question - are you using 32 bit SC:R or 64 bit ? In game settings there's an option to switch to 32, is it checked? I just tried hosting the map with 64-bit SC:R and it failed... I ticked the option to use 32 bit SC:R => it worked and map was hosted. So I guess the issue still exists for 64 bit SC:R ? I also tried calling a friend and he couldn't see the map when he entered the lobby. Weird, I might have to report this to Blizzard?
IIRC, the plan was to go 64-bit only eventually so they're interested in differences between the versions
[2019-10-16. : 5:27 am]
O)FaRTy1billion[MM] -- or a magic box :(
Please log in to shout.


Members Online: Roy, radoslaw481095, lawiwa45451, lil-Inferno, jjf28, Neiv