SF2Dlib gives Undefined Reference errors to Citro3D functions

Discussion in '3DS - Homebrew Development and Emulators' started by kprovost7314, Feb 26, 2017.

  1. kprovost7314
    OP

    kprovost7314 GBAtemp's Official Bara Master

    Member
    1,659
    841
    Dec 24, 2014
    United States
    In that bara manga ( ͡° ͜ʖ ͡°)
    For some reason SF2Dlib, along with the other "Simple Fast" libraries always outputs errors like these:

    Code:
    <image>.jpeg
    main.c
    arm-none-eabi-gcc -MMD -MP -MF /c/~/build/main.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=hard -I/c/~/include -IC:\devkitPro\libctru/include -I/c/devkitPro/portlibs/armv6k/include -I/c/devkitPro/portlibs/3ds/include -I/c/~/build -DARM11 -D_3DS -c/c/~/source/main.c -o main.o
    c:/~/source/main.c: In function 'main':
    c:/~/source/main.c:15:16: warning: unused variable 'tex1' [-Wunused-variable]
      sf2d_texture *tex1 = sfil_load_JPEG_buffer(<image>_jpeg, <image>_jpeg_size, SF2D_PLACE_RAM);
                   ^~~~
    linking sfil_sample.elf
    C:\devkitPro\libctru/lib\libsf2d.a(sf2d.o): In function `sf2d_fini':
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d.c:95: undefined reference to `C3D_Fini'
    C:\devkitPro\libctru/lib\libsf2d.a(sf2d.o): In function `sf2d_swapbuffers':
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d.c:154: undefined reference to `C3D_FrameEnd'
    C:\devkitPro\libctru/lib\libsf2d.a(sf2d.o): In function `sf2d_init_advanced':
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d.c:45: undefined reference to `C3D_Init'
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d.c:52: undefined reference to `C3D_RenderTargetSetOutput'
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d.c:53: undefined reference to `C3D_RenderTargetSetOutput'
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d.c:54: undefined reference to `C3D_RenderTargetSetOutput'
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d.c:70: undefined reference to `C3D_BindProgram'
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d.c:71: undefined reference to `C3D_CullFace'
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d.c:72: undefined reference to `C3D_DepthTest'
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d.c:85: undefined reference to `C3D_BoolUnifs'
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d.c:85: undefined reference to `C3D_BoolUnifsDirty'
    C:\devkitPro\libctru/lib\libsf2d.a(sf2d_texture.o): In function `sf2d_create_texture':
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d_texture.c:34: undefined reference to `C3D_TexInit'
    c:/`/Desktop/sf2dlib-master/libsf2d/source/sf2d_texture.c:44: undefined reference to `C3D_TexSetWrap'
    c:/Users/Kaleb/Desktop/sf2dlib-master/libsf2d/source/sf2d_texture.c:36: undefined reference to `C3D_TexInitVRAM'
    C:\devkitPro\libctru/lib\libsf2d.a(sf2d_texture.o): In function `sf2d_create_rendertarget':
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d_texture.c:53: undefined reference to `C3D_RenderTargetCreate'
    c:/~/Desktop/sf2dlib-master/libsf2d/source/sf2d_texture.c:60: undefined reference to `Mtx_OrthoTilt'
    C:\devkitPro\libctru/lib\libsf2d.a(sf2d_texture.o): In function `sf2d_clear_target':
    c:/`/Desktop/sf2dlib-master/libsf2d/source/sf2d_texture.c:81: undefined reference to `C3D_RenderTargetSetClear'
    collect2.exe: error: ld returned 1 exit status
    make[1]: *** [/c/~/sfil_sample.elf] Error 1
    make: *** [build] Error 2
    
     
  2. MaK11-12

    MaK11-12 GBAtemp Regular

    Member
    229
    115
    Jul 26, 2009
    Namek
    You need to compile citro3d as it's a dependency of sf2dlib.
     
  3. kprovost7314
    OP

    kprovost7314 GBAtemp's Official Bara Master

    Member
    1,659
    841
    Dec 24, 2014
    United States
    In that bara manga ( ͡° ͜ʖ ͡°)
    I did compile it already.
     
  4. MaK11-12

    MaK11-12 GBAtemp Regular

    Member
    229
    115
    Jul 26, 2009
    Namek
    Are you linking to citro3d by adding "-lcitro3d" to your compile command?
    Additionally, you may have to recompile sf2dlib if citro3d or ctrulib has been updated (i think).
     
  5. kprovost7314
    OP

    kprovost7314 GBAtemp's Official Bara Master

    Member
    1,659
    841
    Dec 24, 2014
    United States
    In that bara manga ( ͡° ͜ʖ ͡°)
    I added the link and it gave me the same error and recompiled with the error. But the errors direct to a sf2dlib folder on my Desktop, when that folder isn't even there.