Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - stewart

#1
Hi,

I'm trying to build the quest editor for Mac OS.

Solarus library runs fine and ZSDX is playable, but when loading a quest I get a segfault in the lua code called from Solarus::LuaData::import_from_file:


Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008

VM Regions Near 0x8:
-->
    __TEXT                 000000010656f000-00000001067e7000 [ 2528K] r-x/rwx SM=COW  /Users/USER/*

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libluajit-5.1.2.dylib          0x000000010b49cf69 lua_pushfstring + 89
1   libluajit-5.1.2.dylib          0x000000010b4ab2dd luaL_loadfilex + 77
2   libsolarus.dylib              0x000000010705f0a2 Solarus::LuaData::import_from_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 50
3   solarus-quest-editor          0x00000001066be57d QuestProperties::reload() + 141
4   solarus-quest-editor          0x000000010670d31f QuestProperties::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 223
5   org.qt-project.QtCore          0x000000010be58ad8 QMetaObject::activate(QObject*, int, int, void**) + 2840
6   solarus-quest-editor          0x000000010670cb9d Quest::root_path_changed(QString const&) + 77
7   solarus-quest-editor          0x00000001066ab18f Quest::set_root_path(QString const&) + 223
8   solarus-quest-editor          0x00000001065c3668 MainWindow::open_quest(QString const&) + 88
9   solarus-quest-editor          0x0000000106694fc6 main + 822
10  libdyld.dylib                  0x00007fff9187f7e1 start + 1


Which version of LuaJIT is required for Solarus?

I'm using the git version of Solarus, and solarus-quest-editor, and release version 2.0.4 of LuaJIT.

Cheers,
  Stewart
#2
Hi,

Looks like the current version 1.4.2 is only available for download for Windows. I tried loading the ALTTP resources in the latest Mac version and it didn't work. Therefore, I'm trying to build the library and editor for Mac OSX.

I ran into a couple of issues:

While running 'cmake':

1) Missing source file in cmake build


CMake Error at cmake/AddSolarusLibrary.cmake:422 (add_library):
  Cannot find source file:

    include/lowlevel/apple/AppleInterface.h

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx
Call Stack (most recent call first):
  CMakeLists.txt:9 (include)


This can be fixed by:


@@ -414,7 +414,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
   set(source_files
     ${source_files}
     src/lowlevel/apple/AppleInterface.mm
-    include/lowlevel/apple/AppleInterface.h
+    include/solarus/lowlevel/apple/AppleInterface.h
   )
endif()


2) MACOS_RPATH warning:


CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   solarus
   solarus_testing

This warning is for project developers.  Use -Wno-dev to suppress it.


As the warning says, this can be suppressed using -Wno-dev, and cmake will complete successfully.

While running 'make':

3) Many errors regarding STL templates...


Scanning dependencies of target solarus
[  1%] Building CXX object CMakeFiles/solarus.dir/src/entities/AnimatedTilePattern.cpp.o
In file included from /Users/stewart/local/git/solarus/src/entities/AnimatedTilePattern.cpp:17:
In file included from /Users/stewart/local/git/solarus/include/solarus/entities/AnimatedTilePattern.h:21:
In file included from /Users/stewart/local/git/solarus/include/solarus/entities/TilePattern.h:22:
/Users/stewart/local/git/solarus/include/solarus/lowlevel/SurfacePtr.h:29:25: error:
      no type named 'shared_ptr' in namespace 'std'
using SurfacePtr = std::shared_ptr<Surface>;
                   ~~~~~^


This appears to be related to Apple's support for STL. For example, see here:
http://stackoverflow.com/questions/13445742/apple-and-shared-ptr
and
http://stackoverflow.com/questions/12819886/no-type-named-shared-ptr-in-namespace-std

Any ideas what to do about this? I am not very familiar with C++/STL or cmake so its a bit hard for me to debug this.

Cheers,
  Stewart