dfterm3 icon indicating copy to clipboard operation
dfterm3 copied to clipboard

Compile on Mac

Open alexey-zaharchenko opened this issue 11 years ago • 5 comments

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

alexey-zaharchenko avatar Sep 04 '14 22:09 alexey-zaharchenko

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).

lethosor avatar Sep 05 '14 01:09 lethosor

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?

alexey-zaharchenko avatar Sep 13 '14 21:09 alexey-zaharchenko

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.

Noeda avatar Sep 14 '14 00:09 Noeda

@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.

lethosor avatar Oct 06 '14 20:10 lethosor

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.

alexey-zaharchenko avatar Oct 07 '14 12:10 alexey-zaharchenko