I’ve been staring at this for far too long now. I took the stream sample and essentially copied it into a msvc++ 7.0 win32 project and included the .lib file. Then, I copied the .dll to the same directory. When I compile, I get the following error:
[code:3n4gqz5v]Unhandled Exception: System.TypeLoadException: Could not load type FSOUND_STREAM
from assembly soundExperiment, Version=0.0.0.0, Culture=neutral, PublicKeyToken
Press any key to continue[/code:3n4gqz5v]
I can’t figure out what I am missing. Any ideas?
- tuckermc asked 15 years ago
Thank god for this thread. I’ve been at this all day – tried google,yahoo – none of them worked. msn did the job:)
A++ to serac.
edit: see’ing as how we’re now in 2005 as oppose to when this thread got started.. does the lastest version of MS Visual Studio.NET give you the option to create an .cpp C/C++ file (console project) unmanaged so you don’t have to insert #pragma unmanaged on your .cpp file??
Thanks in advanced.
- xeddiex answered 12 years ago
Which project type did you select?
Silly me… I missed it in your original post… I’m trying the same thing on my box.
Okay… I created a new C++ Win32 Application (Console, Empty project). I copied the “Main.cpp” from the [b:1icb3nx0]stream[/b:1icb3nx0] sample into the project’s directory and added it to the project. I then added “fmodvc.lib” to “Configuration Properties/Linker/Input/Additional Dependencies”. I also made sure that the FMOD SDK directories “api/inc” and “api/lib” were in the directory paths at “Tools/Options/Projects/VC++ Directories”. With the exception of 6 warnings (mostly type-cast related), the program compiled and executes normally.
FMOD is unmanaged code, so you cannot work with it directly in a managed environment. Adding “#pragma unmanaged” to the top of your source file will instruct the compiler to work in unmanaged mode. This will let the program run. You lose nothing, since nothing could be managed.
Until the .NET/CLR version of FMOD releases, I’d advise you to stick to unmanaged C/C++ for now. Anyway, Microsoft made Managed C++ a really messy language with all of the extensions. 😉 (…and in those many extensions are probably the very keywords you would need, if you wanted to augment “fmod.h” in order to get it to cooperate with managed code.)
Please login first to submit.