ContrAlto icon indicating copy to clipboard operation
ContrAlto copied to clipboard

Problem installing on Mac Sierra

Open Daningalls opened this issue 8 years ago • 9 comments

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 [email protected] Thanks!

  • Dan Ingalls

Daningalls avatar Nov 01 '17 22:11 Daningalls

Hi Dan!

Sorry about the difficulties; there are some moving parts on OS X that I’m still working out. Please try installing the SDL 2.0.0 libraries from https://www.libsdl.org/release/SDL2-2.0.0.dmg and give it a go again. I’m hoping to work the kinks out of this soon.

Thanks, Josh

From: Daningalls [mailto:[email protected]] Sent: Wednesday, November 1, 2017 3:53 PM To: livingcomputermuseum/ContrAlto [email protected] Cc: Subscribed [email protected] Subject: [livingcomputermuseum/ContrAlto] Problem installing on Mac Sierra (#10)

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 [email protected]mailto:[email protected] Thanks!

  • Dan Ingalls

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/livingcomputermuseum/ContrAlto/issues/10, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ATnJh-NDV2_siKIugR6lJV33OQ87S6qMks5syPZHgaJpZM4QO77e.

livingcomputermuseum avatar Nov 01 '17 23:11 livingcomputermuseum

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

Daningalls avatar Nov 03 '17 21:11 Daningalls

Sorry to hear. Let me take a look at the problem and get back to you, many apologies.

One last thing to try in the interim -- try adding "--arch 32" to the mono commandline.


From: Daningalls [email protected] Sent: Friday, November 3, 2017 2:54:04 PM To: livingcomputermuseum/ContrAlto Cc: Josh Dersch; Comment Subject: Re: [livingcomputermuseum/ContrAlto] Problem installing on Mac Sierra (#10)

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

You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/livingcomputermuseum/ContrAlto/issues/10#issuecomment-341836635, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ATnJh6SpZqdppyiYIuuAep_4ndw3cEmLks5sy4t8gaJpZM4QO77e.

livingcomputermuseum avatar Nov 04 '17 03:11 livingcomputermuseum

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

codefrau avatar Nov 06 '17 18:11 codefrau

Thanks! I’ll add that to the README and I’ll see if I can make this less painful in general in the next release.

From: Bert Freudenberg [mailto:[email protected]] Sent: Monday, November 6, 2017 10:06 AM To: livingcomputermuseum/ContrAlto [email protected] Cc: Josh Dersch [email protected]; Comment [email protected] Subject: Re: [livingcomputermuseum/ContrAlto] Problem installing on Mac Sierra (#10)

@Daningallshttps://github.com/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?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/livingcomputermuseum/ContrAlto/issues/10#issuecomment-342234103, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ATnJhwPDqQ95NL-7tUXfveEbAnj80xqSks5sz0pugaJpZM4QO77e.

livingcomputermuseum avatar Nov 06 '17 18:11 livingcomputermuseum

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"/>

`

kgarrels avatar Nov 09 '17 20:11 kgarrels

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

benhoh avatar Jan 31 '23 07:01 benhoh

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!

peterpur avatar May 08 '24 21:05 peterpur

@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

dmitry-skvortsov avatar Jun 10 '24 17:06 dmitry-skvortsov