Menu β–Ύ β–΄

MacOS build problem - SDL_mixer.h not found

2023-01-03
2023-02-21
  • Chris Astles

    Chris Astles - 2023-01-03

    I tried just installing SDL_mixer on homebrew to see if it was just a
    dependency missing on my machine but no joy.

    I then tried getting around it by downloading SDL_mixer (
    https://github.com/libsdl-org/SDL_mixer) manually and placing
    'include/SDL_mixer.h' in the 'include' folder of the repo but that just
    throws a load of dependency errors (slight progress I guess)

     
  • Stefan van der Wel

    If you're using xcode, I haven't managed to get things working with homebrew, but if you instead download each as a dmg framework, you can get it to build. see attached screenshots - download to your framework dir then link the framework dirs in linked frameworks. in saying that I've still got some issue when i get past the menu screen after build and I think it is SDL related (game terminates). I think this might be library versions - I have a m1 chip and I wonder if the libraries are built only for intel chipset... not sure at this stage.

    Attached are screenshots of all i needed to do to get it to build

     
    • Chris Astles

      Chris Astles - 2023-01-04

      UPDATE - sorry on opening the dmg I see the frameworks inside, please ignore the below


      Thanks for your reply, Stefan. Could you please advise where to find it as a dmg framework? I can see as dmg but not framework.

      https://www.libsdl.org/projects/SDL_mixer/release/?C=M;O=D

       

      Last edit: Chris Astles 2023-01-04
  • Chris Astles

    Chris Astles - 2023-01-04

    Hi Stefan. After downloading the frameworks and setting them up in the dirs, I overcame some of the errors, but still the build fails on some unfound symbols...

    Undefined symbols for architecture x86_64:
      "_TTF_Init", referenced from:
          _main in main.o
    
      "_TTF_Linked_Version", referenced from:
          _main in main.o
    
      "_TTF_Quit", referenced from:
          _main in main.o
    
      "CampaignAIPlayer::CampaignAIPlayer(House*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
          std::__1::__function::__func<PlayerFactory::registerAllPlayers()::$_20, std::__1::allocator<PlayerFactory::registerAllPlayers()::$_20>, std::__1::unique_ptr<Player, std::__1::default_delete<Player> > (House*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)>::operator()(House*&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in PlayerFactory.o
    
    
      "CampaignAIPlayer::CampaignAIPlayer(InputStream&, House*)", referenced from:
          std::__1::__function::__func<PlayerFactory::registerAllPlayers()::$_21, std::__1::allocator<PlayerFactory::registerAllPlayers()::$_21>, std::__1::unique_ptr<Player, std::__1::default_delete<Player> > (InputStream&, House*)>::operator()(InputStream&, House*&&) in PlayerFactory.o
    
    
      "Random::~Random()", referenced from:
          Game::Game() in Game.o
          Game::~Game() in Game.o
          Game::handlePlacementClick(int, int) in Game.o
          generateRandomMap(int, int, int, int, int, MirrorMode) in MapGenerator.o
          MapGenerator::MapGenerator(int, int, int, int, int, MirrorMode) in MapGenerator.o
    
      "TTFFont::TTFFont(std::__1::unique_ptr<SDL_RWops, sdl2::implementation::RWops_deleter>, int)", referenced from:
          FontManager::loadFont(unsigned int) in FontManager.o
    
     
    • Stefan van der Wel

      Not sure about ttf ones but make sure you have sdl_ttf
      other errors are likely due to xcode not being up to date and not having all the files, you need to add them to the project like the campaign ai. ill push my xcode project back so you can see otherwise

       
    • Stefan van der Wel

      i'd say its all just about adding missing files to the xcode project - the file would have been pulled off git but isn't referenced in the project so you need to manually add the missing ones. I remember i had to do that as well

       
  • Chris Astles

    Chris Astles - 2023-01-10

    I managed to fix the first 3 when I realised that although I'd added the frameworks to the search paths, they also needed to be added to Build Phases (in the Link Binary With Libraries section). The other 4 still remain though:

      "CampaignAIPlayer::CampaignAIPlayer(House*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
          std::__1::__function::__func<PlayerFactory::registerAllPlayers()::$_20, std::__1::allocator<PlayerFactory::registerAllPlayers()::$_20>, std::__1::unique_ptr<Player, std::__1::default_delete<Player> > (House*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)>::operator()(House*&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in PlayerFactory.o
    

    seems weird because I can't see any line in PlayerFactory which uses this constructor


      "CampaignAIPlayer::CampaignAIPlayer(InputStream&, House*)", referenced from:
          std::__1::__function::__func<PlayerFactory::registerAllPlayers()::$_21, std::__1::allocator<PlayerFactory::registerAllPlayers()::$_21>, std::__1::unique_ptr<Player, std::__1::default_delete<Player> > (InputStream&, House*)>::operator()(InputStream&, House*&&) in PlayerFactory.o
    

    equally weird because a constructor with that signature is present in CampaignAIPlayer.h


      "Random::~Random()", referenced from:
          Game::Game() in Game.o
          Game::~Game() in Game.o
          Game::handlePlacementClick(int, int) in Game.o
          generateRandomMap(int, int, int, int, int, MirrorMode) in MapGenerator.o
          MapGenerator::MapGenerator(int, int, int, int, int, MirrorMode) in MapGenerator.o
    

    I tried adding #include <misc/Random.h> to Game.cpp but still no joy.


      "TTFFont::TTFFont(std::__1::unique_ptr<SDL_RWops, sdl2::implementation::RWops_deleter>, int)", referenced from:
          FontManager::loadFont(unsigned int) in FontManager.o
    

    I have no idea...

     

    Last edit: Chris Astles 2023-01-10
    • Stefan van der Wel

      add the cpp campaign AI file to the xcode project

      On Wed, 11 Jan 2023 at 04:28, Chris Astles chrissya@users.sourceforge.net
      wrote:

      I managed to fix the first 3 when I realised that although I'd added the
      frameworks to the search paths, they also needed to be added to Build
      Phases (in the Link Binary With Libraries section). The other 4 still
      remain though

      "CampaignAIPlayer::CampaignAIPlayer(House, std:πŸ‘Ž:basic_string<char, std::__1::char_traits\<char="">, std::__1::allocator\<char> > const&)", referenced from: std:πŸ‘Ž:__function::__func<playerfactory::registerallplayers()::$_20, std::__1::allocator\<playerfactory::registerallplayers()::$_20="">, std::__1::unique_ptr\<player, std::__1::default_delete\<player=""> > (House*, std::__1::basic_string\<char, std::__1::char_traits\<char="">, std::__1::allocator\<char> > const&)>::operator()(House</char></char,></player,></playerfactory::registerallplayers()::$_20,></char></char,>&&, std:πŸ‘Ž:basic_string<char, std::__1::char_traits\<char="">, std::__1::allocator\<char> > const&) in PlayerFactory.o</char></char,>

      seems weird because I can't see any line in PlayerFactory which uses this
      constructor

      "CampaignAIPlayer::CampaignAIPlayer(InputStream&, House)", referenced from: std:πŸ‘Ž:__function::__func<playerfactory::registerallplayers()::$_21, std::__1::allocator\<playerfactory::registerallplayers()::$_21="">, std::__1::unique_ptr\<player, std::__1::default_delete\<player=""> > (InputStream&, House*)>::operator()(InputStream&, House</player,></playerfactory::registerallplayers()::$_21,>&&) in PlayerFactory.o

      equally weird because a constructor with that signature is present in
      CampaignAIPlayer.h

      "Random::~Random()", referenced from: Game::Game() in Game.o Game::~Game() in Game.o Game::handlePlacementClick(int, int) in Game.o generateRandomMap(int, int, int, int, int, MirrorMode) in MapGenerator.o MapGenerator::MapGenerator(int, int, int, int, int, MirrorMode) in MapGenerator.o

      I tried adding #include <misc random.h=""> to Game.cpp but still no joy.</misc>

      "TTFFont::TTFFont(std:πŸ‘Ž:unique_ptr<sdl_rwops, sdl2::implementation::rwops_deleter="">, int)", referenced from: FontManager::loadFont(unsigned int) in FontManager.o</sdl_rwops,>

      I have no idea...

      Attachments:


      MacOS build problem - SDL_mixer.h not found
      https://sourceforge.net/p/dunelegacy/discussion/263161/thread/5cd9a6bbc8/?limit=25#7d90


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/dunelegacy/discussion/263161/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • Chris Astles

        Chris Astles - 2023-01-11

        Update: my bad, I was confusing TTFFont with the SDL2_TTF framework. I just needed to include the FileClasses/TTFFont.cpp in the compile sources and it worked. Build succeeded!


        Ok, fixed CampaignAIPlayer and Random errors by adding the corresponding .cpp files to Compile Sources. Still getting the TTFFont error. Have added the SDL2_TTF framework to "Compile Sources", "Link Binary With Libraries", and "Copy Frameworks into .app bundle" but still no joy.

         

        Last edit: Chris Astles 2023-01-12
  • Chris Astles

    Chris Astles - 2023-01-12

    I've still got some issue when i get past the menu screen after build and I think it is SDL related (game terminates). I think this might be library versions - I have a m1 chip and I wonder if the libraries are built only for intel chipset... not sure at this stage.

    Are you referring to the game starting ok but crashing whenever you start an actual mission? That is the behaviour I'm getting. I have an Intel chip so this rules out it being an M1 problem...

     
  • Chris Astles

    Chris Astles - 2023-01-12

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

    Exception Type: EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note: EXC_CORPSE_NOTIFY

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0 libsystem_kernel.dylib 0x7ff802b3800e __pthread_kill + 10
    1 libsystem_pthread.dylib 0x7ff802b6e1ff pthread_kill + 263
    2 libsystem_c.dylib 0x7ff802ab9d24 abort + 123
    3 libsystem_c.dylib 0x7ff802ab90cb __assert_rtn + 314
    4 Metal 0x7ff80b5ec244 MTLReportFailure.cold.1 + 43
    5 Metal 0x7ff80b5d6705 MTLReportFailure + 529
    6 Metal 0x7ff80b5e5a55 -[_MTLCommandBuffer presentDrawable:] + 228
    7 AppleIntelKBLGraphicsMTLDriver 0x7ffa0ebff5f3 -[MTLIGAccelCommandBuffer presentDrawable:] + 105
    8 SDL2 0x10c865419 0x10c84e000 + 95257
    9 SDL2 0x10c90c6f6 0x10c84e000 + 780022
    10 Dune Legacy 0x10c33bc50 0x10c285000 + 748624
    11 Dune Legacy 0x10c47ef24 0x10c285000 + 2072356
    12 Dune Legacy 0x10c43bc33 0x10c285000 + 1797171
    13 Dune Legacy 0x10c358ef7 0x10c285000 + 868087
    14 Dune Legacy 0x10c35391e 0x10c285000 + 846110
    15 Dune Legacy 0x10c34769e 0x10c285000 + 796318
    16 Dune Legacy 0x10c3913fe 0x10c285000 + 1098750
    17 Dune Legacy 0x10c420872 0x10c285000 + 1685618
    18 Dune Legacy 0x10c42069b 0x10c285000 + 1685147
    19 Dune Legacy 0x10c405cf1 0x10c285000 + 1576177
    20 Dune Legacy 0x10c358ef7 0x10c285000 + 868087
    21 Dune Legacy 0x10c35391e 0x10c285000 + 846110
    22 Dune Legacy 0x10c34769e 0x10c285000 + 796318
    23 Dune Legacy 0x10c3913fe 0x10c285000 + 1098750
    24 Dune Legacy 0x10c420872 0x10c285000 + 1685618
    25 Dune Legacy 0x10c42069b 0x10c285000 + 1685147
    26 Dune Legacy 0x10c3a9c51 0x10c285000 + 1199185
    27 dyld 0x11672d51e start + 462

     
  • Charles Husman

    Charles Husman - 2023-02-21

    Got the same issue and it also create many problems with browser too. Some of my files from browsers are corrupt and because of this other language websites like 메이저카지노 are not opening in browser.

     

    Last edit: Charles Husman 2023-02-21

Log in to post a comment.