View unanswered posts | View active topics It is currently Sat Nov 17, 2018 8:58 pm



Reply to topic  [ 3 posts ] 
 linker error: undefined reference to `__ctype_ptr__' 
Author Message

Joined: Sun Jun 24, 2018 11:45 am
Posts: 2
Hi,
I am trying to compile a little program I have written. I am using tonclib and the tonc text engine. However the linker throws the following errors:

Code:
Linking cartridge
arm-none-eabi-gcc -specs=gba.specs -mthumb-interwork -mthumb -Wl,-Map,rpg_demo_test_compile.map gfx_rain_2.o gfx_rain_3.o gfx_rain_4.o gfx_randy.o gfx_rain_1.o gfx_randy_shadow.o gfx_night.o gfx_world.o gfx_rabite.o engine_background_packer.o adt_double_linked_list.o engine_camera.o obj_randy.o engine_sprite.o engine_background.o main.o obj_randy_shadow.o obj_rabite.o   -L/home/pepe/Desktop/gba_dev/rpg_demo_test_compile -L/home/pepe/Desktop/gba_dev/rpg_demo_test_compile//tonclib/lib -ltonc -lm -o /home/pepe/Desktop/gba_dev/rpg_demo_test_compile/rpg_demo_test_compile.elf   
/home/pepe/Desktop/gba_dev/rpg_demo_test_compile//tonclib/lib/libtonc.a(tte_main.o): In function `tte_cmd_next':
tte_main.c:(.text+0x240): undefined reference to `__ctype_ptr__'
/home/pepe/Desktop/gba_dev/rpg_demo_test_compile//tonclib/lib/libtonc.a(tte_main.o): In function `tte_cmd_default':
tte_main.c:(.text+0x614): undefined reference to `__ctype_ptr__'
tte_main.c:(.text+0x7b4): undefined reference to `__ctype_ptr__'
collect2: error: ld returned 1 exit status
/home/pepe/Desktop/gba_dev/rpg_demo_test_compile//tonc_rules:41: recipe for target '/home/pepe/Desktop/gba_dev/rpg_demo_test_compile/rpg_demo_test_compile.elf' failed
make[1]: *** [/home/pepe/Desktop/gba_dev/rpg_demo_test_compile/rpg_demo_test_compile.elf] Error 1
Makefile:155: recipe for target 'build' failed
make: *** [build] Error 2


I already read this thread https://devkitpro.org/viewtopic.php?t=1600, and tried to add -lg to the linker flags, however this did not work.

The code with the Makefile did compile and link correctly in the past, but not anymore.

Can someone please help me?


Sun Jun 24, 2018 2:18 pm
Profile
Online
Site Admin

Joined: Tue Aug 09, 2005 3:21 am
Posts: 1300
Location: UK
libtonc needs rebuilt with latest toolchain.

I've added a libtonc package so you can install that with pacman -S libtonc then use -I$(DEVKITPRO)/libtonc/include for your includes & -L$(DEVKITPRO)/libtonc/lib for your libraries.

I'll have a look at adding templates & the tonc example code later, just need to check over some things with Cearn.

_________________
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog


Mon Jun 25, 2018 3:26 pm
Profile ICQ WWW

Joined: Sun Jun 24, 2018 11:45 am
Posts: 2
Wow, how embarrassing that I didn't think of this.

Thanks Dave, that solved my issue.


Tue Jun 26, 2018 5:13 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
  Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.
Get devkitPro at SourceForge.net. Fast, secure and Free Open Source software downloads