BlueMonkMN's picture

OpenTK.dll.config and dllmap configuration

The OpenTK,dll.config seems to be working great. So why would I not be able to get the same thing to work for the main application? I have an application "tmp.exe" which I have both tried to compile under Windows with Visual Studio and compile with MonoDevelop under Linux. In both cases, the program comes up just fine and shows me pretty graphics (an indication that OpenTK is working great), but as soon as I try to start the phase where sound is involved, I get a DllNotFoundException stating that fmodex was not found. The same application runs fine under windows when fmodex.dll is present. But when when fmodex is not present, and libfmodex-4.22.01.so is present instead, I can't seem to get it to work. I have the following content in tmp.exe.config:

<configuration>
<dllmap os="linux" dll="fmodex.dll" target="libfmodex-4.22.01.so"/>
</configuration>


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
objarni's picture

Mincus;

Ah of course. Stupid of me. I'm new to the 64-bit environment.

BlueMonkMN's picture

In Windows/Visual Studio I forced the project to compile only for x86 architecture. Did you use the EXE delivered with the archive or did you re-compile it with MonoDevelop (I probably compiled the EXE I delivered in the archive with MonoDevelop, though, so it probably makes no difference)? I realize that I didn't do anything to the MonoDevelop project to force it to compile only for x86. Is there a way to do this?

Thanks for the tip. At my next opportunity, I'll try with a 64-bit version of FMOD or try looking in MonoDevelop for an x86 setting.

- Ben / "BlueMonkMN" / Scrolling Game Development Kit - http://sgdk2.sf.net/

Mincus's picture

I've tried both with the supplied exe and a recompiled one, both give the same error.

The "compile as x86" thing under Visual Studio tells Windows whether to use the 32-bit or 64-bit .NET binaries. AFAIK Mono only runs in the native environment (32-bit OR 64-bit) and doesn't install both, which means it can only link the either 32-bit OR 64-bit, whichever Mono is running as. I think. My understanding is a little fuzzy on that, but it's how I see it.
If that is indeed the case, then forcing to x86 won't make a difference under Linux.

You could test at runtime whether it's running 32-bit or 64-bit, then use that information to decide which DLL/so to link, which is one possible solution. I suspect there are better ones though.

BlueMonkMN's picture

OK using the 64-bit FMOD made the music work, but the keyboard doesn't work. It never ends.
But now I have another new problem related to the config file, this time under Windows. Apparently the Microsoft .NET framework does not recognize the dllmap config entry and creates an error when it tries to process this (which happens when any other error occurs). Should I not be able to use the same config file for Windows and Linux?

- Ben / "BlueMonkMN" / Scrolling Game Development Kit - http://sgdk2.sf.net/

the Fiddler's picture
BlueMonkMN wrote:

OK using the 64-bit FMOD made the music work, but the keyboard doesn't work. It never ends.
But now I have another new problem related to the config file, this time under Windows. Apparently the Microsoft .NET framework does not recognize the dllmap config entry and creates an error when it tries to process this (which happens when any other error occurs). Should I not be able to use the same config file for Windows and Linux?

No known keyboard issue, please file a bug.

Dllmap entries are Mono-specific. I would have thought .Net would ignore them completely - what kind of error does it generate?

BlueMonkMN's picture

The keyboard handling code is my own, not OpenTK's because OpenTK does (or did) not support reading the keyboard for applications that do not use GameWindow, Has that changed yet?

I got the answer to my config question on StackOverflow.com: http://stackoverflow.com/questions/967456/app-config-dllmap-entry-portab...

The error looks like:
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize --> System.Configuration.ConfigurationErrorsException:
Unrecognized configuration section dllmap.

And it only occurs when some other error occurs. Otherwise it apparently doesn't try to read the config file.

- Ben / "BlueMonkMN" / Scrolling Game Development Kit - http://sgdk2.sf.net/