Skip to content

'Undefined reference' when attempting to build with MSYS2 instructions #1738

@RetroEdit

Description

@RetroEdit

It was confirmed to me that this is a known issue, but I don't think it's been filed here in the tracker. Essentially, mGBA's current instructions for building on Windows recommend using MSYS2. However, the build fails at the linking step for the final SDL and Qt executables. Below is a partial list of the 'Undefined references' errors that occur:

[ 53%] Linking C executable mgba-sdl.exe 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/mgba-sdl.dir/objects.a(sdl-audio.c.obj):sdl-audio.c:(.text+0x8c): undefined reference to `mCoreSyncLockAudio' 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/mgba-sdl.dir/objects.a(sdl-audio.c.obj):sdl-audio.c:(.text+0xad): undefined reference to `blip_set_rates' 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/mgba-sdl.dir/objects.a(sdl-audio.c.obj):sdl-audio.c:(.text+0xc6): undefined reference to `blip_set_rates' 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/mgba-sdl.dir/objects.a(sdl-audio.c.obj):sdl-audio.c:(.text+0xdb): undefined reference to `blip_samples_avail' 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/mgba-sdl.dir/objects.a(sdl-audio.c.obj):sdl-audio.c:(.text+0xfb): undefined reference to `blip_read_samples' 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/mgba-sdl.dir/objects.a(sdl-audio.c.obj):sdl-audio.c:(.text+0x113): undefined reference to `mCoreSyncConsumeAudio' 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/mgba-sdl.dir/objects.a(sdl-audio.c.obj):sdl-audio.c:(.text+0x188): undefined reference to `GBAAudioCalculateRatio' 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/mgba-sdl.dir/objects.a(sdl-audio.c.obj):sdl-audio.c:(.text+0x1c2): undefined reference to `blip_read_samples' 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/mgba-sdl.dir/objects.a(sdl-audio.c.obj):sdl-audio.c:(.text+0x2ae): undefined reference to `mLog' 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/mgba-sdl.dir/objects.a(sdl-audio.c.obj):sdl-audio.c:(.text+0x2f6): undefined reference to `mLog' 
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/mgba-sdl.dir/objects.a(sdl-audio.c.obj):sdl-audio.c:(.text.startup+0x13): undefined reference to `mLogGenerateCategory' 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions