Re: [hatari-devel] Windows cross compile build inconsistencies with SDL2 |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Windows cross compile build inconsistencies with SDL2
- From: Chang Chong <codemonkey2x@xxxxxxxxx>
- Date: Fri, 2 Apr 2021 09:45:16 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=gW0ERlWFtfYsKnxmKAKNrjkTsrsy0oMVQvhVIDjjXOE=; b=W4JKUCBxZTQy/WhpUhPFSGc7OxQSQCEsKEAdAZEdYYkHqEqXyMiW4sgLlDg6zkHPl2 tFKEtzLyjKHRP/R3wzgTTOg+67swUMzex9IUxSYo8zPhi1xIBg2nFq4TZf80nGlXBgIA DfyFRVSTpbeIEIlDt6mKafffA5sf6yIShTnWNDMoakuL8Qjwe64uTW+q9T8pqsnFfiin XcOuE9UkWazVCJQMnMsu7X7fcutcwl44twr4dME9AHEfdXwlNPfIpX2HVb4LTGAXx4CB 6wg6nogCy0Ck9lYqzSpVEZb/+SC3ozYxHwKvbUmeQExdkoHEPpqf37kihWFbgTrzoUAg dH6Q==
This is what I encountered during my first attempt at building Hatari on windows via msys/mingw (in addition to the pkg-config behavior i noted in a separate post). I added the SDL2_LIBRARY to the link dependencies to all the executables that failed (starting with build68k.exe) to resolve the missing symbols.
Since the additional SDL2 other cflags is added in cmake via add_definitions, it’s applied to every file compilation. If the SDL2 additional cflags is required for a specific target, rather than all files, perhaps we can use cmake's target_compile_definitions to make it explicit in the cmake code and build rules to apply these additional cflags to specific named targets.
Chang
> On Apr 2, 2021, at 7:03 AM, Jens Guenther <dbotw@xxxxxxx> wrote:
>
> On Fri, 2 Apr 2021 13:17:14 +0200 Thomas Huth <th.huth@xxxxxxxxx> wrote:
>
>> What failure do you exactly get?
>
> [ 0%] Building C object src/cpu/CMakeFiles/build68k.dir/build68k.c.obj
> <command-line>: warning: no previous prototype for 'SDL_main' [-Wmissing-prototypes]
> C:/msys64/home/jens/hatari/src/cpu/build68k.c:59:5: note: in expansion of macro 'main'
> 59 | int main(int argc, char **argv)
> | ^~~~
> [ 1%] Building C object src/cpu/CMakeFiles/build68k.dir/writelog.c.obj
> [ 1%] Linking C executable build68k.exe
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function `main':
> C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
> collect2.exe: error: ld returned 1 exit status
> make[2]: *** [src/cpu/CMakeFiles/build68k.dir/build.make:118: src/cpu/build68k.exe] Error 1
> make[1]: *** [CMakeFiles/Makefile2:533: src/cpu/CMakeFiles/build68k.dir/all] Error 2
> make: *** [Makefile:146: all] Error 2
>
>> Hmm, that can't be the solution either. IIRC I once added the whole
>> stuff with the "other cflags" to fix compilation problems on Windows...
>
> Sorry, I wasn't sure if SDL2_OTHER_CFLAGS is required on other platforms.
>
>> ... maybe we could simply drop this completely now?
>
> Probably the best solution ... :-)
>
> Jens
>
>