.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Metamod badf error, yet....
Old
  (#1)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Metamod badf error, yet.... - 17-12-2004

...

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.
Attached Files
File Type: zip itm_interface_hl1.zip (15.9 KB, 331 views)


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Metamod badf error, yet....
Old
  (#2)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: Metamod badf error, yet.... - 17-12-2004

If I remember correctly, you must export GiveFnptrsToDll using a .def file.
  
Reply With Quote
Re: Metamod badf error, yet....
Old
  (#3)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Metamod badf error, yet.... - 17-12-2004

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.


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Metamod badf error, yet....
Old
  (#4)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: Metamod badf error, yet.... - 17-12-2004

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.
  
Reply With Quote
Re: Metamod badf error, yet....
Old
  (#5)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Metamod badf error, yet.... - 17-12-2004

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..


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me

Last edited by stefanhendriks; 17-12-2004 at 23:01..
  
Reply With Quote
Re: Metamod badf error, yet....
Old
  (#6)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Metamod badf error, yet.... - 17-12-2004

I don't know why, but i tried it again with a rebuild all and it works now!

.


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Metamod badf error, yet....
Old
  (#7)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Metamod badf error, yet.... - 17-12-2004

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


  
Reply With Quote
Re: Metamod badf error, yet....
Old
  (#8)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Metamod badf error, yet.... - 18-12-2004

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, . 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...


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Metamod badf error, yet....
Old
  (#9)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: Metamod badf error, yet.... - 19-12-2004

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
  
Reply With Quote
Re: Metamod badf error, yet....
Old
  (#10)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Metamod badf error, yet.... - 19-12-2004

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.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com