Comments (7)
The problem is that our binaries are built for the msvc target, and they are incompatible with mingw.
This /bigobj
flag is probably only the tip of the iceberg of incompatibilities.
@tronical: Should we perhaps build both msvc and mingw binaries and have two packages? Or would it be possible to merge the two in a single package?
from slint.
Right. I suspect that a unified binary package might be possible - but it would require stitching two independent builds together. I think for now the best course of action is to rename our binary package to have a -MSVC suffix and add a -MinGW package separately.
from slint.
We add /bigobj
to the link line only if CMake believes that it's building with MSVC. How did you invoke cmake when this failed?
from slint.
We add
/bigobj
to the link line only if CMake believes that it's building with MSVC. How did you invoke cmake when this failed?
I use clion for build project. But as I understand it, the following command was executed:
====================[ Build | my_application | Debug-MinGW GCC ]================
C:\Users\Elf\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe --build F:\tests\slint-cpp-template\cmake-build-debug-mingw-gcc --target my_application -j 10
I tried using the system CMAKE. The result is the same. Path to cmake IDE changes:
====================[ Build | my_application | Debug-MinGW GCC ]================
"C:\Program Files\CMake\bin\cmake.exe" --build F:\tests\slint-cpp-template\cmake-build-debug-mingw-gcc --target my_application -j 10
[1/3] Generating appwindow.h
[2/3] Building CXX object CMakeFiles/my_application.dir/src/main.cpp.obj
FAILED: CMakeFiles/my_application.dir/src/main.cpp.obj
C:\msys64\mingw64\bin\g++.exe -IF:/tests/slint-cpp-template/cmake-build-debug-mingw-gcc -isystem "C:/Program Files/Slint-cpp 1.5.1/include/slint" -g -std=gnu++20 -fdiagnostics-color=always /bigobj -MD -MT CMakeFiles/my_application.dir/src/main.cpp.obj -MF CMakeFiles\my_application.dir\src\main.cpp.obj.d -o CMakeFiles/my_application.dir/src/main.cpp.obj -c F:/tests/slint-cpp-template/src/main.cpp
g++.exe: warning: /bigobj: linker input file unused because linking not done
g++.exe: error: /bigobj: linker input file not found: No such file or directory
ninja: build stopped: subcommand failed.
from slint.
Hm, could it be that your build directory was initially configured for MSVC?
If you remove F:\tests\slint-cpp-template\cmake-build-debug-mingw-gcc
entirely once and then re-build (re-configure), does the problem still exist?
from slint.
Two more possibly important points:
- I installed Slint from
.exe
for Win11. - My CMakeLists.txt looks like this:
cmake_minimum_required(VERSION 3.21)
project(my_application LANGUAGES CXX)
set(CMAKE_PREFIX_PATH "C:/Program Files/Slint-cpp 1.5.1")
find_package(Slint QUIET)
if (NOT Slint_FOUND)
message("Slint could not be located in the CMake module search path. Downloading it from Git and building it locally")
include(FetchContent)
FetchContent_Declare(
Slint
GIT_REPOSITORY https://github.com/slint-ui/slint.git
# `release/1` will auto-upgrade to the latest Slint >= 1.0.0 and < 2.0.0
# `release/1.0` will auto-upgrade to the latest Slint >= 1.0.0 and < 1.1.0
GIT_TAG release/1
SOURCE_SUBDIR api/cpp
)
FetchContent_MakeAvailable(Slint)
endif (NOT Slint_FOUND)
add_executable(my_application src/main.cpp)
target_link_libraries(my_application PRIVATE Slint::Slint)
slint_target_sources(my_application ui/appwindow.slint)
# On Windows, copy the Slint DLL next to the application binary so that it's found.
if (WIN32)
add_custom_command(TARGET my_application POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:my_application> $<TARGET_FILE_DIR:my_application> COMMAND_EXPAND_LISTS)
endif()
- First start CMake:
Hm, could it be that your build directory was initially configured for MSVC?
If you remove
F:\tests\slint-cpp-template\cmake-build-debug-mingw-gcc
entirely once and then re-build (re-configure), does the problem still exist?
"C:\Program Files\CMake\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=C:/Users/Elf/AppData/Local/Programs/CLion/bin/ninja/win/x64/ninja.exe -DCMAKE_C_COMPILER=C:/msys64/mingw64/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/msys64/mingw64/bin/g++.exe -G Ninja -S F:\tests\slint-cpp-template -B F:\tests\slint-cpp-template\cmake-build-debug-mingw-gcc
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.5s)
-- Generating done (0.0s)
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_C_COMPILER
-- Build files have been written to: F:/tests/slint-cpp-template/cmake-build-debug-mingw-gcc
Problems were encountered while collecting compiler information:
cc1plus.exe: fatal error: /bigobj: No such file or directory
[Finished]
The compiler is detected correctly. Then the problem repeated during the assembly stage.
from slint.
I found the following piece of code in the file "C:\Program Files\Slint-cpp 1.5.1\lib\cmake\Slint\SlintTargets.cmake"
:
# Create imported target Slint::Slint
add_library(Slint::Slint INTERFACE IMPORTED)
set_target_properties(Slint::Slint PROPERTIES
INTERFACE_COMPILE_FEATURES "cxx_std_20"
INTERFACE_COMPILE_OPTIONS "/bigobj"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/slint"
INTERFACE_LINK_LIBRARIES "Slint::slint-cpp"
)
Could this be causing the problem? I don't know cmake very well, unfortunately(
from slint.
Related Issues (20)
- Add the aibility to reference a component from another one
- [slint-lsp/vscode] action to open the element's document at the cursor's position HOT 4
- OpenCV's highgui::select_roi() function does not render fully when used with Slint (Rust)
- TimePicker widget HOT 2
- LineEdit Widget Error HOT 2
- Quickstart Rust Example Code Display Defect HOT 2
- Using Path in an embedded project will result in a compilation error. HOT 1
- is it possible to express a tree in this type system? HOT 1
- Path: Can't parse commands containing scientific notation HOT 3
- Performance issues using imports vs single .slint file HOT 6
- RFC: date-time builtin type HOT 2
- Component catalogue in Design Mode includes component under preview, resulting in compilation errors on drop HOT 2
- Component catalogue shows user defined duplicates in gallery demo HOT 1
- Built-in VirtualKeyboard element for improved support for in-process embedded virtual keyboards
- A bug with booleans, rust slint. HOT 3
- Android: double-clicked callback not work on TouchArea HOT 2
- Android: default-font-family not work
- Support libraries in LSP
- Compiler panic compiling `init` callback from a component inlined into a repeater HOT 1
- Include LTS Version as slintpad dependency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slint.