Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
481
3,733
19,360
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Converting from GCC to G++
Forum Rules | Mark all | Recent Posts

Converting from GCC to G++
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 18, 2010, 6:33 pm
Go to the top of the page
Go to the bottom of the page

Atrox
Fledgling
GroupMembers
Posts19
JoinedFeb 14, 2005

So, I recently started converting my heavily modified SmaugFUSS 1.6 from compiling with GCC to G++. I used the most recent SmaugFUSS 1.9 as a reference, and FINALLY got it all compiling and linking properly today. Now, the problem is... the interpreter is crashing when trying to allocate memory for a temporary pointer to convert input from a normal character pointer to a constant.

Just as in the regular SmaugFUSS 1.9, I'm using this function for that:
(225)  void interpret( CHAR_DATA * ch, const char* argument)
(226)  {
(227)      char *temp = strdup(argument);
(228)      interpret(ch, temp);
(229)      free(temp);
(230)  }


In GDB, this is what I get:
#0  0xb7b6086c in _int_malloc () from /lib/libc.so.6
#1  0xb7b6250f in calloc () from /lib/libc.so.6
#2  0x080f47a0 in str_dup (str=0x86531f8 "who";) at db.c:3447
#3  0x0812d775 in interpret (ch=0x83a73e8, argument=0x86531f8 "who";) at interp.c:227
#4  0x0812d789 in interpret (ch=0x83a73e8, argument=0x86531e8 "who";) at interp.c:228
#5  0x0812d789 in interpret (ch=0x83a73e8, argument=0x86531d8 "who";) at interp.c:228


I'm kind of.. at a loss at this point. I'm not sure how it works fine in 1.9, but not for me. Can anyone help me out a bit here?
       
Post is unread #2 Mar 18, 2010, 8:25 pm
Go to the top of the page
Go to the bottom of the page

Atrox
Fledgling
GroupMembers
Posts19
JoinedFeb 14, 2005

Disregard, I fixed it.
       
Pages:<< prev 1 next >>