undefined reference to `strtoimax'

4 posts / 0 new
Last post
jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
undefined reference to `strtoimax'

Hi, I get a couple of "undefined reference to `strtoimax'" on linking stage:
gcc main.o data.o seg000.o seg001.o seg002.o seg003.o seg004.o seg005.o seg006.o seg007.o seg008.o seg009.o seqtbl.o replay.o options.o lighting.o screenshot.o menu.o midi.o opl3.o stb_vorbis.o -o ../prince -lSDL2_image -ltiff -lpng -ljpeg -lz -lvorbisfile -lvorbis -logg -lSDL2 -lm
options.o: In function `ini_process_word.part.2':
options.c:135: undefined reference to `strtoimax'
options.o: In function `ini_process_byte.part.3':
options.c:137: undefined reference to `strtoimax'
options.o: In function `ini_process_sbyte.part.4':
options.c:138: undefined reference to `strtoimax'
options.o: In function `global_ini_callback':
options.c:139: undefined reference to `strtoimax'
options.c:136: undefined reference to `strtoimax'
...

and line/code is:
*target = (named_value == INI_NO_VALID_NAME) ? ((data_type) strtoimax(value, NULL, 0)) : ((data_type) named_value);
...

using newlib (latest AFAIK), and compiling on AmigaOS4/SAM460ex.

Is such function impletemented?

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Re: undefined reference to `strtoimax'

Workaround'ed by using:

#define strtoimax(a,b,c) strtol(a,b,c)

Hope it doesn't break antything.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

salass00
salass00's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2011-02-03 11:27
Re: undefined reference to `strtoimax'

intmax_t should be defined as "signed long long", so strtoll() would be a more appropriate replacement.

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Re: undefined reference to `strtoimax'

THX changed to use strtoll()

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

Log in or register to post comments