fatal error: EGL/egl.h: No such file or directory - sdl

I had compiled SDL 2.0 source.
First, I commended 'cmake ../ -G "MinGW Makefiles" on console.
Second, I commended 'make'. but error is happned.
fatal error: EGL/egl.h: No such file or directory
Where can I download EGL/egl header and library?
My environment :
Windows 10 home 64bit
MinGW

Remove CMakeCache.txt and CMakeFiles and try
cmake -G "MinGW Makefiles" -DVIDEO_OPENGLES=0 ../
mingw32-make

Related

cmake --target source directory does not exist

I am compiling a rather big C++ project with cmake.
The project has several targets defined in the CMakeLists.txt of the various subdirectories
I can create a folder somewhere and use cmake to prepare compilation of the targets, and compile any of the target :
cmake ..
make -j8 cytosim
And this works.
However, if I call cmake with a target :
cmake .. --target cytosim
I get the error
CMake Error: The source directory ".../build/cytosim" does not exist.
I thought target was supposed to be a module/library/executable target... What am I missing ?
CMake --target argument is usable in CMake Build Mode (--build).
Try cmake --build .. --target cytosim

what is the correct way to use cmake

I was following instructions for compiling a software in windows as described here: https://github.com/solvespace/solvespace . But when i launch the first cmake command it points out the following :
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake -DCMAKE_BUILD_TYPE=Release
CMake Error at CMakeLists.txt:42 (project):
Running
'nmake' '-?'
failed with:
Impossibile trovare il file specificato
-- Configuring incomplete, errors occurred!
See also "C:/Users/user/Documents/experiments/SolveSpaceFolder/solvespace/build/CMakeFiles/CMakeOutput.log".
i've alredy installed mingw64 and added to PATH, in fact it work alone. Moreover I can see that there is nmake implied. I just can't figure out what's the problem.
Remove CMakeCache.txt and try to set the generator
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles"
Related question: CMake & MinGW Compilation on Windows, without needing the -G "MinGW Makefiles" flag.

cmake and Visual Studio 15 2017 generator - defining a build type

I work on Windows 10. I use cmake with Visual Studio 15 2017 generator. CMakeLists.txt requires CMAKE_BUILD_TYPE to be defined because it is used by Conan command called from cmake (execute_process). Here is the cmake command:
cmake -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 15 2017" ..
When I run build command this way:
cmake --build .
I get the following error:
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in Tests.obj
Conan installs a release library (MT_StaticRelease) but CMAKE_BUILD_TYPE is ignored during build. Building works when I use the following command:
cmake --build . --config Release
How does it work ? When I have to define --config buildType ? What with other generators, for example Ninja ?
Visual Studio is a multi-configuration system. It means that the build type is selected at build time, lets say when you are using the IDE, you can select at that time the Release or Debug configuration and build. So when you are generating the Visual Studio solution (project generation or configure step), with cmake -G "Visual Studio ...", CMake doesnt have a value for CMAKE_BUILD_TYPE.
So the CMake invocations need to be different depending on the system:
In multi-configuration environments like Visual Studio, you use just 1 build folder:
$ mkdir build && cd build # assume we are in the folder containing CMakeLists.txt
$ cmake .. -G "Visual Studio 15 2017 Win64" # Unless building for 32 bits, add the Win64
$ cmake --build . --config Release # Or open IDE, change config to Release and build
$ cmake --build . --config Debug
In single-configuration environments like gcc with Makefiles, you need to use 1 folder for every configuration
$ mkdir build_release && cd build_release # assume we are in the folder containing CMakeLists.txt
$ cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
$ cmake --build .
$ cd .. && mkdir build_debug && cd build_debug
$ cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug
$ cmake --build .
A different issue is the definition of the MT (static) Visual Studio runtime. It is possible that you have defined in your Conan profile compiler.runtime=MT, or it is being set by your CMakeLists.txt directly. Conan doesn't install such static MT_StaticRelease library, it is part of Visual Studio. If you are trying to statically link the visual studio environment, your used profiles should look like:
# for debug
$ conan install .. -s build_type=Debug -s compiler.runtime=MTd
# for release
$ conan install .. -s build_type=Release -s compiler.runtime=MT

make: *** No targets specified and no makefile found. Stop. [ubuntu]

