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

fix MinGW compilation #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hch12907
Copy link

MinGW expects main() without the -municode option, but the code uses wmain(). This results in an error:

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../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
mingw32-make[2]: *** [CMakeFiles\realesrgan-ncnn-vulkan.dir\build.make:136: realesrgan-ncnn-vulkan.exe] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:313: CMakeFiles/realesrgan-ncnn-vulkan.dir/all] Error 2
mingw32-make: *** [Makefile:148: all] Error 2

@hch12907
Copy link
Author

hch12907 commented Feb 18, 2023

I assume there is a bug in MinGW swprintf(). The paths produced by swprintf() is incorrect unless I make those changes.

The error log (/r-x4 should be realesr-animevideov3-x4):

_wfopen C:\...\realesrgan-ncnn-vulkan-20220424-windows\models/r-x4.param failed
parse magic failed
_wfopen C:\...\realesrgan-ncnn-vulkan-20220424-windows\models/r-x4.bin failed
network graph not ready

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

Successfully merging this pull request may close these issues.

None yet

1 participant