Noeda / dfterm3

Remote Dwarf Fortress playing
ISC License
45 stars 2 forks source link

Compile on Mac #33

Open alexey-zaharchenko opened 10 years ago

alexey-zaharchenko commented 10 years ago

I add add_subdirectory (dfterm3-plugin) to the end of dfhack/plugins/CMakeLists.txt and try compile, but linker fails:

Linking CXX shared module dfterm3.plug.so Undefined symbols for architecture i386: "_SDL_PushEvent", referenced from: _plugin_init in dfterm3.cpp.o "_progname_full", referenced from: ZL15sendHandshakingRN6DFHack13color_ostreamEP13Dfterm3Client.clone.33 in dfterm3.cpp.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status make[2]: * [plugins/dfterm3-plugin/dfterm3.plug.so] Error 1 make[1]: * [plugins/dfterm3-plugin/CMakeFiles/dfterm3.dir/all] Error 2 make: *\ [all] Error 2

lethosor commented 10 years ago

If I remember correctly, you'll need to add a hook for SDL_PushEvent in library/Hooks-darwin.cpp (and possibly define _SDL_PushEvent as DFH_SDL_PushEvent on OS X).

alexey-zaharchenko commented 10 years ago

I just noticed that I've created this issues not in plugin repository, I hope it is not so important. After a while all successfully compiled and run, but for this I head to comment

char* result = realpath(__progname_full, realpath_result);
    if ( !result ) {
        return false;
    }

in sendHandshaking function for not win platform, I don't fully understand fort what this check, maybe somebody know?

Noeda commented 10 years ago

The if-check is there because the Linux man page for realpath() suggests that call can fail. It probably should print some kind of error though. I don't know in what circumstances it can fail but at the time I most likely was too lazy to find that out.

lethosor commented 10 years ago

@daedmen could you share the code you used to get PushEvent working? It would be nice to merge that into the official DFHack repo, if possible.

alexey-zaharchenko commented 10 years ago

Yes, I patch dfterm3-plugin for run it on macosx, and all was well with df/dfhack versions from beginning of September .But with current versions the link between dfterm3-plugin and dfterm3 broke and I have not yet figured out what the problem is, so i push as soon as all will be work.