Plugin does not conform to architecture
#1

As stated in the topic i get this from server when trying to load the helloworld.dll plugin:

"Plugin does not conform to architecture."

Strange cuz helloworld was compiled and linked on the same windows machine as the sa-mp server is running..Any ideas to solve this??

I would have liked to compile with nmake to get all options right, but nmake just dont understand the contents of makefile.w32 which comes with sdk:

"NMAKE : fatal error U1077: 'options' : return code '0x1'
Stop."

Here is buildlog:


Code:
Build Log   ------- Build started: Project: firstplugin, Configuration: Release|Win32 -------

 Command Lines   This edition of Visual C++ does not support the optimizing compiler.
Creating temporary file "c:\Documents and Settings\Administrator\Dokumenter\Visual Studio Projects\firstplugin\Release\RSP00009C.rsp" with contents
[
/D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_MBCS" /FD /EHsc /MDd /GS /Fo"Release/" /Fd"Release/vc70.pdb" /W3 /c /Wp64 /Zi /TP /Od /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /Gm /EHsc /RTC1 /MDd /W3 /nologo /c /Wp64 /ZI /TP
"\Documents and Settings\Administrator\Dokumenter\Modtagne filer\Sdk\amxplugin.cpp"
"\Documents and Settings\Administrator\Dokumenter\Modtagne filer\HelloWorld\helloworld.cpp"
]
Creating command line "cl.exe @"c:\Documents and Settings\Administrator\Dokumenter\Visual Studio Projects\firstplugin\Release\RSP00009C.rsp" /nologo"
Creating temporary file "c:\Documents and Settings\Administrator\Dokumenter\Visual Studio Projects\firstplugin\Release\RSP00009D.rsp" with contents
[
/D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_MBCS" /FD /EHsc /MDd /GS /Fo"Release/" /Fd"Release/vc70.pdb" /W3 /c /Wp64 /Zi /TC /Od /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /Gm /EHsc /RTC1 /MDd /W3 /nologo /c /Wp64 /ZI /TP
"\Documents and Settings\Administrator\Dokumenter\Modtagne filer\Sdk\amx\getch.c"
]
Creating command line "cl.exe @"c:\Documents and Settings\Administrator\Dokumenter\Visual Studio Projects\firstplugin\Release\RSP00009D.rsp" /nologo"
Creating temporary file "c:\Documents and Settings\Administrator\Dokumenter\Visual Studio Projects\firstplugin\Release\RSP00009E.rsp" with contents
[
/OUT:"Release/firstplugin.dll" /INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /MACHINE:X86 /MANIFEST:NO /MAP:"helloworld.map" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\release\helloworld.obj"
".\release\getch.obj"
".\release\amxplugin.obj"
]
Creating command line "link.exe @"c:\Documents and Settings\Administrator\Dokumenter\Visual Studio Projects\firstplugin\Release\RSP00009E.rsp""
 Output Window   Compiling...
amxplugin.cpp
helloworld.cpp
Generating Code...
Compiling...
cl : Command line warning D4025 : overriding '/TC' with '/TP'
getch.c
Linking...
LINK : warning LNK4044: unrecognized option '/MANIFEST:NO'; ignored
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
 Results   Build log was saved at "file://c:\Documents and Settings\Administrator\Dokumenter\Visual Studio Projects\firstplugin\Release\BuildLog.htm"
firstplugin - 0 error(s), 3 warning(s)
Im stuck here..
Reply
#2

Make sure the following functions are exported:
Supports
Load
Unload
AmxLoad
AmxUnload

I know that error occurs when they are not exported, but could also be something else causes the error.
Reply
#3

Well im just building the helloworld example from the SDK so it really shouldnt be an export problem. I think i will try compiling command line next.
Reply
#4

Quote:
Originally Posted by PsYcHoGoD
Make sure the following functions are exported:
Supports
Load
Unload
AmxLoad
AmxUnload

I know that error occurs when they are not exported, but could also be something else causes the error.
Yes! you where right on the spot here..Thx man

