EoD with Cygwin.

Posted by Aha McCoy on Tue 01 Mar 2005 11:22 PM — 17 posts, 62,254 views.

USA #0
The error is an a reference error to gethostbyaddr_r....Is there a weay I can bypass this?
Canada #1
Ah.... whats the error? Copy the exact error, what version of code are you using, and when is it occuring? Compile? Run time?
USA #2
comm.o(.text+0x1030):comm.c: undefined reference to `_gethostbyaddr_r'



I know there's a way to fix it, but I don't remember the way. x.x


The EoD base is the one on MudMagic.
USA #3
Samson already gave you a suggestion of what seems to be the most likely culprit:
Quote:
It doesn't have it because it's entirely possible Cygwin doesn't have the functions the header is declaring. Best bet: disable the backtracing stuff when using Cygwin.
So, you should just disable that part of the code.
USA #4
Tried that, it needs to be changed to a certain format, it's not having a BrackTrace error....
Amended on Wed 02 Mar 2005 05:12 PM by Aha McCoy
USA #5
Ah... err... no. You could not have tried that because it would have worked. :-)

He did not say it was generating a backtracing error. He said to disable the backtracing which means to comment out the code that does a reverse DNS lookup on incoming connections.
USA #6
Uh...........What do I put?



And where?

Edit: grep backtracing *.* showed me nothing at all.
Amended on Wed 02 Mar 2005 07:06 PM by Aha McCoy
USA #7
As I said:
Quote:
He said to disable the backtracing which means to comment out the code that does a reverse DNS lookup on incoming connections.
The part that does the reverse DNS lookup is precisely the function that is giving you trouble. You should be able to just comment it out and things should work. Probably. :)

You might want to find a codebase for Cygwin specifically, or better yet for Win32 if that's where you're running your code.
USA #8
What exactly IS the function? x.x
USA #9
Look at your error message, that tells you what function it is not finding in the link phase. You want to remove the part of code that refers to that function.
USA #10
I tried removing it before, but it ****ed up....
Amended on Wed 02 Mar 2005 10:17 PM by Aha McCoy
USA #11
Please be more specific and also please mind your language on this public forum.
USA #12
I'm sorry.....


Can yopu help me make a line fix to it?


There's a sertain line where it'll work....
USA #13
I don't have the code in front of me so I don't know exactly how to fix it. Could you post the lines surrounding the error?
USA #14
Well........Here's the function where the error is......:


void lookup_address(DUMMY_ARG *darg)
{
struct hostent *from = 0;
struct hostent ent;
char buf[16384]; // enough ??
int err;

thread_count++;

gethostbyaddr_r( darg->buf, sizeof(darg->buf), AF_INET, &ent, buf, 16384, &from, &err);

if (from && from->h_name)
{
free_string(darg->d->host);
darg->d->host = str_dup(from->h_name);
}

/*
* Brilliant system there Mr. Jobo
*/
darg->d->lookup_status++;

free_string(darg->buf);
darg->status = 0;

thread_count--;

pthread_exit(0);
}
USA #15
Quote:

He said to disable the backtracing which means to comment out the code that does a reverse DNS lookup on incoming connections.


Actually, I wasn't referring to his DNS code, since I wasn't aware at the time he even had a problem with it. The stuff he was talking about before was some kind of backtracing thing, likely in the bug() function, which probably does the same thing mine does in AFKMud. Only it wasn't "Cygwin guarded" in the EoD source.

McCoy:

Personally I would suggest that you might be better off with a codebase that's more compatible with Cygwin if that's the environment you've chosen, or are stuck with. Alot of these Godwars derived bases have some more advanced features that will only work on a true Linux system.
USA #16
I got it now, Sakalav ****ed aroudn with comm.c until it worked. ^^