Comments (8)
Can you build the project from the command line? That would be an easy way to rule out clion as the culprit.
from gui_starter_template.
I'm surprised to say that yes, I can. Running the command-line quoted above succeeds without problems.
So now I'm speculating that CLion somehow messes up the environment and in that way triggers the failure? Odd...
from gui_starter_template.
I'm surprised to say that yes, I can. Running the command-line quoted above succeeds without problems.
So now I'm speculating that CLion somehow messes up the environment and in that way triggers the failure? Odd...
And indeed, to trigger the failure I'm observing from the commandline, I have to execute
CC=cc CXX=c++ /home/kees-jan/opt/clion-2019.3.5/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/bin/clang-10 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-10 -G "CodeBlocks - Unix Makefiles" /home/kees-jan/src/cpp_starter_project
I.e. set CXX and CMAKE_CXX_COMPILER to conflicting values
from gui_starter_template.
Ok, then we know for certain that CLion is the problem, and not this project or conan.
You will need to set up a new toolchain and a new cmake profile. To do that, you go to:
'File > Settings > Build, Execution, Deployment > Toolchains'
'File > Settings > Build, Execution, Deployment > CMake'
The documentation you want should be here: https://www.jetbrains.com/help/clion/how-to-switch-compilers-in-clion.html. This page should be able to help you a lot better than I can.
from gui_starter_template.
I have now been able to reproduce the problem from the commandline
Preparation:
cd cpp_starter_project
mkdir build
cd build/
cmake -DCMAKE_C_COMPILER=/usr/bin/clang-10 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-10 ..
Trigger the problem:
conan remove -f '*'
cmake -DCMAKE_C_COMPILER=/usr/bin/clang-10 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-10 ..
The final cmake
invocation fails with nonzero exit status, because conan detects GCC instead of clang.
Instead of that final cmake
invocation, you might also call make
. That too makes conan attempt to build its packages, and fails with the same error.
from gui_starter_template.
According to conan-io/conan#1211, conan runs the compiler specified by the CC and CXX environment variables, not the cmake variables CMAKE_C_COMPILER and CMAKE_CXX_COMPILER. That thread suggests using conan profiles to set these variables, but that requires some modifications to cmake/Conan.cmake (see #32 if you want to do this).
I think it's easier to just set CC and CXX via command line. Try this:
rm -rf build/
mkdir build && cd build
CC=clang CXX=clang++ cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..
cmake --build . # Conan targets were already built using clang
conan remove -f '*'
cmake --build . # Builds conan targets using system default --> failure
CC=clang CXX=clang++ cmake --build . # Builds conan targets using clang --> success
If this works, you will need to convince CLion to inject those environment variables into the build command. The documentation linked in my last post explains how to do that.
from gui_starter_template.
I got it to work applying the fix from #122 to the conan_cmake_install
-call:
diff --git a/cmake/Conan.cmake b/cmake/Conan.cmake
index b57566f..44d1968 100644
--- a/cmake/Conan.cmake
+++ b/cmake/Conan.cmake
@@ -54,7 +54,10 @@ macro(run_conan)
cpp_starter_use_imgui=${CPP_STARTER_USE_IMGUI}
cpp_starter_use_sdl=${CPP_STARTER_USE_SDL}
SETTINGS
- ${settings})
+ ${settings}
+ ENV
+ CC=${CMAKE_C_COMPILER}
+ CXX=${CMAKE_CXX_COMPILER})
endforeach()
endmacro()
But i am not convenient enough about this to say that it is good and the right way to do it.
from gui_starter_template.
This is fixed in ProjectOptions v0.11.2
https://github.com/aminya/ProjectOptions
from gui_starter_template.
Related Issues (20)
- CI fails with "Detected a mismatch for the compiler version between your conan profile"
- Failure upon building the project on OSX HOT 3
- Showing up as the smaller cpp_boilerplate_project HOT 2
- Builds fail for CMake < 3.18 HOT 5
- publish docker image HOT 3
- Regex broken in clang format HOT 4
- build error on OSX HOT 1
- conan install fails due to zlib version conflict HOT 1
- PROJECT_IS_TOP_LEVEL in test/CMakeLists.txt is not set prior to CMake 3.21
- Env variables left in cache causes gcc-11 builds on ubuntu to fail HOT 5
- Doesn't work with openssl dependency HOT 5
- CI Failures on Ubuntu and Windows HOT 1
- Imgui examples.
- Doxygen was removed?
- Failing configuration with VS 2017
- why a template, want to clone to my machine HOT 1
- Conan error sdl/2.0.20
- Error with CLI library
- How to change LSAN variables HOT 1
- Using static constexpr in header file leads to duplication of data.
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 gui_starter_template.