|
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Mon Sep 06, 2010 12:58 pm Post subject: MERVBot with Eclipse? |
|
|
|
|
Anyone ever made mervbot plugins with Eclipse?
I seem to be having trouble getting it to run properly...
I installed MinGW, all the include paths are set...
I get dozens of errors like this:
..\spawn.cpp:583:37: error: no matching function for call to 'botInfo::tell(BotEvent)'
Everytime a tell is called, like:
void botInfo::sendPublic(char *msg)
{
tell(makeSay(MSG_Public, 0, 0, msg));
} |
This refers to this function:
void botInfo::tell(BotEvent &event)
{
if (callback && handle)
{
event.handle = handle;
callback(event);
}
} |
What is the '&' for in the declaration?
Edit: Apparently void (int *a) { *a += 5; } is equivalent to void (int &a) { a += 5; } , looks confusing to me, but whatever (Thanks to JoWiE)
Also, a bunch of these:
..\spawn.cpp:205:38: error: cast from 'void*' to 'Uint16' loses precision
These aren't warnings, they're errors...
I also get hundreds of these warnings:
..\/..\player.cpp:89:19: warning: deprecated conversion from string constant to 'char*'
Anytime a "string" is passed to a function that takes a char*
What's wrong? _________________ (Insert a bunch of dead links here)
Last edited by Samapico on Mon Sep 06, 2010 2:21 pm, edited 1 time in total |
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Mon Sep 06, 2010 1:57 pm Post subject: |
|
|
|
|
I'm on windows 7 x64, if that's any help |
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Mon Sep 06, 2010 3:17 pm Post subject: |
|
|
|
|
Got rid of the "cast from 'void*' to 'Uint16' loses precision " errors by changing all these casts to 'int'. void* and int are guaranteed to be the same size, so I guess g++ likes that more, or something.
Stuck with:
..\spawn.cpp:588:39: error: no matching function for call to 'botInfo::tell(BotEvent)'
..\spawn.cpp:41:6: note: candidate is: void botInfo::tell(BotEvent&)
hmm |
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Mon Sep 06, 2010 3:27 pm Post subject: |
|
|
|
|
Possible solution:
void botInfo::sendPublic(char *msg)
{
tell(makeSay(MSG_Public, 0, 0, msg));
} |
changed to:
void botInfo::sendPublic(char *msg)
{
BotEvent evt = makeSay(MSG_Public, 0, 0, msg)
tell(evt);
} |
Yep... that did the trick... was a pain in the butt to change all over the place though. |
|
Back to top |
|
|
cycad Novice
Gender: Joined: Feb 12 2004 Posts: 29 Offline
|
Posted: Tue Sep 07, 2010 2:46 pm Post subject: |
|
|
|
|
Careful, void* and int aren't necessarily the same size on x64, and I don't know of any standard that guarantees they would be.
As for the string conversion warnings, you can disable them with -Wno-write-strings |
|
Back to top |
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 1220 page(s) served in previous 5 minutes.
|