Although i was just building the helloworld example from the SDK i was unable to load the project as im using an older version off visual c++ so the .def file with the exports didnt get into the project, so:

Under linker options -> input -> module definition file i specified the helloworld.def (came with SDK)file and now the plugin gets loaded fine.

So the conclusion to the question, "what does Plugin does not conform to architecture mean?", in this case the architecture meant the plugin structure where not followed as the functons was not exported and could not be called in the dll from the amx file.

Reply
#5

Hi all!

I would be a trouble of mine like this. A gang plugin I wrote. The translator signals an any kind of mistake at me.

Quote:
Originally Posted by PsYcHoGoD
Make sure the following functions are exported:
Supports
Load
Unload
AmxLoad
AmxUnload

I know that error occurs when they are not exported, but could also be something else causes the error.
exported

PLS Help!

Here is buildlog:
Code:
# Project: gang
# Makefile created by Dev-C++ 4.9.9.2

CPP = g++.exe
CC  = gcc.exe
WINDRES = windres.exe
RES = gang_private.res
OBJ = C:/Dev-Cpp/Templates/gang.o C:/Dev-Cpp/include/SDK/amxplugin.o $(RES)
LINKOBJ = C:/Dev-Cpp/Templates/gang.o C:/Dev-Cpp/include/SDK/amxplugin.o $(RES)
LIBS = -L"C:/Dev-Cpp/lib" --no-export-all-symbols --add-stdcall-alias 
INCS = -I"C:/Dev-Cpp/include" 
CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" 
BIN = gang.dll
CXXFLAGS = $(CXXINCS) -DBUILDING_DLL=1 
CFLAGS = $(INCS) -DBUILDING_DLL=1 
RM = rm -f

.PHONY: all all-before all-after clean clean-custom

all: all-before gang.dll all-after


clean: clean-custom
	${RM} $(OBJ) $(BIN)

DLLWRAP=dllwrap.exe
DEFFILE=libgang.def
STATICLIB=libgang.a

$(BIN): $(LINKOBJ)
	$(DLLWRAP) --output-def $(DEFFILE) --driver-name c++ --implib $(STATICLIB) $(LINKOBJ) $(LIBS) -o $(BIN)

C:/Dev-Cpp/Templates/gang.o: C:/Dev-Cpp/Templates/gang.cpp
	$(CPP) -c C:/Dev-Cpp/Templates/gang.cpp -o C:/Dev-Cpp/Templates/gang.o $(CXXFLAGS)

C:/Dev-Cpp/include/SDK/amxplugin.o: C:/Dev-Cpp/include/SDK/amxplugin.cpp
	$(CPP) -c C:/Dev-Cpp/include/SDK/amxplugin.cpp -o C:/Dev-Cpp/include/SDK/amxplugin.o $(CXXFLAGS)

gang_private.res: gang_private.rc 
	$(WINDRES) -i gang_private.rc --input-format=rc -o gang_private.res -O coff
Reply
#6

Yes... I exported, but plugin is wrong. (Plugin does not conform to architecture -.-")

Gamestar
Reply
#7

I have the same problem too
I just wanted to include a library but ever when i call a function from the lib i get the "does not conform"
error... but when i do not call functions from the library i get no error
Is there a special trick or something to include a library?
Oh, and export the functions (Load, Unload, etc.) ...

Help would be very appreciated...

Edit:
I use MinGW with Code::Blocks

( sry for bad english -.-" )
Reply
#8

You can do exports like this with mingw and that stuff:

Code:
#define MYEXPORT extern "C" __declspec(dllexport)
MYEXPORT int MyFunctionIWantToExport(int bla)
{
   return 1337;
}
Reply
#9

Quote:
Originally Posted by !MaVe
You can do exports like this with mingw and that stuff:

Code:
#define MYEXPORT extern "C" __declspec(dllexport)
MYEXPORT int MyFunctionIWantToExport(int bla)
{
  return 1337;
}
If your using a definition file you don't need to use declspec.
Reply
#10

A tip if others still experience this problem and are using linux: do not link your plugin against libpthread, it will work fine without it even if you are using it in your code. Hope this helps.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)