[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  ROM
. -> [Folder]  Compiling the server
. . -> [Subject]  Help me? Pretty please?

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Help me? Pretty please?
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Samson   USA  (683 posts)  [Biography] bio
Date Tue 25 Apr 2006 11:32 AM (UTC)  quote  ]

Amended on Tue 25 Apr 2006 11:35 AM (UTC) by Samson

Message
BTW, just to keep the record straight, AFKMud is not a ROM derivative and would not have been subject to this problem :)

The compiler error encountered is usually because you have a function sharing the same name as one from the standard includes. I don't recall hitting this with any of the stock Rom derivs I've tested but it is possible one or more flavors of GCC are to blame for this.

Best bet, find and rename the "getline" function in whatever file it's located in. Then rename all of the calls within the code to use the new name.

SmaugMuds.org: http://www.smaugmuds.org - The Smaug MUDs Community Center

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Mon 24 Apr 2006 09:50 PM (UTC)  quote  ]
Message
What is your operating system? What is your environment?

The getline problem has been covered here before; have you tried searching in the ROM section?
Basically you'll need to rename the function to something else, and change all references to getline in your source code to your new function name.


Also, please use the code tag when posting code.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Demitrus   (3 posts)  [Biography] bio
Date Mon 24 Apr 2006 09:49 PM (UTC)  quote  ]
Message
I forgot the closing bracket, heres the correct two sections of code -

char *numlineas( char *string )
{
int cnt = 1;
static char buf[MAX_STRING_LENGTH*2];
char buf2[MAX_STRING_LENGTH], tmpb[MAX_STRING_LENGTH];

buf[0] = '\0';

while ( *string )
{
string = getline( string, tmpb );
sprintf( buf2, "%2d. %s\n\r", cnt++, tmpb );
strcat( buf, buf2 );
}

return buf;
}

/* buf queda con la linea sin \n\r */
char *getline( char *str, char *buf )
{
int tmp = 0;
bool found = FALSE;

while ( *str )
{
if ( *str == '\n' )
{
found = TRUE;
break;
}

buf[tmp++] = *(str++);
}

if ( found )
{
if ( *(str + 1) == '\r' )
str += 2;
else
str += 1;
} /* para que quedemos en el inicio de la prox linea */

buf[tmp] = '\0';

return str;
}
[Go to top] top

Posted by Demitrus   (3 posts)  [Biography] bio
Date Mon 24 Apr 2006 09:47 PM (UTC)  quote  ]
Message
char *numlineas( char *string )
{
int cnt = 1;
static char buf[MAX_STRING_LENGTH*2];
char buf2[MAX_STRING_LENGTH], tmpb[MAX_STRING_LENGTH];

buf[0] = '\0';

while ( *string )
{
string = getline( string, tmpb );
sprintf( buf2, "%2d. %s\n\r", cnt++, tmpb );
strcat( buf, buf2 );
}

return buf;
}

/* buf queda con la linea sin \n\r */
char *getline( char *str, char *buf )
{
int tmp = 0;
bool found = FALSE;

while ( *str )
{
if ( *str == '\n' )
{
found = TRUE;
break;
}

buf[tmp++] = *(str++);
}

if ( found )
{
if ( *(str + 1) == '\r' )
str += 2;
else
str += 1;
} /* para que quedemos en el inicio de la prox linea */

buf[tmp] = '\0';

return str;


----------
Those are the two parts of code im having trouble with. Well, just one, for now. The getline.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Mon 24 Apr 2006 09:30 PM (UTC)  quote  ]
Message
What is your operating system? What is your environment? What is on line 699 of string.c?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Demitrus   (3 posts)  [Biography] bio
Date Mon 24 Apr 2006 09:21 PM (UTC)  quote  ]
Message
Alright, this becoming a rather large headache, and I get the same exact error for all the codebases I have tried to compile - From Dawn, to Rom24b6, To startermud, afkmud, basically every rom deritive in existance. Heres the problem:

string.c:699: error: conflicting types for 'getline'
/usr/include/sys/stdio.h:31: error: previous declaration of 'getline' was here
string.c:699: error: conflicting types for 'getline'
/usr/include/sys/stdio.h:31: error: previous declaration of 'getline' was here
make: *** [string.o] Error 1

---

Basically thats the error I get for every single codebase I try to compile. Any help would be greatly appreciated.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


2,492 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]