Rangi42 / tilemap-studio

A tilemap editor for Game Boy, Color, Advance, DS, and SNES projects. Written in C++ with FLTK.
https://hax.iimarckus.org/topic/7691/
Other
383 stars 30 forks source link

compatibility on apple m1 #21

Closed mRamiroGonzalez closed 3 years ago

mRamiroGonzalez commented 3 years ago

Hi, i have been trying to build this app to run on apple m1, since it's not possible to use wine anymore (see https://github.com/Rangi42/tilemap-studio/issues/16)

FLTK build perfectly, I have used this guide (cmake / make), the examples are working and the library is installed in /usr/local/include/FL

I also had to edit the makefile, because of this error

But now, when i follow the instructions on INSTALL.md, i encounter this error:

>make clean && clear && make
rm -rf bin/tilemapstudio bin/tilemapstudiod tmp/config.o tmp/help-window.o tmp/hex-spinner.o tmp/image-to-tiles.o tmp/image.o tmp/main-window.o tmp/main.o tmp/modal-dialog.o tmp/option-dialogs.o tmp/preferences.o tmp/themes.o tmp/tile-buttons.o tmp/tile-selection.o tmp/tile.o tmp/tilemap-format.o tmp/tilemap.o tmp/tileset.o tmp/utils.o tmp/widgets.o tmp/debug/config.o tmp/debug/help-window.o tmp/debug/hex-spinner.o tmp/debug/image-to-tiles.o tmp/debug/image.o tmp/debug/main-window.o tmp/debug/main.o tmp/debug/modal-dialog.o tmp/debug/option-dialogs.o tmp/debug/preferences.o tmp/debug/themes.o tmp/debug/tile-buttons.o tmp/debug/tile-selection.o tmp/debug/tile.o tmp/debug/tilemap-format.o tmp/debug/tilemap.o tmp/debug/tileset.o tmp/debug/utils.o tmp/debug/widgets.o

c++ -c -std=c++17 -Isrc -Ires -I/usr/local/include -I/usr/local/include/FL/images -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -DNDEBUG -O3 -flto -mcpu=apple-a11 -o tmp/config.o src/config.cpp
c++ -c -std=c++17 -Isrc -Ires -I/usr/local/include -I/usr/local/include/FL/images -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -DNDEBUG -O3 -flto -mcpu=apple-a11 -o tmp/help-window.o src/help-window.cpp
c++ -c -std=c++17 -Isrc -Ires -I/usr/local/include -I/usr/local/include/FL/images -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -DNDEBUG -O3 -flto -mcpu=apple-a11 -o tmp/hex-spinner.o src/hex-spinner.cpp
c++ -c -std=c++17 -Isrc -Ires -I/usr/local/include -I/usr/local/include/FL/images -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -DNDEBUG -O3 -flto -mcpu=apple-a11 -o tmp/image-to-tiles.o src/image-to-tiles.cpp
In file included from src/image-to-tiles.cpp:20:
src/main-window.h:95:2: error: unknown type name 'Pixmap'
        Pixmap _icon_pixmap, _icon_mask;
        ^
src/image-to-tiles.cpp:271:23: error: cannot initialize a parameter of type 'const Fl_Widget *' with
      an rvalue of type 'Main_Window *'
                _error_dialog->show(this);
                                    ^~~~
src/modal-dialog.h:42:29: note: passing argument to parameter 'p' here
        void show(const Fl_Widget *p);
                                   ^
src/image-to-tiles.cpp:286:23: error: cannot initialize a parameter of type 'const Fl_Widget *' with
      an rvalue of type 'Main_Window *'
                _error_dialog->show(this);
                                    ^~~~
src/modal-dialog.h:42:29: note: passing argument to parameter 'p' here
        void show(const Fl_Widget *p);
                                   ^
src/image-to-tiles.cpp:336:24: error: cannot initialize a parameter of type 'const Fl_Widget *' with
      an rvalue of type 'Main_Window *'
                        _error_dialog->show(this);
                                            ^~~~
