Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem installing on Mac Sierra #10

Open
Daningalls opened this issue Nov 1, 2017 · 9 comments
Open

Problem installing on Mac Sierra #10

Daningalls opened this issue Nov 1, 2017 · 9 comments

Comments

@Daningalls
Copy link

Hi - Sorry to bother you. I'm not facile with the underpinnings, but [on my Mac Air] I installed Mono and then contralto, and then started it, and after "You are at the Contralto console", I get an error:
System.DllNotFoundException: libSDL2-2.0.0.dylib
A google search suggested to reinstall MonoGame 3.6 which I did, but I still have the same problem
Can you help, oh please?
I am DanHHIngalls@gmail.com
Thanks!

  • Dan Ingalls
@livingcomputermuseum
Copy link
Owner

livingcomputermuseum commented Nov 1, 2017 via email

@Daningalls
Copy link
Author

Hi Again -
I tried what you suggested, and it does not solve the problem. FWIW I'm running OSX 10.12.6

@livingcomputermuseum
Copy link
Owner

livingcomputermuseum commented Nov 4, 2017 via email

@codefrau
Copy link

codefrau commented Nov 6, 2017

@Daningalls and I figured it out. Apparently, mono does not find SDL2 in the Framework version. It wants the "unixy" libSDL2-2.0.0.dylib, which we installed via homebrew (https://brew.sh/). So this worked:

brew install sdl2

Might be worth adding to the README?

@livingcomputermuseum
Copy link
Owner

livingcomputermuseum commented Nov 6, 2017 via email

@kgarrels
Copy link

kgarrels commented Nov 9, 2017

for me it helped to edit SDL2-CS.dll.config to point to the absolute path where the lib is, for me in /opt/local/library (as it was installed by macports):
`


<dllmap dll="SDL2_image.dll" os="windows" target="SDL2_image.dll"/>
<dllmap dll="SDL2_image.dll" os="osx" target="libSDL2_image-2.0.0.dylib"/>
<dllmap dll="SDL2_image.dll" os="linux" target="libSDL2_image-2.0.so.0"/>

<dllmap dll="SDL2_mixer.dll" os="windows" target="SDL2_mixer.dll"/>
<dllmap dll="SDL2_mixer.dll" os="osx" target="/opt/local/lib/libSDL2_mixer-2.0.0.dylib"/>
<dllmap dll="SDL2_mixer.dll" os="linux" target="libSDL2_mixer-2.0.so.0"/>

<dllmap dll="SDL2_ttf.dll" os="windows" target="SDL2_ttf.dll"/>
<dllmap dll="SDL2_ttf.dll" os="osx" target="/opt/local/lib/libSDL2_ttf-2.0.0.dylib"/>
<dllmap dll="SDL2_ttf.dll" os="linux" target="libSDL2_ttf-2.0.so.0"/>

`

@benhoh
Copy link

benhoh commented Jan 31, 2023

Having a devil of a time getting this to run on Ventura, but then again, I don't really know what I'm doing. I have SDL2 installed through Homebrew, and am referencing the absolute paths for the dylib files as @kgarrels has done, but am getting an <unknown assembly> error.

Here's my SDL2-CS.dll.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<dllmap dll="SDL2.dll" os="windows" target="SDL2.dll"/>
	<dllmap dll="SDL2.dll" os="osx" target="/opt/homebrew/Cellar/sdl2/2.26.2/lib/libSDL2-2.0.0.dylib"/>
	<dllmap dll="SDL2.dll" os="linux" target="libSDL2-2.0.so.0"/>

	<dllmap dll="SDL2_image.dll" os="windows" target="SDL2_image.dll"/>
	<dllmap dll="SDL2_image.dll" os="osx" target="/opt/homebrew/Cellar/sdl2_image/2.6.2_2/lib/libSDL2_image-2.0.0.dylib"/>
	<dllmap dll="SDL2_image.dll" os="linux" target="libSDL2_image-2.0.so.0"/>

	<dllmap dll="SDL2_mixer.dll" os="windows" target="SDL2_mixer.dll"/>
	<dllmap dll="SDL2_mixer.dll" os="osx" target="/opt/homebrew/Cellar/sdl2_mixer/2.6.2/lib/libSDL2_mixer-2.0.0.dylib"/>
	<dllmap dll="SDL2_mixer.dll" os="linux" target="libSDL2_mixer-2.0.so.0"/>

	<dllmap dll="SDL2_ttf.dll" os="windows" target="SDL2_ttf.dll"/>
	<dllmap dll="SDL2_ttf.dll" os="osx" target="/opt/homebrew/Cellar/sdl2_ttf/2.20.1/lib/libSDL2_ttf-2.0.0.dylib"/>
	<dllmap dll="SDL2_ttf.dll" os="linux" target="libSDL2_ttf-2.0.so.0"/>
</configuration>

And here's my SharpPcap.dll.config:

<configuration>
  <dllmap dll="wpcap" os="linux" target="libpcap.so.0.8" />
  <dllmap dll="wpcap" os="osx" target="/opt/homebrew/Cellar/libpcap/1.10.3/lib/libpcap.dylib" />
</configuration>

And this is what I get when I try to mono Contralto.exe:

Unhandled Exception:
System.DllNotFoundException: /opt/homebrew/Cellar/sdl2/2.26.2/lib/libSDL2-2.0.0.dylib assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) SDL2.SDL.SDL_Init(uint)
  at Contralto.SdlUI.SdlAltoWindow.InitSDL () [0x00000] in <4abbdcf09afa498baf9922cc3d9885f5>:0
  at Contralto.SdlUI.SdlAltoWindow.Run () [0x00000] in <4abbdcf09afa498baf9922cc3d9885f5>:0
  at Contralto.Program.Main (System.String[] args) [0x001f5] in <4abbdcf09afa498baf9922cc3d9885f5>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: /opt/homebrew/Cellar/sdl2/2.26.2/lib/libSDL2-2.0.0.dylib assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) SDL2.SDL.SDL_Init(uint)
  at Contralto.SdlUI.SdlAltoWindow.InitSDL () [0x00000] in <4abbdcf09afa498baf9922cc3d9885f5>:0
  at Contralto.SdlUI.SdlAltoWindow.Run () [0x00000] in <4abbdcf09afa498baf9922cc3d9885f5>:0
  at Contralto.Program.Main (System.String[] args) [0x001f5] in <4abbdcf09afa498baf9922cc3d9885f5>:0