I'm trying to build this
https://github.com/patrikhuber/eos
but I'm having troubles.
The instructions are pretty simple, as it says on gitHub
To build:
git clone --recursive https://github.com/patrikhuber/eos.git
mkdir build && cd build # creates a build directory next to the 'eos' folder
cmake -G "<your favourite generator>" ../eos -DCMAKE_INSTALL_PREFIX=../install/
make && make install # or open the project file and build in an IDE like Visual Studio
I'm using "Ninja" as generator and it looks like the cmake part goes through successfully as I get
-- Configuring done
-- Generating done
-- Build files have been written to: /home/francesco/eos/build
That's where things stop "working" for me, or where I fail to understand what's next. Following the instructions, I type
make && make install
and I get this message
make: *** No targets specified and no makefile found. Stop.
I looked around for solutions but I don't really understand what I am supposed to do: I tried
./configure
but I'm getting
bash: ./configure: No such file or directory
Anyone can please help?
Thanks
It always depends on your CMake "Generator". The 'make' is linux/mingw tool/command. For VisualStudio you can use nmake or sln/proj generated stuff.
More reliable could be utilize CMake for building i.e. for "NMake Makefiles" generator:
cmake --build <build folder> --target install
or
cmake --build <build folder> --config release --target install
for VisualStudio generator
I had the same problem, and solved by tinkering with locations for cmake and make. Here's what I used:
cmake -DCMAKE_INSTALL_PREFIX=/usr/local
make
I believe /usr/local is the default location (see here)

CMake Errors - Using Conan

I just cant figure out why I am getting this error, would anyone mind giving me some help?
I have added Cmake to the Environment variables, but am still getting an error. I'm currently a University Student trying to get SDL to work.
My machine is x64, I have Visual Studio 2017 with all C++ elements installed.
Here is the CMD error:
CMD Error
Here is the GUI error:
GUI Error
Copy - Paste CMD Version:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:1 (PROJECT):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:1 (PROJECT):
No CMAKE_CXX_COMPILER could be found.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Chris Ross/.conan/data/zlib/1.2.8/lasote/stable/build/6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7/_build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Chris Ross/.conan/data/zlib/1.2.8/lasote/stable/build/6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7/_build/CMakeFiles/CMakeError.log".
zlib/1.2.8#lasote/stable:
zlib/1.2.8#lasote/stable: ERROR: Package '6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7' build failed
zlib/1.2.8#lasote/stable: WARN: Build folder C:\Users\Chris Ross\.conan\data\zlib\1.2.8\lasote\stable\build\6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
ERROR: zlib/1.2.8#lasote/stable: Error in build() method, line 60
self.run('%s && cmake .. %s' % (cd_build, cmake.command_line))
ConanException: Error 1 while executing cd _build && cmake .. -G "Visual Studio 15 2017 Win64" -DCONAN_LINK_RUNTIME="/MD" -DCONAN_EXPORTED="1" -DCONAN_COMPILER="Visual Studio" -DCONAN_COMPILER_VERSION="15" -DCONAN_CXX_FLAGS="/MP4" -DCONAN_C_FLAGS="/MP4" -Wno-dev
INFO: Conan job finished.
INFO: Starting cmake
CMake Error: Error: generator : Visual Studio 14 2015 Win64
Does not match the generator used previously: Visual Studio 15 2017 Win64
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
INFO: CMake job finished.
Copy - Paste GUI Version:
CMAKE_CONFIGURATION_TYPES Debug;Release;MinSizeRel;RelWithDebInfo
CMAKE_INSTALL_PREFIX C:/Program Files (x86)/lab1
Configuring incomplete, errors occurred!
See also "C:/Users/Chris Ross/Desktop/lab2template/bin/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Chris Ross/Desktop/lab2template/bin/CMakeFiles/CMakeError.log".
My conanfile.txt:
[requires]
SDL2/2.0.5#dotfloat/stable
SDL2_image/2.0.1#lasote/stable
SDL2_mixer/2.0.1#a_teammate/testing
SDL2_ttf/2.0.14#hilborn/stable
[options]
SDL2:shared=True
SDL2_image:shared=False
SDL2_mixer:shared=True
SDL2_ttf:shared=False
[generators]
cmake
[imports]
bin, *.dll -> ./bin # Copies all dll files from packages bin folder to my "bin" folder
lib, *.dylib* -> ./bin # Cop
Using this .bat file:
#echo off
:start
echo INFO: I am running from '%cd%'
if exist src goto changetobin
:conan
echo INFO: Starting conan
conan install --build missing
echo INFO: Conan job finished.
goto cmake
:cmake
echo INFO: Starting cmake
cmake .. -G "Visual Studio 14 2015 Win64"
echo INFO: CMake job finished.
goto end
:changetobin
echo ERROR: I'm in the wrong directory.. moving into bin
cd bin
echo INFO: Retrying..
goto start
:end
if exist bin goto quit
cd ..
goto quit
:quit
echo.
echo.
echo INFO: Conan and CMake ran successfully. Open up your solution file (listed below) to open your project.
echo.
dir /b *.sln
(I have also attempted a manual build (conan install --build missing))
"My machine is x64, I have Visual Studio 2017 with all C++ elements installed."
You're generating a solution for the wrong version of Visual Studio..
cmake .. -G "Visual Studio 14 2015 Win64"
Change that line in your batch script to:
cmake .. -G "Visual Studio 15 2017 Win64"
Then you must remove all generated files (CMakeCache.txt', 'CMakeFiles dir, etc`) and try again. Please also double check that your conan profile settings match the compiler you are using.