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

Please support MSYS2 MINGW64 #101

Closed
ghost opened this issue Apr 7, 2023 · 10 comments
Closed

Please support MSYS2 MINGW64 #101

ghost opened this issue Apr 7, 2023 · 10 comments
Labels
good first issue Good for newcomers

Comments

@ghost
Copy link

ghost commented Apr 7, 2023

Currently the project failed to build even though cmake configuration is fine.

@TheLavaBlock TheLavaBlock added the question Further information is requested label Apr 7, 2023
@TheLavaBlock
Copy link
Member

Hello, Thanks for your contribution.

Can you provide more information because latest GH Actions show that it builds properly.

Such as system info, configuration, logs, outputs...

@TheLavaBlock
Copy link
Member

I notice it's about MSYS2 MINGW64, it's not in the focus, but more information on what the build fails on would help.

@ghost
Copy link
Author

ghost commented Apr 19, 2023

$ ninja
[1/654] Building CXX object CMakeFiles/lava.util.dir/empty.cpp.obj
[2/654] Building CXX object CMakeFiles/lava.core.dir/empty.cpp.obj
[3/654] Linking CXX static library liblava.core.a
[4/654] Linking CXX static library liblava.util.a
[5/654] Building CXX object CMakeFiles/lava.file.dir/liblava/file/file.cpp.obj
FAILED: CMakeFiles/lava.file.dir/liblava/file/file.cpp.obj
C:\msys64\mingw64\bin\c++.exe  -IC:/msys64/home/Administrator/liblava/build/_deps/physfs-src/src -IC:/msys64/home/Administrator/liblava/build/_deps/json-src/single_include -IC:/msys64/home/Administrator/liblava -O3 -DNDEBUG -std=gnu++23 -Wno-psabi -MD -MT CMakeFiles/lava.file.dir/liblava/file/file.cpp.obj -MF CMakeFiles\lava.file.dir\liblava\file\file.cpp.obj.d -o CMakeFiles/lava.file.dir/liblava/file/file.cpp.obj -c C:/msys64/home/Administrator/liblava/liblava/file/file.cpp
In file included from C:/msys64/home/Administrator/liblava/liblava/file/file.hpp:11,
                 from C:/msys64/home/Administrator/liblava/liblava/file/file.cpp:8:
C:/msys64/home/Administrator/liblava/liblava/core/data.hpp: In function 'char* lava::human_readable(size_t)':
C:/msys64/home/Administrator/liblava/liblava/core/data.hpp:338:12: error: 'strndup' was not declared in this scope; did you mean 'strdup'?
  338 |     return strndup(buf, buffer_size);
      |            ^~~~~~~
      |            strdup
[6/654] Building CXX object CMakeFiles/lava.file.dir/liblava/file/file_utils.cpp.obj
FAILED: CMakeFiles/lava.file.dir/liblava/file/file_utils.cpp.obj
C:\msys64\mingw64\bin\c++.exe  -IC:/msys64/home/Administrator/liblava/build/_deps/physfs-src/src -IC:/msys64/home/Administrator/liblava/build/_deps/json-src/single_include -IC:/msys64/home/Administrator/liblava -O3 -DNDEBUG -std=gnu++23 -Wno-psabi -MD -MT CMakeFiles/lava.file.dir/liblava/file/file_utils.cpp.obj -MF CMakeFiles\lava.file.dir\liblava\file\file_utils.cpp.obj.d -o CMakeFiles/lava.file.dir/liblava/file/file_utils.cpp.obj -c C:/msys64/home/Administrator/liblava/liblava/file/file_utils.cpp
In file included from C:/msys64/home/Administrator/liblava/liblava/file/file_utils.hpp:10,
                 from C:/msys64/home/Administrator/liblava/liblava/file/file_utils.cpp:8:
C:/msys64/home/Administrator/liblava/liblava/core/data.hpp: In function 'char* lava::human_readable(size_t)':
C:/msys64/home/Administrator/liblava/liblava/core/data.hpp:338:12: error: 'strndup' was not declared in this scope; did you mean 'strdup'?
  338 |     return strndup(buf, buffer_size);
      |            ^~~~~~~
      |            strdup