@peterpur
Copy link

peterpur commented May 8, 2024

i had the same error, but luckily i know a little bit what i'm doing, so that helps. after digging into this problem, it seems to be that this version, being from 2018 and all, was only built for x86-architecture, so it runs only on intel macs.

as i have an M1 mac (and i assume your (@benhoh) mac is also an apple silicon machine of sorts), i'm probably out of luck until a friendly dev of this project creates an arm64-version.

then again, thinking that i know a little bit what i'm doing could lead to false confidence about my competencies, so maybe this is complete bullcrap. in that case, sorry!

@dmitry-skvortsov
Copy link

dmitry-skvortsov commented Jun 10, 2024

@peterpur @benhoh I encountered the same issue. It is not related to the project itself but rather to how Mono searches for dynamic libraries in the system. I tried several options from the Mono documentation, but they didn't help (I don't know c# or Mono). However, simply specifying the path to the library explicitly in the configuration file helped. Use brew info to see where your SDL2 libraries are located, and explicitly specify the path in the SDL2-CS.dll.config file using the target parameter. In my case, the line looks like this: <dllmap dll="SDL2.dll" os="osx" target="/opt/homebrew/Cellar/SDL2/2.30.3/lib/libSDL2-2.0.0.dylib"/>, and everything will work.

Screenshot 2024-06-10 at 19 29 23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants