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

Solved Using MinGW to build Metamod plugin (badf load)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ezio_auditore
Senior Member
Join Date: May 2013
Old 07-22-2017 , 14:08   Using MinGW to build Metamod plugin (badf load)
Reply With Quote #1

Hi, all!

I understand that this is not the right place to post this, hence, I request admins to move this post to a more appropriate forum.

Peace.

-----------------------------------------------------------------------------------------------------------------

I am trying to learn how Metamod plugins work, so I compiled the stub_mm plugin with MinGW using the following commands.

Code:
gcc -D_WIN32 -IE:\hlsdk\common -IE:\hlsdk\dlls -IE:\hlsdk\engine -IE:\hlsdk\pm_shared -IE:\metamod -IE:\stub_plugin -O0 -g3 -Wall -c -fmessage-length=0 -oh_export.o ..\h_export.cpp
gcc -D_WIN32 -IE:\hlsdk\common -IE:\hlsdk\dlls -IE:\hlsdk\engine -IE:\hlsdk\pm_shared -IE:\metamod -IE:\stub_plugin -O0 -g3 -Wall -c -fmessage-length=0 -ometa_api.o ..\meta_api.cpp
gcc -D_WIN32 -IE:\hlsdk\common -IE:\hlsdk\dlls -IE:\hlsdk\engine -IE:\hlsdk\pm_shared -IE:\metamod -IE:\stub_plugin -O0 -g3 -Wall -c -fmessage-length=0 -odllapi.o ..\dllapi.cpp
gcc -D_WIN32 -IE:\hlsdk\common -IE:\hlsdk\dlls -IE:\hlsdk\engine -IE:\hlsdk\pm_shared -IE:\metamod -IE:\stub_plugin -O0 -g3 -Wall -c -fmessage-length=0 -osdk_util.o ..\sdk_util.cpp
gcc -D_WIN32 -IE:\hlsdk\common -IE:\hlsdk\dlls -IE:\hlsdk\engine -IE:\hlsdk\pm_shared -IE:\metamod -IE:\stub_plugin -O0 -g3 -Wall -c -fmessage-length=0 -oengine_api.o ..\engine_api.cpp
And
Code:
gcc -shared -oamx4j.dll sdk_util.o meta_api.o h_export.o engine_api.o dllapi.o
To generate the DLL.

The DLL file is being generated (size 1661KB) without any error, but Metamod cannot find the necessary functions...

These are the logs from Metamod:
PHP Code:
meta retry amx4j
L 07
/22/2017 22:56:36: [META] (debug:5dllno Meta_Init present in plugin '<amx4j.dll>'
L 07/22/2017 22:56:36: [METAWARNINGdllFailed query plugin '<amx4j.dll>'Couldn't find GiveFnptrsToDll(): The specified procedure could not be found.

L 07/22/2017 - 22:56:36: [META] WARNING: dll: Skipping plugin '
<amx4j.dll>'; couldn't query
Retry failed 
for plugin '<amx4j.dll>'
meta retry amx4j 
L 07
/22/2017 23:12:03: [META] (debug:5dllno Meta_Init present in plugin '<amx4j.dll>'
L 07/22/2017 23:12:03: [METAWARNINGdllFailed query plugin '<amx4j.dll>'Couldn't find GiveFnptrsToDll(): The specified procedure could not be found.

L 07/22/2017 - 23:12:03: [META] WARNING: dll: Skipping plugin '
<amx4j.dll>'; couldn't query
Retry failed 
for plugin 
Then I used Eclipse's Object Browser to check the .o files and found out that the functions are there.

.

Output of meta info
Spoiler


Complete compilation log
Spoiler


Let's hope I find reasonable answers and solution to my problem
Attached Thumbnails
Click image for larger version

Name:	Untitled.png
Views:	64
Size:	6.3 KB
ID:	164351  
__________________

Last edited by ezio_auditore; 07-23-2017 at 02:22.
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 07-22-2017 , 17:28   Re: Using MinGW to build Metamod plugin (badf load)
Reply With Quote #2

Quote:
Originally Posted by ezio_auditore View Post
And
Code:
gcc -shared -oamx4j.dll sdk_util.o meta_api.o h_export.o engine_api.o dllapi.o
To generate the DLL.
Try to add -Wl,--kill-at here.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
ezio_auditore
Senior Member
Join Date: May 2013
Old 07-23-2017 , 02:21   Re: Using MinGW to build Metamod plugin (badf load)
Reply With Quote #3

Got it to work.

Strange, but the IDE was causing issues here...
Now I made a script that compiles + deploys the DLL to the game. Thanks
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
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 16:32.


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