Comments (5)
That's pretty useless advice for anyone not using cmake. The missing library in this case appears to be -lvorbisfile
.
from pspsdk.
You'll need to link to:
- vorbisfile
- vorbis
- ogg
from pspsdk.
Yeah, SDL2_mixer needs some more libraries to work. I'd do something like this in the CMakeLists.txt file:
cmake_minimum_required(VERSION 3.0)
project(sdl2_mixer)
add_executable(${PROJECT_NAME} main.c)
find_package(PkgConfig REQUIRED)
pkg_search_module(SDL2 REQUIRED sdl2)
pkg_search_module(SDL2_MIXER REQUIRED SDL2_mixer)
target_include_directories(${PROJECT_NAME} PRIVATE
${SDL2_INCLUDE_DIRS}
${SDL2_MIXER_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME} PRIVATE
${SDL2_LIBRARIES}
${SDL2_MIXER_LIBRARIES}
)
if(PSP)
target_link_libraries(${PROJECT_NAME} PRIVATE
SDL2main
)
create_pbp_file(
TARGET ${PROJECT_NAME}
ICON_PATH NULL
BACKGROUND_PATH NULL
PREVIEW_PATH NULL
TITLE ${PROJECT_NAME}
)
endif()
from pspsdk.
CMake is just using psp-pkg-config, though, you can do that in your makefile too. The commands CMake uses here are:
psp-pkg-config --libs SDL2_mixer
It seems there is a bug, though. It doesn't return what you'd expect. I'll fix that.
from pspsdk.
Thanks guys! It is compiled correctly now. I just linked those three libraries. My last thing to do is fix my code. 😅
CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(sdl2_mixer)
add_executable(${PROJECT_NAME} main.c)
find_package(PkgConfig REQUIRED)
pkg_search_module(SDL2 REQUIRED sdl2)
target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PRIVATE
${SDL2_LIBRARIES}
)
if(PSP)
target_link_libraries(${PROJECT_NAME} PRIVATE
SDL2main
SDL2_mixer
vorbisfile
vorbis
ogg
)
create_pbp_file(
TARGET ${PROJECT_NAME}
ICON_PATH NULL
BACKGROUND_PATH NULL
PREVIEW_PATH NULL
TITLE ${PROJECT_NAME}
)
endif()
output:
[ 50%] Linking C executable sdl2_mixer
Not stripping binary, build type is .
Calling psp-fixup-imports
Not building PRX
Calling mksfoex
Calling pack-pbp with ELF file
[0] 316 bytes | PARAM.SFO
[1] 0 bytes | NULL
[2] 0 bytes | NULL
[3] 0 bytes | NULL
[4] 0 bytes | NULL
[5] 0 bytes | NULL
[6] 2498372 bytes | /home/diamant3/sdl2_mixer/build/sdl2_mixer
[7] 0 bytes | NULL
EBOOT.PBP file created.
[100%] Built target sdl2_mixer
from pspsdk.
Related Issues (20)
- Trying to Compile sm-64 port, and I get this error related to the sdk HOT 3
- SIO sample firmware version limitation HOT 2
- Remove Corrupt PrxEncrypter from Tools HOT 6
- add a sample for pspge HOT 1
- Header(s) cannot be included warning-free with `-Wundef` HOT 3
- Global/Static variables never initialized HOT 1
- Remove -G0 flag in build_prx.mak ? HOT 2
- Wrong freetype path HOT 2
- sceGeEdramSetSize not working properly HOT 2
- sceUtilityLoadNetModule, audio and thread issue HOT 5
- `__retarget_lock_init.o, error: invalid type argument of ‘->’` HOT 6
- Environmental Variables HOT 4
- undefined reference to `sceKernelVolatileMemTryLock' HOT 2
- Missing header in psprtc.h HOT 2
- Missing `remove(const char *path)` HOT 3
- new dependency on pthread-embedded HOT 11
- configure doesn't set default CFLAGS HOT 3
- CMake using the incorect OUTPUT_NAME but stripping. HOT 8
- RFC: failsafe dealing with _PSP_FW_VERSION HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pspsdk.