View unanswered posts | View active topics It is currently Sun Apr 22, 2018 12:01 am



Reply to topic  [ 3 posts ] 
 I can not compile a c file that uses citro3d 
Author Message

Joined: Wed Mar 28, 2018 6:58 pm
Posts: 2
I can not compile a c file that uses citro3d

Code:
linking myown3dsgame.elf
C:/devkitPro/libctru/lib\libcitro3d.a(base.o): In function `C3D_Init':
/home/fincs/releases/ctrulib/citro3d/source/base.c:99: undefined reference to `gxCmdQueueRun'
/home/fincs/releases/ctrulib/citro3d/source/base.c:94: undefined reference to `gpuCmdBufSize'
/home/fincs/releases/ctrulib/citro3d/source/base.c:94: undefined reference to `gpuCmdBuf'
/home/fincs/releases/ctrulib/citro3d/source/base.c:94: undefined reference to `gpuCmdBufOffset'
C:/devkitPro/libctru/lib\libcitro3d.a(base.o): In function `C3D_Fini':
/home/fincs/releases/ctrulib/citro3d/source/base.c:356: undefined reference to `gxCmdQueueStop'
/home/fincs/releases/ctrulib/citro3d/source/base.c:357: undefined reference to `gxCmdQueueWait'
C:/devkitPro/libctru/lib\libcitro3d.a(renderqueue.o): In function `C3Di_WaitAndClearQueue':
/home/fincs/releases/ctrulib/citro3d/source/renderqueue.c:131: undefined reference to `gxCmdQueueWait'
/home/fincs/releases/ctrulib/citro3d/source/renderqueue.c:137: undefined reference to `gxCmdQueueStop'
/home/fincs/releases/ctrulib/citro3d/source/renderqueue.c:138: undefined reference to `gxCmdQueueClear'
/home/fincs/releases/ctrulib/citro3d/source/renderqueue.c:137: undefined reference to `gxCmdQueueStop'
/home/fincs/releases/ctrulib/citro3d/source/renderqueue.c:138: undefined reference to `gxCmdQueueClear'
C:/devkitPro/libctru/lib\libcitro3d.a(renderqueue.o): In function `onQueueFinish':
/home/fincs/releases/ctrulib/citro3d/source/renderqueue.c:98: undefined reference to `gxCmdQueueStop'
/home/fincs/releases/ctrulib/citro3d/source/renderqueue.c:99: undefined reference to `gxCmdQueueClear'
C:/devkitPro/libctru/lib\libcitro3d.a(effect.o): In function `C3D_DepthMap':
/home/fincs/releases/ctrulib/citro3d/source/effect.c:14: undefined reference to `f32tof24'
/home/fincs/releases/ctrulib/citro3d/source/effect.c:15: undefined reference to `f32tof24'
C:/devkitPro/libctru/lib\libcitro3d.a(effect.o): In function `C3D_FragOpShadow':
/home/fincs/releases/ctrulib/citro3d/source/effect.c:87: undefined reference to `f32tof16'
/home/fincs/releases/ctrulib/citro3d/source/effect.c:87: undefined reference to `f32tof16'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/opt/devkitpro/devkitARM/3ds_rules:40: /c/myown3dsgame/myown3dsgame.elf] Error 1
make: *** [Makefile:136: build] Error 2


Makefile contains the
Code:
LIBS   := -lctru -lm -lcitro3d
line

main.c
Code:
#include <3ds.h>
#include <stdio.h>
#include <citro3d.h>

int main(int argc, char **argv)
{

gfxInitDefault();
C3D_Init(C3D_DEFAULT_CMDBUF_SIZE);
C3D_RenderTarget* target = C3D_RenderTargetCreate(240, 400, GPU_RB_RGBA8, GPU_RB_DEPTH24_STENCIL8);
C3D_RenderTargetSetClear(target, C3D_CLEAR_ALL, 0xFF0505, 0);
u32 transferFlags = GX_TRANSFER_FLIP_VERT(false)|
GX_TRANSFER_OUT_TILED(false)|
GX_TRANSFER_RAW_COPY(false)|
GX_TRANSFER_IN_FORMAT(GX_TRANSFER_FMT_RGBA8)|
GX_TRANSFER_OUT_FORMAT(GX_TRANSFER_FMT_RGBA8)|
GX_TRANSFER_SCALING(GX_TRANSFER_SCALE_XY);
C3D_RenderTargetSetOutput(target, GFX_TOP, GFX_LEFT, transferFlags);
while (aptMainLoop())
{

hidScanInput();
u32 kDown = hidKeysDown();
gfxFlushBuffers();
gfxSwapBuffers();
gspWaitForVBlank();
}

C3D_Fini();
gfxExit();
return 0;
}


I have a full devkitpro installation.
I am on the newest version (2.2.1)


Wed Mar 28, 2018 7:04 pm
Profile
Site Admin

Joined: Tue Aug 09, 2005 3:21 am
Posts: 1219
Location: UK
miterosan wrote:
Makefile contains the
Code:
LIBS   := -lctru -lm -lcitro3d
line


link order matters. citro3d uses functions from libctru so -lcitro3d must come before -lctru
Code:
LIBS   := -lcitro3d -lctru -lm

_________________
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog


Fri Mar 30, 2018 2:07 am
Profile ICQ WWW

Joined: Wed Mar 28, 2018 6:58 pm
Posts: 2
Thank you!


Fri Mar 30, 2018 6:51 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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