.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Metamod badf error, yet.... (http://forums.bots-united.com/showthread.php?t=3222)

stefanhendriks 17-12-2004 21:59

Metamod badf error, yet....
 
1 Attachment(s)
...

1) it compiles fine
2) it links fine
3) it is in the correct path
4) the only output i get is from the DLL Entrypoint function (DLLMain).
5) Its attaching/detaching for 3 times and then gives up

more details on: http://forums.bots-united.com/showth...?t=3221&page=2

* i made this post because the subject is not, could cause confusement.

I believe it is something in my code, probably something stupid, but i have no clue. So i have included the interface source files, perhaps someone can take a peek at it and point me to errors that could prevent loading this plugin in the first place.

Lazy 17-12-2004 22:20

Re: Metamod badf error, yet....
 
If I remember correctly, you must export GiveFnptrsToDll using a .def file.

stefanhendriks 17-12-2004 22:53

Re: Metamod badf error, yet....
 
i created a file with the .def extention, copied the contents and made it like this:

Code:

LIBRARY ITM_HL1_BOT_CSTRIKE
EXPORTS
 GiveFnptrsToDll  @1
SECTIONS
 .data READ WRITE

yet, i compile (rebuild all) and it still does not work. Perhaps i have to do this with MSVC or something? i have no clue how this works.

Lazy 17-12-2004 22:56

Re: Metamod badf error, yet....
 
Under your linker options you must set "Module Definition File" to your .def file.
If you create one with Visual Studio this is done automatically.

stefanhendriks 17-12-2004 22:57

Re: Metamod badf error, yet....
 
I took a look at the linking procedure, the .def file is included there... still it does not work :(

EDIT:
Just saw your post, digging into Linker options. (i am using MSVC 6.0), but so far no luck finding your "Modular bla" thingy..

stefanhendriks 17-12-2004 23:13

Re: Metamod badf error, yet....
 
I don't know why, but i tried it again with a rebuild all and it works now! :)

w00t.

@$3.1415rin 17-12-2004 23:31

Re: Metamod badf error, yet....
 
sometimes it's funny what a complete rebuild might do. in JoeBOT XP I have some .cpp files, where I need to rebuild everything before the bot runs. and the strange thing is that it's .cpp files. that some compilers sometimes make errors when a .h is changed, well, you get used to it ... but .cpp files ... dunno :P

stefanhendriks 18-12-2004 20:58

Re: Metamod badf error, yet....
 
rofl yeah.

Rebuild is magic ;) But the .DEF thingy is odd, i read some sources on the internet but they all create it with NEW->TEXT file and rename it to .def. And then it 'autocompiles' with it. Well, it worked, after A FEW rebuilds... :S

anyway, it works, w00t. And that means, my principle works. Because when i replace my interface with the empty one, it also compiles hehe.

Now, lets see if i can spawn a bot, and then i have an RACC-Like engine-independant mod. well, sorta hehe. VERY bare-boned, but working... :)

Whistler 19-12-2004 01:04

Re: Metamod badf error, yet....
 
you can look at jozef wagner's docs to see how to get rid of the .def file in MSVC...
http://forums.bots-united.com/showthread.php?t=2570

and MinGW doesn't need any .def files hehe :)

Pierre-Marie Baty 19-12-2004 20:16

Re: Metamod badf error, yet....
 
Yes, embedded linker directives in #pragma's are nice, however they don't allow the specification of undecorated names, that's why they have limited usefulness... For example, if this
Code:

#ifdef WIN32
#pragma comment(linker, "/EXPORT:GiveFnptrsToDll=_GiveFnptrsToDll@8,@1")
#pragma comment(linker, "/SECTION:.data,RW")
#endif

works for metamod plugins, it doesn't for hook DLLs. I believe MSVC doesn't decorate GiveFnptrsToDll the same way. And that sucks a bit. Anyway, it's not a MSVC-specific problem, any C++ compiler decorates function names to resolve overload ambiguities.

Cpl. Shrike 20-12-2004 11:09

Re: Metamod badf error, yet....
 
Maybe im getting it wrong but i use above code by korax to.
But im not doind a meta plugin. Just a hook dll like botmans template.

I like i said i might be getting it wrong. ???:(

Whistler 22-12-2004 07:36

Re: Metamod badf error, yet....
 
well AFAIK it works with both Metamod and botman-style DLL...
and YaPB and GINA bot is written in a "mixed" way of Metamod & botman-style dll and it also works


All times are GMT +2. The time now is 11:01.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.