Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with SDL2/SDL_mixer #58

Closed
xfangfang opened this issue Sep 9, 2020 · 1 comment
Closed

error with SDL2/SDL_mixer #58

xfangfang opened this issue Sep 9, 2020 · 1 comment

Comments

@xfangfang
Copy link

I'm trying to port a game developed by sdl2. And this game uses SDL_ mixer to play sound. But when I link the SDL_mixer in cmake, it doesn't compile properly.

I try to test SDL_mixer in a new project:

...
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>
int main(void) {
    if (SDL_Init(SDL_INIT_AUDIO) == -1) return -1;
    Mix_Music *sound=Mix_LoadMUS("ux0:data/sound.wav");
...

here is my target_link_libraries:

target_link_libraries(${PROJECT_NAME}
  SDL2
  SDL2_mixer
  mikmod
  flac
  mpg123
  vorbisfile
  ogg
  opus
  modplug
  m
  vita2d
  SceDisplay_stub
  SceCtrl_stub
  SceAudio_stub
  SceSysmodule_stub
  SceGxm_stub
  SceCommonDialog_stub
  SceAppMgr_stub
  SceTouch_stub
  SceMotion_stub
  SceHid_stub
)

And I got:

/usr/local/bin/cmake --build /Users/fang/Desktop/xfang/psv/samples/build --config Debug --target all -- -j 14
[build] Scanning dependencies of target audio_sample
[build] [ 14%] Building C object audio/CMakeFiles/audio_sample.dir/src/main.c.obj
[build] [ 28%] Linking C executable audio_sample
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libSDL2_mixer.a(mixer.o): in function `Mix_LoadWAV_RW':
[build] (.text+0x242): undefined reference to `SDL_LoadWAV_RW'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `_initial_pcmoffset':
[build] (.text+0x412): undefined reference to `vorbis_packet_blocksize'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `ov_raw_seek':
[build] (.text+0x740): undefined reference to `vorbis_dsp_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x748): undefined reference to `vorbis_block_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x766): undefined reference to `vorbis_synthesis_restart'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x832): undefined reference to `vorbis_packet_blocksize'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x998): undefined reference to `vorbis_dsp_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x99e): undefined reference to `vorbis_block_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xa2a): undefined reference to `vorbis_dsp_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xa32): undefined reference to `vorbis_block_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `_fetch_headers.constprop.0':
[build] (.text+0xa6a): undefined reference to `vorbis_info_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xa70): undefined reference to `vorbis_comment_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xba2): undefined reference to `vorbis_synthesis_headerin'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xbde): undefined reference to `vorbis_info_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xbe4): undefined reference to `vorbis_comment_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xc2a): undefined reference to `vorbis_synthesis_idheader'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xc40): undefined reference to `vorbis_synthesis_headerin'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `_fetch_and_process_packet.constprop.1':
[build] (.text+0xf2a): undefined reference to `vorbis_dsp_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xf30): undefined reference to `vorbis_block_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xf7c): undefined reference to `vorbis_info_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xf82): undefined reference to `vorbis_comment_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xfa6): undefined reference to `vorbis_synthesis_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xfb4): undefined reference to `vorbis_block_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xfca): undefined reference to `vorbis_synthesis_halfrate_p'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0xfda): undefined reference to `vorbis_synthesis'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x1008): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x101e): undefined reference to `vorbis_synthesis_blockin'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x1026): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x108c): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x10e2): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `ov_pcm_seek.part.0':
[build] (.text+0x1178): undefined reference to `vorbis_synthesis_halfrate_p'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x11f8): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x1210): undefined reference to `vorbis_synthesis_read'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x12b2): undefined reference to `vorbis_packet_blocksize'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x12de): undefined reference to `vorbis_info_blocksize'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x130a): undefined reference to `vorbis_synthesis_trackonly'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x1314): undefined reference to `vorbis_synthesis_blockin'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x1372): undefined reference to `vorbis_synthesis_read'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x139e): undefined reference to `vorbis_dsp_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x13a6): undefined reference to `vorbis_block_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x1404): undefined reference to `vorbis_synthesis_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x1410): undefined reference to `vorbis_block_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `ov_read_filter.part.0':
[build] (.text+0x14a8): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x176c): undefined reference to `vorbis_synthesis_read'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x1772): undefined reference to `vorbis_synthesis_halfrate_p'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `_fetch_and_process_packet.constprop.0':
[build] (.text+0x20ce): undefined reference to `vorbis_synthesis_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x20dc): undefined reference to `vorbis_block_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x20f2): undefined reference to `vorbis_synthesis_halfrate_p'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x2102): undefined reference to `vorbis_synthesis'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x216e): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x2184): undefined reference to `vorbis_synthesis_blockin'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x218c): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x21f2): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x2248): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `_ov_getlap':
[build] (.text+0x22a2): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x22ec): undefined reference to `vorbis_synthesis_read'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x2306): undefined reference to `vorbis_synthesis_lapout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `_ov_d_seek_lap':
[build] (.text+0x23c8): undefined reference to `vorbis_synthesis_halfrate_p'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x23da): undefined reference to `vorbis_info_blocksize'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x23e8): undefined reference to `vorbis_window'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x24ea): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x2520): undefined reference to `vorbis_info_blocksize'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x252e): undefined reference to `vorbis_window'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x253a): undefined reference to `vorbis_synthesis_lapout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `_ov_64_seek_lap':
[build] (.text+0x25be): undefined reference to `vorbis_synthesis_halfrate_p'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x25d0): undefined reference to `vorbis_info_blocksize'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x25e0): undefined reference to `vorbis_window'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x26de): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x2714): undefined reference to `vorbis_info_blocksize'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x2722): undefined reference to `vorbis_window'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x272e): undefined reference to `vorbis_synthesis_lapout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `_fetch_headers':
[build] (.text+0x2788): undefined reference to `vorbis_info_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x278e): undefined reference to `vorbis_comment_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x2938): undefined reference to `vorbis_synthesis_headerin'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x2974): undefined reference to `vorbis_info_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x297a): undefined reference to `vorbis_comment_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x29c0): undefined reference to `vorbis_synthesis_idheader'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x29d6): undefined reference to `vorbis_synthesis_headerin'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `ov_pcm_seek_page':
[build] (.text+0x344e): undefined reference to `vorbis_dsp_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x3456): undefined reference to `vorbis_block_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x36fa): undefined reference to `vorbis_dsp_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x3702): undefined reference to `vorbis_block_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x390e): undefined reference to `vorbis_dsp_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x3916): undefined reference to `vorbis_block_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x3a66): undefined reference to `vorbis_synthesis_restart'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x3b86): undefined reference to `vorbis_synthesis_restart'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `ov_pcm_seek':
[build] (.text+0x3c2a): undefined reference to `vorbis_synthesis_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x3c36): undefined reference to `vorbis_block_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `ov_clear':
[build] (.text+0x3c7c): undefined reference to `vorbis_block_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x3c84): undefined reference to `vorbis_dsp_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x3ca2): undefined reference to `vorbis_info_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x3cae): undefined reference to `vorbis_comment_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `ov_halfrate':
[build] (.text+0x3ff2): undefined reference to `vorbis_synthesis_halfrate'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4016): undefined reference to `vorbis_dsp_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x401c): undefined reference to `vorbis_block_clear'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4052): undefined reference to `vorbis_synthesis_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x405e): undefined reference to `vorbis_block_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `ov_time_seek':
[build] (.text+0x46e2): undefined reference to `vorbis_synthesis_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x46ee): undefined reference to `vorbis_block_init'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `ov_read_float':
[build] (.text+0x4d54): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4d60): undefined reference to `vorbis_synthesis_halfrate_p'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4d7c): undefined reference to `vorbis_synthesis_read'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `ov_crosslap':
[build] (.text+0x4e12): undefined reference to `vorbis_synthesis_pcmout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4e58): undefined reference to `vorbis_synthesis_halfrate_p'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4e6c): undefined reference to `vorbis_synthesis_halfrate_p'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4e86): undefined reference to `vorbis_info_blocksize'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4e92): undefined reference to `vorbis_info_blocksize'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4ea6): undefined reference to `vorbis_window'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4eb4): undefined reference to `vorbis_window'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4f8a): undefined reference to `vorbis_synthesis_lapout'
[build] /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.1.0/../../../../arm-vita-eabi/lib/libvorbisfile.a(vorbisfile.o): in function `ov_halfrate_p':
[build] (.text+0x4094): undefined reference to `vorbis_synthesis_halfrate_p'
[build] collect2: error: ld returned 1 exit status
[build] make[2]: *** [audio/audio_sample] Error 1
[build] make[1]: *** [audio/CMakeFiles/audio_sample.dir/all] Error 2
[build] make: *** [all] Error 2

Please help me solve this problem. I’m truly grateful for your help.

@xfangfang
Copy link
Author

Sorry, the libraries I linked in cmake are in the wrong order.

quote from $ man ld:

The linker will search an archive only once, at the location where it is specified on the command line. If the archive
defines a symbol which was undefined in some object which appeared before the archive on the command line, the linker
will include the appropriate file(s) from the archive. However, an undefined symbol in an object appearing later on the
command line will not cause the linker to search the archive again.

Here is a version that compiles correctly:

target_link_libraries(${PROJECT_NAME}
  SDL2_mixer
  SDL2
  mikmod
  mpg123
  FLAC
  vorbisfile
  vorbis
  ogg
  m
  vita2d
  SceDisplay_stub
  SceCtrl_stub
  SceAudio_stub
  SceSysmodule_stub
  SceGxm_stub
  SceCommonDialog_stub
  SceAppMgr_stub
  SceTouch_stub
  SceMotion_stub
  SceHid_stub
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant