im trying to generate the configuration for glfw after cloning the source from https://github.com/glfw/glfw.git . I get an error only on windows (on ubuntu linux i have no issue) . I suspect an issue with my CMake but im not sure.
When I run CMake from the root directory of glfw I get the following error using Cmake 2.8
C:\temp\glfw-master>cmake .
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Using Win32 for window creation
-- Using WGL for context creation
CMake Error at examples/CMakeLists.txt:16 (include_directories):
include_directories given empty-string as include directory.
-- Configuring incomplete, errors occurred!
I then tried upgrading to CMake latest 3.0.1 , I still get the error but with a little more info :
$ cmake .
-- Building for: Visual Studio 11 2012
-- The C compiler identification is MSVC 17.0.61030.0
-- Check for working C compiler using: Visual Studio 11 2012
-- Check for working C compiler using: Visual Studio 11 2012 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found OpenGL: opengl32
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found
-- Found Threads: TRUE
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Using Win32 for window creation
-- Using WGL for context creation
CMake Error at examples/CMakeLists.txt:16 (include_directories):
include_directories given empty-string as include directory.
-- Configuring incomplete, errors occurred!
See also "C:/temp/glfw/CMakeFiles/CMakeOutput.log".
See also "C:/temp/glfw/CMakeFiles/CMakeError.log".
If I check the CMakeError.log it seems to mention missing pthreads (which doesnt make sense to me since this is windows and probably pthreads.h should only be used on posix based OSs)
CheckIncludeFiles.c
CheckIncludeFiles.c(2): fatal error C1083: Cannot open include file: 'pthread.h'
: No such file or directory [C:\temp\glfw\CMakeFiles\CMakeTmp\cmTryCompileExec38
59330081.vcxproj]
Done Building Project "C:\temp\glfw\CMakeFiles\CMakeTmp\cmTryCompileExec38593300
81.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\temp\glfw\CMakeFiles\CMakeTmp\cmTryCompileExec3859330081.vcxproj" (default t
arget) (1) ->
(ClCompile target) ->
CheckIncludeFiles.c(2): fatal error C1083: Cannot open include file: 'pthread.
h': No such file or directory [C:\temp\glfw\CMakeFiles\CMakeTmp\cmTryCompileExec
3859330081.vcxproj]
0 Warning(s)
1 Error(s)
Could anyone shed light on what I might have missed? I tried posting this question in glfw irc and discussion forum but i think its not very active and i am under the gun to get this running. It could also be that i am not getting an answer there because its more related to CMake and my configuration than it is glfw per se.
Thanks!
Related
After installing EiffelStudio I can't compile and run any project because I always get VD43 warning and C Compiler Error.
2 VD43 Precompiled file is missing or unreadable. File 'c:\users\username\documents\eiffel user files\19.05\precomp\spec\win64\EIFGENs\base-scoop-safe\W_code\msc_vc140\driver.exe'.
1 C Compiler Error Please review the External Compilation output of the Outputs Tool.
Error code: C Compiler Error
Error: External C/C++ compilation failed.
What to do: Check the external C/C++ compilation for details.
Please review the External Compilation output of the Outputs Tool.
I found this page: https://www.eiffel.org/doc/version/trunk/faq/FAQ. The key ISE_C_COMPILER must be additionally defined in order for EiffelStudio to work at all. But how does one "Tell EiffelStudio to use Visual Studio 2017-compatible libraries"? I tried setting it as an environment variable, and changing the compile_library.bat and esvars.bat, so that in every place it's set ISE_C_COMPILER=msc_vc140. I also added variable ISE_C_COMPILER - msc_vc140 on the EiffelStudio GUI, under Project->Project Settings->Target:project->Advanced->Variables
I deleted all the projects and the precomp folder. I ran espawn -l just to verify that I have the good c++ compiler:
Available C/C++ compilers:
VC160: Microsoft Visual Studio 2019 VC++ (19.0)
VC150: Microsoft Visual Studio 2017 VC++ (15.0)
To me it seems that I installed everything and I set every variable but it still gives me the same warning and error.
I have tried to build onionlib from sources. I cannot use git on my Debian 8 workstation so I downloaded zip from the github. CMake fails at main CMakeLists.txt:28, 29, 30, etc. with error string sub-command REGEX, mode REPLACE needs at least 6 arguments total to command.
It seems that ONION_VERSION variable is empty. Tried to do git clone on other PC and then copied the whole folder including .git to the target workstation with the same result. Tried to execute .git-version-gen and got output '0.8.123.f6b9d' I also get an empty -- Onion version is during compilation so the version is undefined.
npa#NPA:~/workspace/TMOIP/onion$ sudo sh ./git-version-gen
0.8.123.f6b9d
npa#NPA:~/workspace/TMOIP/onion$ mkdir build
npa#NPA:~/workspace/TMOIP/onion$ cd build
npa#NPA:~/workspace/TMOIP/onion/build$ cmake ..
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:28 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
CMake Error at CMakeLists.txt:29 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
CMake Error at CMakeLists.txt:30 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
-- Onion version is
-- Using epoll as poller
-- Could NOT find GnuTLS (missing: GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR)
-- Could NOT find GCrypt, try to set the path to GCrypt root folder in the system variable GCRYPT_ROOT_DIR (missing: GCRYPT_INCLUDE_DIR GCRYPT_LIBRARIES)
Gnutls or gcrypt not found. SSL support is not compiled in.
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
SQLite session support is not compiled in.
-- hiredis client library not found.
Hiredis not found. Redis session support is not compiled in.
-- pthreads found. Threading support is compiled in.
-- Found LibXml2: /usr/lib/i386-linux-gnu/libxml2.so (found version "2.9.1")
-- WebDAV support is compiled in.
No PAM support.
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
libpng not found. No png support.
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
libjpeg not found. No jpeg support.
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Found GC library: BOEHM_GC_LIBRARIES-NOTFOUND
-- Could NOT find Boehm_GC (missing: BOEHM_GC_LIBRARIES BOEHM_GC_INCLUDE_DIR)
-- NOT compiling Boehm GC examples
-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
curl not found. Some examples wil not be built.
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Could NOT find SYSTEMD (missing: SYSTEMD_INCLUDE_DIRS SYSTEMD_LIBRARIES)
Systemd support is not compiled in. Install libsystemd-dev | systemd-devel
md2man-roff NOT found, NOT compiling manpages. Install it via 'gem install md2man'
-- Prepared for packaging
-- Compiling WebDAV support
-- Found include files
CMake Error at src/onion/CMakeLists.txt:107 (SET_TARGET_PROPERTIES):
set_target_properties called with incorrect number of arguments.
-- Found include files onion.hpp;dict.hpp;request.hpp;response.hpp;url.hpp;handler.hpp;extrahandlers.hpp;shortcuts.hpp;exceptions.hpp;listen_point.hpp;http.hpp;https.hpp;mime.hpp
CMake Error at src/bindings/cpp/CMakeLists.txt:10 (SET_TARGET_PROPERTIES):
set_target_properties called with incorrect number of arguments.
CMake Warning at examples/CMakeLists.txt:9 (message):
Oterm without authentication support! May be very unsecure.
CMake Warning at examples/CMakeLists.txt:14 (message):
Some examples are disabled as you dont have PAM: otop, basic, fileserver.
-- jQuery at /usr/share/javascript/jquery/jquery.min.js
-- Using system provided jquery for oterm
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
CMake Warning at examples/CMakeLists.txt:37 (message):
Some examples are disabled as you dont have libpng: mandelbrot
-- Configuring incomplete, errors occurred!
See also "/home/npa/workspace/TMOIP/onion/build/CMakeFiles/CMakeOutput.log".
I figured out that the problem was in CMake call of git-version-gen script. I was able to run it manually but it was not running correctly from the CMake because of some permissions setup of my workstation. The problem gone after it was corrected.
it is the third day that I am trying to set up the visual studio 2013 with the GTK libraries. I need to use VS: I've used GCC (both command line and with code blocks) in the past (both on windows and slackware linux too..), but now I have a lot of projects in VS and I want to start making some GUI for them. After seeing that the so called "all-in-one-bundle" is not more available/maintained in the GTK website, I followed a bunch of tutorials (including GTK+ 3.0 setup in Visual Studio 2013, How to configure gtk on Visual studio 2010, How do you install GTK+ 3.0 on Windows?) and I started to install MSYS2 according to this one: https://blogs.gnome.org/nacho/2014/08/01/how-to-build-your-gtk-application-on-windows/.
Maybe the problem is here: I followed this step properly pacman -S mingw-w64-x86_64-toolchain, but I skipped the creation of PKGBUILD file and successive installation due to the fact that I did not understand the procedure. Furthermore the mingw toolchaing seemed to be already installed.
Sorry for the big introduction, I wanted to be specific.
The problem is at the linking-stage of Visual Studio C Project building. I had also some problem at compilation involving the different inline interpretation of VS (added #define inline __inline // Necessary to make the GTK library Visual Studio compatible definition before calling the GTK header). The linking stage issue consist in the fact that, using pkg-config --libs gtk+-3.0 --msvc-syntax command, I receive a list of files (/libpath:C:/msys64/mingw64/lib gtk-3.lib gdk-3.lib gdi32.lib imm32.lib shell32.lib ole32.lib -Wl,-luuid winmm.lib dwmapi.lib z.lib pangowin32-1.0.lib pangocairo-1.0.lib pango-1.0.lib atk-1.0.lib cairo-gobject.lib cairo.lib gdk_pixbuf-2.0.lib gio-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib) that does not exists in the msys2 directory. As a consequence I receive this error from the linker: error LNK1104: cannot open file 'gtk-3.lib'.
Someone has the same problem (see Error 3 error LNK1104: cannot open file 'gtk-3.lib'), but the solution is to use the all-in-one-bundle.
What shall I do? Have I followed the correct procedure or am I missing something? I've also tried to link to VS the *.a files located in the lib directory of mingw63 (e.g. libgtk-3.dll.a), but the linker error remains.
Best Regards and thank you for the attention
Davide
Right, so I'm trying to build a project in VS2012 and I've been chasing down various errors for the past 2 days...I'm coming in on a lot of legacy code, and it deals with OpenCV2.1
So after chasing down all the 3rd party files I needed, I now get the following error:
error C1021: invalid preprocessor command 'cmakedefine' c:\opencv2.1\3rdparty\libtiff\tif_config.h
Line:
/* Define to 1 if you have the <assert.h> header file. */
#cmakedefine HAVE_ASSERT_H
Which the only help I found here:
cannot compile allegro using visual c++
suggesting that I need to rebuild OpenCV with cmake. At which point I get the error:
CMake Error at 3rdparty/libtiff/CMakeLists.txt:27 (ocv_include_directories): Unknown CMake command "ocv_include_directories".
In the visual editor. So I traced that to here.
So I run it in command line as:
cmake C:/OpenCV2.1 -DBUILD_SAMPLES=ON
Which spits out more errors:
CMake Error at 3rdparty/libtiff/CMakeLists.txt:5 (project):
project PROJECT called with incorrect number of arguments
CMake Error at 3rdparty/libtiff/CMakeLists.txt:27 (ocv_include_directories):
Unknown CMake command "ocv_include_directories".
I can't find any documentation for ocv_include_directories. I've tried following multiple OpenCV cmake tutorials, but haven't had any success.
It turns out the problem was actually that I had visual studio 2012, and the codebase I was working in was visual studio 2008 built. There was no possibility to ever track down all of these errors. Solution was to uninstall 2012 and install 2008.
I have a head folder called Tutorial and sub folder called MathFunctions each having one code each
I wrote CMakeLists.txt for both the folders and used cmake in cmd promptand it is working fine.
CMakeLists.txt in head folder has the following:
CMAKE_MINIMUM_REQUIRED ( VERSION 2.6)
PROJECT (Tutorial)
SET (Tutorial_VERSION_MAJOR 1)
SET (Tutorial_VERSION_MINOR 0)
CONFIGURE_FILE (
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h "
)
INCLUDE_DIRECTORIES ("${PROJECT_BINARY_DIR}")
OPTION (USE_MYMATH "Use tutorial provided math implementation" ON)
if (USE_MYMATH)
INCLUDE_DIRECTORIES ("${PROJECT_SOURCE_DIR}/MathFunctions")
ADD_SUBDIRECTORY (MathFunctions)
SET (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
endif (USE_MYMATH)
ADD_EXECUTABLE (Tutorial tutorial.c)
TARGET_LINK_LIBRARIES (Tutorial ${EXTRA_LIBS})
CMakeLists.txt in sub folder has the following:
CMAKE_MINIMUM_REQUIRED ( VERSION 2.6)
add_library (MathFunctions mysqrt.c )
and in command prompt :
C:\home\Tutorial\BUILD>cmake ..
-- Building for: Visual Studio 9 2008
-- Check for working C compiler using: Visual Studio 9 2008
-- Check for working C compiler using: Visual Studio 9 2008 --
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 9 2008
-- Check for working CXX compiler using: Visual Studio 9 2008
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/home/Tutorial/BUILD
Later I made some modifications in MathFunctions.c .I made no changes in Tutorial.c. So i want to re generate make files only for MathFunctions folder. But I am not able to do it. I am getting the following error
C:\home\Tutorial\BUILD>cmake ../MathFunctions
CMake Error: The source "C:/home/Tutorial/MathFunctions/CMakeLists.txt" does not match the source "C:/home/Tutorial/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.
I cannot figure out why this error is coming.
Please help
Thanks
OK, I know this is ancient but...had a similar problem, same error message.
There is a command under File on the GUI that cleans out the cache. This did not work the first time but eventually it did. I thrashed around a bit, adding cmake to the user path, reboot, don't know if any of that helped.
I got into trouble initially by trying to run cmake on a CMakeLists.txt that was NOT the root. This error popped up when I tried again with the proper source directory. V3.1.3.
If you have made modifications to a source file which is already in the project, there is no need to relaunch CMake. Just recompile.
Just remove
.externalNativeBuild
folder from your project and sync it again. By doing this you will remove build cache.