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

SoLoud dynamic libraries do not work #342

Open
haya3218 opened this issue Feb 9, 2022 · 1 comment
Open

SoLoud dynamic libraries do not work #342

haya3218 opened this issue Feb 9, 2022 · 1 comment

Comments

@haya3218
Copy link

haya3218 commented Feb 9, 2022

Expected behavior:

SoLoud being dynamically linked using cmake

Actual behavior:

Multiple linker errors about how it could not find SoLoud functions

Steps to reproduce the problem:

Compile SoLoud as a dynamic library using GENie.

SoLoud version, operating system, backend used, any other potentially useful information:

SoLoud version 20200207
Windows 10 21H2
Microsoft VC++ 14.2
Miniaudio and SDL2 backends

Most linker errors go like this:
error LNK2019: unresolved external symbol "public: void __cdecl SoLoud::AudioSource::setLooping(bool)" (?s etLooping@AudioSource@SoLoud@@QEAAX_N@Z)

EDIT: Static linking DOES work, however dynamically does not.

@yuriy-chumak
Copy link

Maybe this can help?

index 831fe75..99c21db 100644                                                                                                                                                                                                                --- a/contrib/src.cmake
+++ b/contrib/src.cmake                                                                                                                                                                                                                      @@ -287,7 +287,7 @@ if (SOLOUD_C_API)
 endif()
                                                                                                                                                                                                                                              if (SOLOUD_DYNAMIC)
-       add_library(${TARGET_NAME} ${TARGET_SOURCES})
+       add_library(${TARGET_NAME} SHARED ${TARGET_SOURCES})
 endif ()
                                                                                                                                                                                                                                              if (SOLOUD_STATIC)

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

2 participants