Discussion:
linker error on MinGW build
Philipp Kraus
2013-04-11 23:02:21 UTC
Permalink
Hello,

I try to build OpenAL under MinGW and get the linker errors:

Linking C shared library OpenAL32.dll
Creating library file: libOpenAL32.dll.a
CMakeFiles\OpenAL32.dir/objects.a(alError.obj):alError.c:(.text+0x27): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x24c): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0xff1): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x14cd): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x20d8): undefined reference to `__sync_add_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x2174): undefined reference to `__sync_sub_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x30d9): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3d1c): undefined reference to `__sync_add_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3dcd): undefined reference to `__sync_sub_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3f7d): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3fbb): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(helpers.obj):helpers.c:(.text+0x64a): undefined reference to `__sync_add_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(helpers.obj):helpers.c:(.text+0x688): undefined reference to `__sync_sub_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(helpers.obj):helpers.c:(.text+0x6bb): undefined reference to `__sync_add_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(helpers.obj):helpers.c:(.text+0x703): undefined reference to `__sync_sub_and_fetch_4'

I get the source from the Git repo and run cmake to create MinGW Makefile, after that I run mingw32-make and get the linker error.
How can I fix the build?

Thanks

Phil
Ryan Pavlik
2013-04-12 17:46:35 UTC
Permalink
Those are GCC atomic intrinsics, so it's a bit strange to see them in a
linker error. What version of GCC are you using in mingw? (What build of
mingw are you using? I'm pretty sure I cross-compile continuously with mxe)

Ryan


On Thu, Apr 11, 2013 at 6:02 PM, Philipp Kraus
Post by Philipp Kraus
Hello,
Linking C shared library OpenAL32.dll
Creating library file: libOpenAL32.dll.a
undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x24c): undefined
reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0xff1): undefined
reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x14cd): undefined
reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x20d8): undefined
reference to `__sync_add_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x2174): undefined
reference to `__sync_sub_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x30d9): undefined
reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3d1c): undefined
reference to `__sync_add_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3dcd): undefined
reference to `__sync_sub_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3f7d): undefined
reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3fbb): undefined
reference to `__sync_bool_compare_and_swap_4'
undefined reference to `__sync_add_and_fetch_4'
undefined reference to `__sync_sub_and_fetch_4'
undefined reference to `__sync_add_and_fetch_4'
undefined reference to `__sync_sub_and_fetch_4'
I get the source from the Git repo and run cmake to create MinGW Makefile,
after that I run mingw32-make and get the linker error.
How can I fix the build?
Thanks
Phil
_______________________________________________
Openal mailing list
http://opensource.creative.com/mailman/listinfo/openal
--
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

***@iastate.edu
http://academic.cleardefinition.com
Philipp Kraus
2013-04-12 18:05:20 UTC
Permalink
I use gcc 4.7.1, I'm testing the mach flag :-)

Phil
Those are GCC atomic intrinsics, so it's a bit strange to see them in a linker error. What version of GCC are you using in mingw? (What build of mingw are you using? I'm pretty sure I cross-compile continuously with mxe)
Ryan
Hello,
Linking C shared library OpenAL32.dll
Creating library file: libOpenAL32.dll.a
CMakeFiles\OpenAL32.dir/objects.a(alError.obj):alError.c:(.text+0x27): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x24c): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0xff1): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x14cd): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x20d8): undefined reference to `__sync_add_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x2174): undefined reference to `__sync_sub_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x30d9): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3d1c): undefined reference to `__sync_add_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3dcd): undefined reference to `__sync_sub_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3f7d): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(ALc.obj):ALc.c:(.text+0x3fbb): undefined reference to `__sync_bool_compare_and_swap_4'
CMakeFiles\OpenAL32.dir/objects.a(helpers.obj):helpers.c:(.text+0x64a): undefined reference to `__sync_add_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(helpers.obj):helpers.c:(.text+0x688): undefined reference to `__sync_sub_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(helpers.obj):helpers.c:(.text+0x6bb): undefined reference to `__sync_add_and_fetch_4'
CMakeFiles\OpenAL32.dir/objects.a(helpers.obj):helpers.c:(.text+0x703): undefined reference to `__sync_sub_and_fetch_4'
I get the source from the Git repo and run cmake to create MinGW Makefile, after that I run mingw32-make and get the linker error.
How can I fix the build?
Thanks
Phil
_______________________________________________
Openal mailing list
http://opensource.creative.com/mailman/listinfo/openal
--
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University
http://academic.cleardefinition.com
Loading...