[7/654] Building CXX object CMakeFiles/lava.base.dir/liblava/base/debug_utils.cpp.obj
[8/654] Building CXX object CMakeFiles/lava.file.dir/liblava/file/file_system.cpp.obj
[9/654] Building CXX object CMakeFiles/lava.file.dir/liblava/file/json_file.cpp.obj
FAILED: CMakeFiles/lava.file.dir/liblava/file/json_file.cpp.obj
C:\msys64\mingw64\bin\c++.exe  -IC:/msys64/home/Administrator/liblava/build/_deps/physfs-src/src -IC:/msys64/home/Administrator/liblava/build/_deps/json-src/single_include -IC:/msys64/home/Administrator/liblava -O3 -DNDEBUG -std=gnu++23 -Wno-psabi -MD -MT CMakeFiles/lava.file.dir/liblava/file/json_file.cpp.obj -MF CMakeFiles\lava.file.dir\liblava\file\json_file.cpp.obj.d -o CMakeFiles/lava.file.dir/liblava/file/json_file.cpp.obj -c C:/msys64/home/Administrator/liblava/liblava/file/json_file.cpp
In file included from C:/msys64/home/Administrator/liblava/liblava/file/file.hpp:11,
                 from C:/msys64/home/Administrator/liblava/liblava/file/json_file.cpp:10:
C:/msys64/home/Administrator/liblava/liblava/core/data.hpp: In function 'char* lava::human_readable(size_t)':
C:/msys64/home/Administrator/liblava/liblava/core/data.hpp:338:12: error: 'strndup' was not declared in this scope; did you mean 'strdup'?
  338 |     return strndup(buf, buffer_size);
      |            ^~~~~~~
      |            strdup
[10/654] Building CXX object CMakeFiles/lava.base.dir/liblava/base/base.cpp.obj
ninja: build stopped: subcommand failed.

@TheLavaBlock
Copy link
Member

Thanks for the additional information. The problem seems to be obvious 👀

@TheLavaBlock TheLavaBlock added bug Something isn't working good first issue Good for newcomers and removed question Further information is requested bug Something isn't working labels Apr 19, 2023
@TheLavaBlock
Copy link
Member

I just threw out the function. So how does it look, can you pull it and try again?

@ghost
Copy link
Author

ghost commented Apr 24, 2023

I just threw out the function. So how does it look, can you pull it and try again?

Failed to link:

FAILED: lava-triangle.exe
cmd.exe /C "cd . && C:\msys64\mingw64\bin\c++.exe -O3 -DNDEBUG /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup    -latomic CMakeFiles/lava-triangle.dir/liblava-demo/triangle.cpp.obj -o lava-triangle.exe -Wl,--out-implib,liblava-triangle.dll.a -Wl,--major-image-version,0,--minor-image-version,0  liblava.app.a  liblava.block.a  liblava.frame.a  _deps/glfw-build/src/libglfw3.a  liblava.asset.a  liblava.resource.a  liblava.base.a  liblava.util.a  _deps/spdlog-build/libspdlog.a  liblava.file.a  liblava.core.a  _deps/physfs-build/libphysfs.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find /SUBSYSTEM:WINDOWS: No such file or directory
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find /ENTRY:mainCRTStartup: No such file or directory
collect2.exe: error: ld returned 1 exit status
[160/654] Building CXX object _deps/spirv-tools-build/source/CMakeFiles/SPIRV-Tools-shared.dir/diagnostic.cpp.obj
[161/654] Building CXX object _deps/spirv-tools-build/source/CMakeFiles/SPIRV-Tools-shared.dir/disassemble.cpp.obj
[162/654] Building CXX object _deps/spirv-tools-build/source/CMakeFiles/SPIRV-Tools-shared.dir/binary.cpp.obj
[163/654] Building CXX object CMakeFiles/template.dir/src/main.cpp.obj
[164/654] Building CXX object CMakeFiles/lava-light.dir/liblava-demo/light.cpp.obj
ninja: build stopped: subcommand failed.

@ghost
Copy link
Author

ghost commented Apr 25, 2023

It's mixing MSVC switches with GCC switches. There must be errors on one of the CMakeLists.txt files.

TheLavaBlock added a commit that referenced this issue Apr 27, 2023
@TheLavaBlock
Copy link
Member

Ok, now I made a small adjustment for this.
Unfortunately I don't have much time for this right now, so I am very glad you're looking into this. 🤞

@ghost
Copy link
Author

ghost commented Apr 28, 2023

Ok, now I made a small adjustment for this. Unfortunately I don't have much time for this right now, so I am very glad you're looking into this. 🤞

Confirmed it's building fine now. Thank you.

@ghost ghost closed this as completed Apr 28, 2023
@TheLavaBlock
Copy link
Member

Great that it worked out now. Thanks again 🤠

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant