Raised This Month: $51 Target: $400
 12% 

"Failed to load plugin..."


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 02-08-2009 , 08:57   "Failed to load plugin..."
Reply With Quote #1

Hi.
Here's my next problem
When I want to load my plugin, the following error appears:
Code:
Failed to load plugin addons/testplugin ([998]).
I don't know what I'm doing wrong.
Here's a bit of my startup-code.

testplugin.cpp: http://nopaste.org/p/ayatianTB
testplugin.hpp: http://nopaste.org/p/a2Bshnsjmb

I don't know what I'm doing wrong. Compiling is with 0 errors and warnings.

Thanks for answers
- Chris
Chrisber is offline
BAILOPAN
Join Date: Jan 2004
Old 02-08-2009 , 15:22   Re: "Failed to load plugin..."
Reply With Quote #2

998 is a WinAPI error code, ERROR_NOACCESS. It sounds like a static constructor faulted while mapping your DLL into memory.

There aren't any in the code you pasted though, is it incomplete?
__________________
egg
BAILOPAN is offline
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 02-08-2009 , 15:56   Re: "Failed to load plugin..."
Reply With Quote #3

Hi.
Thanks for your help.
I don't know what you mean exactly. Here are the both files in complete. This are the only ones which I have included in my project solution currently.

http://dl.bmhost.de/TestPlugin.cpp.txt
http://dl.bmhost.de/TestPlugin.hpp.txt

Thanks,
- Chris
Chrisber is offline
BAILOPAN
Join Date: Jan 2004
Old 02-08-2009 , 16:23   Re: "Failed to load plugin..."
Reply With Quote #4

In the C++ code generation options make sure you're linking to the multithreaded runtime, and _not_ the multithreaded DLL runtime.

A static constructor would be something like:

Code:
class X {
public:
   X() { }
};

X x;
But it looks like you have nothing like that. Another thing to check in the project options is that the CPU settings are acceptable. For example, if you compile with SSE support and your CPU doesn't have that, you'll get problems.
__________________
egg
BAILOPAN is offline
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 02-08-2009 , 17:32   Re: "Failed to load plugin..."
Reply With Quote #5

Hi.
Ok, I've checked that. It's set to Multithreaded (/MT).
I've used the project files from the stub_mm, I changed nothing so I think that all options should be correct.
I've added a static constructor now and the other stuff which missed (sample_mm).
Error is the same.

http://dl.bmhost.de/TestPlugin.cpp.txt
http://dl.bmhost.de/TestPlugin.hpp.txt

I don't have any more ideas :/

Thanks,
- Chris

EDIT: Yippiii! I found out, that my plugin works well when I use the metaplugins.ini to load the plugin. My line:
Code:
addons/TestPlugin
But if I use the vdf Method, now another error appears:
Code:
Could not get IServerPluginCallbacks interface from plugin "../cstrike/addons/TestPlugin"
How can I reach that I can load my plugin by both methods?

Thanks,
Chris

Last edited by Chrisber; 02-08-2009 at 17:51.
Chrisber is offline
BAILOPAN
Join Date: Jan 2004
Old 02-08-2009 , 18:45   Re: "Failed to load plugin..."
Reply With Quote #6

Erm, I didn't mean you should add a static constructor, it was just an example of something which, when wrong, could cause your problem.

Your question could mean one of two things, I'm not sure which:
1. How to load MM:S plugins through a VDF?
2. How to loadplugins as both a MM:S and a Valve Server Plugin?

Assuming you meant #1, see here: http://wiki.alliedmods.net/Metamod:Source_VDF_Files

If it was #2, there's a more involved answer.
__________________
egg
BAILOPAN is offline
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 02-09-2009 , 09:19   Re: "Failed to load plugin..."
Reply With Quote #7

Hey.
I meant the first one. Loading my plugin by metaplugins.ini works perfectly, but trying it with the .vdf-method, this error appears:
Code:
Could not get IServerPluginCallbacks interface from plugin "../cstrike/addons/TestPlugin"
EDIT: Erm, I don't think it's possible to load a Metamod Plugin as a VSP?!

Thanks,
- Chris
Chrisber is offline
Keeper
Senior Member
Join Date: Nov 2006
Old 02-09-2009 , 11:57   Re: "Failed to load plugin..."
Reply With Quote #8

You can load a SourceMM plugin via the VDF method now, but not from the addons directory.

Look here: http://wiki.alliedmods.net/Metamod:Source_VDF_Files
Keeper is offline
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 02-09-2009 , 12:09   Re: "Failed to load plugin..."
Reply With Quote #9

Hi.
I know that! But it doesn't work like I've written above - the error appears if I want to load my plugin via the .vdf method.

Thanks,
- Chris
Chrisber is offline
Keeper
Senior Member
Join Date: Nov 2006
Old 02-09-2009 , 12:15   Re: "Failed to load plugin..."
Reply With Quote #10

How are you running SourceMM? gameinfo.txt? or as a VSP?
Keeper is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode