Winamp DSP plugin error loading plugin and odd strange characters

Before starting to make my own Winamp plugins, I tried compiling an existing plugin DLL from source-code in my current setup, thus testing if my setup was working. I used the Beginner Basic Plugin Guide as a starting point for my solution in Visual Studio 2012. That seemed to work.

I then compiled the resteless_dsp plugin, for which I found the source here: http://www.hartwork.org/doku.php?id=restless_winamp_plugin. This became problematic.

First the plugin compiled without error:

1>------ Build started: Project: dsp_myrestless, Configuration: Release Win32 ------
1> Stdafx.cpp
1> AssemblyInfo.cpp
1> dsp_myrestless.cpp
1> Generating Code...
1> Creating library I:\#C++\dsp_myrestless\Release\dsp_myrestless.lib and object I:\#C++\dsp_myrestless\Release\dsp_myrestless.exp
1> dsp_myrestless.vcxproj -> I:\#C++\dsp_myrestless\Release\dsp_myrestless.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

When I ran the plugin locally, it worked fine. But when I tried to run it on another system (a clean windows 7 virtual machine) I got strange results. The plugin would load (show-up in the list of plugins), but the title was replaced by random non ASCII characters. The file name looked ok though. Like this:

18-07-2013 11-50-58

And when I tried to run the configuration it told me ” Error loading module “.

18-07-2013 11-52-00

The problem boiled down to a wrong configuration (again) of Visual Studio. I was using Common Language support… Resolving this would imply installing extra software a the target PC and I didn’t want that. So I decided to go without CLR.

I changed the config like this:
1) Project->Properties->General->Common Language Runtime Support-> “No Common Language support”
2) Project->Properties->C/C++->Code Generation->Runtime Library-> “Multi-threaded (/MT)”

18-07-2013 12-25-01
18-07-2013 12-27-34

Now when I build I got a lot of errors:


1>------ Build started: Project: dsp_myrestless, Configuration: Release Win32 ------
1> Stdafx.cpp
1> AssemblyInfo.cpp
1>AssemblyInfo.cpp(3): error C2871: 'System' : a namespace with this name does not exist
1>AssemblyInfo.cpp(4): error C2653: 'System' : is not a class or namespace name
1>AssemblyInfo.cpp(4): error C2871: 'Reflection' : a namespace with this name does not exist
1>AssemblyInfo.cpp(5): error C2653: 'System' : is not a class or namespace name
1>AssemblyInfo.cpp(5): error C2871: 'CompilerServices' : a namespace with this name does not exist
1>AssemblyInfo.cpp(6): error C2653: 'System' : is not a class or namespace name
1>AssemblyInfo.cpp(6): error C2871: 'InteropServices' : a namespace with this name does not exist
1>AssemblyInfo.cpp(7): error C2653: 'System' : is not a class or namespace name
1>AssemblyInfo.cpp(7): error C2871: 'Permissions' : a namespace with this name does not exist
1>AssemblyInfo.cpp(14): error C2337: 'AssemblyTitleAttribute' : attribute not found
1>AssemblyInfo.cpp(15): error C2337: 'AssemblyDescriptionAttribute' : attribute not found
1>AssemblyInfo.cpp(16): error C2337: 'AssemblyConfigurationAttribute' : attribute not found
1>AssemblyInfo.cpp(17): error C2337: 'AssemblyCompanyAttribute' : attribute not found
1>AssemblyInfo.cpp(18): error C2337: 'AssemblyProductAttribute' : attribute not found
1>AssemblyInfo.cpp(19): error C2337: 'AssemblyCopyrightAttribute' : attribute not found
1>AssemblyInfo.cpp(20): error C2337: 'AssemblyTrademarkAttribute' : attribute not found
1>AssemblyInfo.cpp(21): error C2337: 'AssemblyCultureAttribute' : attribute not found
1>AssemblyInfo.cpp(34): error C2337: 'AssemblyVersionAttribute' : attribute not found
1>AssemblyInfo.cpp(36): error C2337: 'ComVisible' : attribute not found
1>AssemblyInfo.cpp(38): error C2337: 'CLSCompliantAttribute' : attribute not found
1>AssemblyInfo.cpp(40): error C2337: 'SecurityPermission' : attribute not found
1>AssemblyInfo.cpp(40): error C2653: 'SecurityAction' : is not a class or namespace name
1>AssemblyInfo.cpp(40): error C2065: 'RequestMinimum' : undeclared identifier
1> missing quotes ("") around 'RequestMinimum'?
1> dsp_myrestless.cpp
1> Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I eliminated those by commenting out everything in the AssemblyInfo.cpp that raised an error. (leave #include “stdafx.h” un-commented)


#include "stdafx.h"

//using namespace System;
//using namespace System::Reflection;
//using namespace System::Runtime::CompilerServices;
//using namespace System::Runtime::InteropServices;
//using namespace System::Security::Permissions;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
//[assembly:AssemblyTitleAttribute("dsp_myrestless")];
//[assembly:AssemblyDescriptionAttribute("")];
//[assembly:AssemblyConfigurationAttribute("")];
//[assembly:AssemblyCompanyAttribute("Microsoft")];
//[assembly:AssemblyProductAttribute("dsp_myrestless")];
//[assembly:AssemblyCopyrightAttribute("Copyright (c) Microsoft 2013")];
//[assembly:AssemblyTrademarkAttribute("")];
//[assembly:AssemblyCultureAttribute("")];

//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the value or you can default the Revision and Build Numbers
// by using the '*' as shown below:

//[assembly:AssemblyVersionAttribute("1.0.*")];
//
//[assembly:ComVisible(false)];
//
//[assembly:CLSCompliantAttribute(true)];
//
//[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

That eventually did the trick. The code compiles ok and it works fine on other windows systems.

1>------ Build started: Project: dsp_myrestless, Configuration: Release Win32 ------
1> AssemblyInfo.cpp
1> Creating library I:\#C++\dsp_myrestless\Release\dsp_myrestless.lib and object I:\#C++\dsp_myrestless\Release\dsp_myrestless.exp
1> dsp_myrestless.vcxproj -> I:\#C++\dsp_myrestless\Release\dsp_myrestless.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

I hope this will help someone out there.

Note that when you merely overwrite the dll with a newer version, the ” Error loading module ” error won’t go away. Use the “uninstall plug-in” button (right of the configure button) first to remove old versions of the plugin before adding the new version. Failing to do so will complicate debugging.

Leave a Reply

Your email address will not be published. Required fields are marked *