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

Cmake fails at linking altonegen, possibly libopenal version conflict ? #373

Open
1ykos opened this issue Sep 13, 2020 · 6 comments
Open

Comments

@1ykos
Copy link

1ykos commented Sep 13, 2020

I just tried to compile REGoth on opensuse tumbleweed and it failed at linking altonegen. I suspect there is a version conflict due to my version of libopenal (1.20), which is probably very recent.

Error Message: `multiple definition of `FuMa2N3DScale' libopenal.a`
Scanning dependencies of target altonegen
[ 97%] Building C object lib/openal-soft/CMakeFiles/altonegen.dir/examples/altonegen.c.o
[ 97%] Building C object lib/openal-soft/CMakeFiles/altonegen.dir/examples/common/alhelpers.c.o
[ 97%] Linking C executable ../../bin/altonegen
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(ALu.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:29: multiple definition of `FuMa2N3DScale'; ../libopenal.a(ALc.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:29: first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(ALu.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:28: multiple definition of `SN3D2N3DScale'; ../libopenal.a(ALc.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:28: first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(ALu.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:27: multiple definition of `N3D2N3DScale'; ../libopenal.a(ALc.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:27: first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(bformatdec.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:28: multiple definition of `SN3D2N3DScale'; ../libopenal.a(ALc.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:28: first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(bformatdec.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:27: multiple definition of `N3D2N3DScale'; ../libopenal.a(ALc.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:27: first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(bformatdec.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:29: multiple definition of `FuMa2N3DScale'; ../libopenal.a(ALc.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:29: first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(panning.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:29: multiple definition of `FuMa2N3DScale'; ../libopenal.a(ALc.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:29: first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(panning.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:28: multiple definition of `SN3D2N3DScale'; ../libopenal.a(ALc.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:28: first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(panning.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:27: multiple definition of `N3D2N3DScale'; ../libopenal.a(ALc.c.o):/home/wolfi/src/REGoth/lib/openal-soft/Alc/bformatdec.h:27: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [lib/openal-soft/CMakeFiles/altonegen.dir/build.make:121: bin/altonegen] Error 1
make[1]: *** [CMakeFiles/Makefile2:1432: lib/openal-soft/CMakeFiles/altonegen.dir/all] Error 2
make: *** [Makefile:150: all] Error 2
@ataulien
Copy link
Collaborator

Hi, the linker-error seems to originate from one of the OpenAL-soft examples. You may can just remove them from the build by supplying -DALSOFT_EXAMPLES=OFF to cmake.

@1ykos
Copy link
Author

1ykos commented Sep 15, 2020

make clean
cmake -DALSOFT_EXAMPLES=OFF ~/src/REGoth/
make

gives the exact same error message.
When I comment out the definition in bformatdec.h:29 the variable FuMa2N3DScale is not defined in panning.c... I suspect something in the compilation procedure went wrong to trigger the inclusion of bformatdec.h twice even though there is an include guard, how is that possible?
'-DALSOFT_EXAMPLES=OFF apparently did not do anything even though it should have prevented the compilation of the alsoft examples judging from the CMakeLists.txt. So I tried cmake -D ALSOFT_EXAMPLES=OFF ~/src/REGoth too, but the same result. Any ideas?

@ataulien
Copy link
Collaborator

make clean only cleans build-artifacts, but does not cause CMake to regenerate build-files on the next run. You should delete/clear the complete build-directory and call CMake again.

@1ykos
Copy link
Author

1ykos commented Sep 16, 2020

Thank you for the suggestion but this gives the same error message.

~/bin % rm -rf REGoth 
~/bin % mkdir ~/bin/REGoth
~/bin % cd REGoth 
~/bin/REGoth % cmake -DALSOFT_EXAMPLES=OFF ~/src/REGoth
~/bin/REGoth % make

@Gryxx
Copy link

Gryxx commented Sep 16, 2020

openSUSE Tumbleweed here too.

[ 97%] Linking C executable ../../bin/altonegen
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(ALu.c.o):(.rodata+0x3bfc0): multiple definition of `FuMa2N3DScale'; ../libopenal.a(ALc.c.o):(.rodata+0x2e60): first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(ALu.c.o):(.rodata+0x3c000): multiple definition of `SN3D2N3DScale'; ../libopenal.a(ALc.c.o):(.rodata+0x2ea0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(ALu.c.o):(.rodata+0x3c040): multiple definition of `N3D2N3DScale'; ../libopenal.a(ALc.c.o):(.rodata+0x2ee0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(bformatdec.c.o):(.rodata+0x2e0): multiple definition of `SN3D2N3DScale'; ../libopenal.a(ALc.c.o):(.rodata+0x2ea0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(bformatdec.c.o):(.rodata+0x320): multiple definition of `N3D2N3DScale'; ../libopenal.a(ALc.c.o):(.rodata+0x2ee0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(bformatdec.c.o):(.rodata+0x2a0): multiple definition of `FuMa2N3DScale'; ../libopenal.a(ALc.c.o):(.rodata+0x2e60): first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(panning.c.o):(.rodata+0x13c0): multiple definition of `FuMa2N3DScale'; ../libopenal.a(ALc.c.o):(.rodata+0x2e60): first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(panning.c.o):(.rodata+0x1440): multiple definition of `N3D2N3DScale'; ../libopenal.a(ALc.c.o):(.rodata+0x2ee0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../libopenal.a(panning.c.o):(.rodata+0x1400): multiple definition of `SN3D2N3DScale'; ../libopenal.a(ALc.c.o):(.rodata+0x2ea0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [lib/openal-soft/CMakeFiles/altonegen.dir/build.make:120: bin/altonegen] Błąd 1
make[1]: *** [CMakeFiles/Makefile2:1403: lib/openal-soft/CMakeFiles/altonegen.dir/all] Błąd 2
make: *** [Makefile:149: all] Błąd 2

@stefson
Copy link

stefson commented Jan 15, 2023

I keep hitting the same linking error, is there no nuclear option to disable all of openal through cmake?

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

4 participants