src/modal-dialog.h:42:29: note: passing argument to parameter 'p' here
        void show(const Fl_Widget *p);
                                   ^
src/image-to-tiles.cpp:404:24: error: cannot initialize a parameter of type 'const Fl_Widget *' with
      an rvalue of type 'Main_Window *'
                        _error_dialog->show(this);
                                            ^~~~
src/modal-dialog.h:42:29: note: passing argument to parameter 'p' here
        void show(const Fl_Widget *p);
                                   ^
src/image-to-tiles.cpp:417:24: error: cannot initialize a parameter of type 'const Fl_Widget *' with
      an rvalue of type 'Main_Window *'
                        _error_dialog->show(this);
                                            ^~~~
src/modal-dialog.h:42:29: note: passing argument to parameter 'p' here
        void show(const Fl_Widget *p);
                                   ^
src/image-to-tiles.cpp:453:23: error: cannot initialize a parameter of type 'const Fl_Widget *' with
      an rvalue of type 'Main_Window *'
                _error_dialog->show(this);
                                    ^~~~
src/modal-dialog.h:42:29: note: passing argument to parameter 'p' here
        void show(const Fl_Widget *p);
                                   ^
src/image-to-tiles.cpp:475:23: error: cannot initialize a parameter of type 'const Fl_Widget *' with
      an rvalue of type 'Main_Window *'
                _error_dialog->show(this);
                                    ^~~~
src/modal-dialog.h:42:29: note: passing argument to parameter 'p' here
        void show(const Fl_Widget *p);
                                   ^
src/image-to-tiles.cpp:494:24: error: cannot initialize a parameter of type 'const Fl_Widget *' with
      an rvalue of type 'Main_Window *'
                        _error_dialog->show(this);
                                            ^~~~
src/modal-dialog.h:42:29: note: passing argument to parameter 'p' here
        void show(const Fl_Widget *p);
                                   ^
src/image-to-tiles.cpp:512:23: error: cannot initialize a parameter of type 'const Fl_Widget *' with
      an rvalue of type 'Main_Window *'
                _error_dialog->show(this);
                                    ^~~~
src/modal-dialog.h:42:29: note: passing argument to parameter 'p' here
        void show(const Fl_Widget *p);
                                   ^
src/image-to-tiles.cpp:523:24: error: cannot initialize a parameter of type 'const Fl_Widget *' with
      an rvalue of type 'Main_Window *'
        _success_dialog->show(this);
                              ^~~~
src/modal-dialog.h:42:29: note: passing argument to parameter 'p' here
        void show(const Fl_Widget *p);
                                   ^
src/image-to-tiles.cpp:529:2: error: cannot initialize object parameter of type 'Fl_Widget' with an
      expression of type 'Main_Window'
        redraw();
        ^~~~~~
12 errors generated.

And i don't understand why the first files seems to compile but then nothing else :'(

I'm not a c / c++ dev, nor have i developed anything to run on desktop, sorry if i'm doing something stupid. I just really want to have it working on m1 :)

Rangi42 commented 3 years ago

Tilemap Studio has never supported macOS. I made some progress for Polished Map that would be portable to both programs, but it's not functional. I did write an FLTK program years ago that worked for the Mac OS X of its time, but Apple's backwards compatibility is low compared to DOS/Windows.

Whatever M1 macOS' virtualization or emulation options are, see if the Windows or Linux build instructions can work for you. Or send me a MacBook, even if it's not an M1, and I'll make support a priority. :P

mRamiroGonzalez commented 3 years ago

Thank you for the response, I will try to find another solution then

mRamiroGonzalez commented 3 years ago

For anyone with a M1 Macbook, i managed to get it working on macos 11.3 using Wineskin. The engine I used is WS11WineCX20.0.2 The C drive will be located on your mac at ~/Applications/Wineskin/Tilemap Studio.app/drive_c

Screenshot 2021-04-27 at 23 22 11