OS: Windows 10
Compiler: Visual Studio 2019
SOCI Version: 4.0.2
PostgreSQL Version: 13
CMake VersionL 3.20.3
I'm not too familiar with CMake so bear with me if I'm doing something uninformed and incorrectly.
Steps:
Download and execute postgresql-13.3-2-windows-x64.exe
Download and execute pgadmin4-5.3-x64.exe
Download and extract SOCI 4.0.2
Create build directory in SOCI 4.0.2
Call the following from cmd in the build directory:
cmake -G "Visual Studio 16 2019" .. -DWITH_BOOST=OFF -DWITH_POSTGRESQL=ON -DPOSTGRESQL_INCLUDE_DIR:STRING="c:/Program Files/PostgreSQL/13/include" -DPOSTGRESQL_LIBRARIES:STRING="c:/Program Files/PostgreSQL/13/lib" -DSOCI_STATIC=ON -DSOCI_SHARED=OFF
I got the following output
CMake Deprecation Warning at CMakeLists.txt:13 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042.
-- The C compiler identification is MSVC 19.29.30037.0
-- The CXX compiler identification is MSVC 19.29.30037.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test SOCI_HAVE_VISIBILITY_SUPPORT
-- Performing Test SOCI_HAVE_VISIBILITY_SUPPORT - Failed
-- Looking for _M_AMD64
-- Looking for _M_AMD64 - found
-- Looking for _M_IX86
-- Looking for _M_IX86 - not found
-- Configuring SOCI:
-- SOCI_VERSION = 4.0.2
-- SOCI_ABI_VERSION = 4_0
-- SOCI_SHARED = OFF
-- SOCI_STATIC = ON
-- SOCI_TESTS = ON
-- SOCI_ASAN = OFF
-- SOCI_CXX11 = OFF
-- LIB_SUFFIX = 64
-- Looking for SOCI dependencies:
-- Threads:
-- CMAKE_THREAD_LIBS_INIT =
-- Boost: disabled, since WITH_BOOST=OFF
-- MySQL:
-- Performing Test HAVE_MYSQL_OPT_EMBEDDED_CONNECTION
-- Performing Test HAVE_MYSQL_OPT_EMBEDDED_CONNECTION - Failed
-- MySQL not found.
-- MySQL Embedded not found.
-- WARNING: MySQL libraries not found, some features will be disabled.
-- ODBC:
-- ODBC_INCLUDE_DIR =
-- ODBC_LIBRARIES = odbc32.lib
-- Oracle:
-- ORACLE_HOME=
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (ORACLE)
does not match the name of the calling package (Oracle). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/modules/FindOracle.cmake:84 (find_package_handle_standard_args)
cmake/dependencies/Oracle.cmake:3 (find_package)
cmake/SociDependencies.cmake:79 (include)
CMakeLists.txt:129 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- None of the supported Oracle versions (19;18;12;11;10) could be found, consider updating ORACLE_VERSIONS if the version you use is not among them.
-- WARNING: Oracle libraries not found, some features will be disabled.
-- PostgreSQL:
-- WARNING: PostgreSQL libraries not found, some features will be disabled.
-- SQLite3:
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (SQLITE3)
does not match the name of the calling package (SQLite3). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/modules/FindSQLite3.cmake:57 (find_package_handle_standard_args)
cmake/dependencies/SQLite3.cmake:3 (find_package)
cmake/SociDependencies.cmake:79 (include)
CMakeLists.txt:129 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- SQLite3 not found (SQLITE3_INCLUDE_DIR=SQLITE3_INCLUDE_DIR-NOTFOUND, SQLITE3_LIBRARY=SQLITE3_LIBRARY-NOTFOUND.
-- WARNING: SQLite3 libraries not found, some features will be disabled.
-- Firebird:
-- SOCI_FIREBIRD_EMBEDDED = OFF
-- WARNING: Firebird libraries not found, some features will be disabled.
-- DB2:
-- WARNING: DB2 libraries not found, some features will be disabled.
-- Configuring SOCI core library:
-- SOCI_CORE_TARGET = soci_core
-- SOCI_CORE_TARGET_OUTPUT_NAME = soci_core_4_0
-- SOCI_CORE_DEPS_LIBS =
-- SOCI_CORE_INCLUDE_DIRS = C:/Users/Hbagh/Downloads/soci-4.0.2/build C:/Users/Hbagh/Downloads/soci-4.0.2/include C:/Users/Hbagh/Downloads/soci-4.0.2/build/include C:/Users/Hbagh/Downloads/soci-4.0.2/include/private C:/Users/Hbagh/Downloads/soci-4.0.2/build/src/core
-- WITH_BOOST = OFF
-- COMPILE_DEFINITIONS = _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNING _SCL_SECURE_NO_WARNINGS SOCI_ABI_VERSION="4_0" DBUG_OFF SOCI_LIB_PREFIX="soci_" SOCI_LIB_SUFFIX=".dll" SOCI_DEBUG_POSTFIX=""
--
-- Configuring SOCI backend libraries:
-- MySQL not found.
-- MySQL Embedded not found.
-- ORACLE_HOME=
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (ORACLE)
does not match the name of the calling package (Oracle). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/modules/FindOracle.cmake:84 (find_package_handle_standard_args)
src/backends/CMakeLists.txt:17 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- None of the supported Oracle versions (19;18;12;11;10) could be found, consider updating ORACLE_VERSIONS if the version you use is not among them.
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (SQLITE3)
does not match the name of the calling package (SQLite3). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/modules/FindSQLite3.cmake:57 (find_package_handle_standard_args)
src/backends/CMakeLists.txt:17 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- SQLite3 not found (SQLITE3_INCLUDE_DIR=SQLITE3_INCLUDE_DIR-NOTFOUND, SQLITE3_LIBRARY=SQLITE3_LIBRARY-NOTFOUND.
-- Empty - SOCI backend skeleton for new backends development
-- SOCI_EMPTY = ON
-- SOCI_EMPTY_TARGET = soci_empty
-- SOCI_EMPTY_OUTPUT_NAME = soci_empty_4_0
-- SOCI_EMPTY_COMPILE_DEFINITIONS = _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNING _SCL_SECURE_NO_WARNINGS SOCI_ABI_VERSION="4_0" DBUG_OFF DBUG_OFF
-- SOCI_EMPTY_INCLUDE_DIRECTORIES = C:/Users/Hbagh/Downloads/soci-4.0.2/build C:/Users/Hbagh/Downloads/soci-4.0.2/include C:/Users/Hbagh/Downloads/soci-4.0.2/build/include C:/Users/Hbagh/Downloads/soci-4.0.2/include/private C:/Users/Hbagh/Downloads/soci-4.0.2/include/private
-- ODBC - SOCI backend for ODBC
-- SOCI_ODBC = ON
-- SOCI_ODBC_TARGET = soci_odbc
-- SOCI_ODBC_OUTPUT_NAME = soci_odbc_4_0
-- SOCI_ODBC_COMPILE_DEFINITIONS = _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNING _SCL_SECURE_NO_WARNINGS SOCI_ABI_VERSION="4_0" DBUG_OFF DBUG_OFF
-- SOCI_ODBC_INCLUDE_DIRECTORIES = C:/Users/Hbagh/Downloads/soci-4.0.2/build C:/Users/Hbagh/Downloads/soci-4.0.2/include C:/Users/Hbagh/Downloads/soci-4.0.2/build/include C:/Users/Hbagh/Downloads/soci-4.0.2/include/private C:/Users/Hbagh/Downloads/soci-4.0.2/include/private
--
-- Configuring SOCI tests:
-- SOCI_EMPTY_TEST_CONNSTR = dummy
-- SOCI_ODBC_TEST_ACCESS_CONNSTR = FILEDSN=C:/Users/Hbagh/Downloads/soci-4.0.2/tests/odbc/test-access.dsn
-- SOCI_ODBC_TEST_MSSQL_CONNSTR = FILEDSN=C:/Users/Hbagh/Downloads/soci-4.0.2/tests/odbc/test-mssql.dsn
-- SOCI_ODBC_TEST_MYSQL_CONNSTR = FILEDSN=C:/Users/Hbagh/Downloads/soci-4.0.2/tests/odbc/test-mysql.dsn
-- SOCI_ODBC_TEST_POSTGRESQL_CONNSTR = FILEDSN=C:/Users/Hbagh/Downloads/soci-4.0.2/tests/odbc/test-postgresql-win64.dsn
-- ODBC DB2 test disabled.
--
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
POSTGRESQL_LIBRARIES
-- Build files have been written to: C:/Users/Hbagh/Downloads/soci-4.0.2/build
The following stands out to me:
-- PostgreSQL:
-- WARNING: PostgreSQL libraries not found, some features will be disabled.
CMake Warning:
Manually-specified variables were not used by the project:
POSTGRESQL_LIBRARIES
Related
I tried to install mingw package from vcpkg but I got an error
C:\Users\Administrator\Downloads\vcpkg>vcpkg.exe install curl:x64-mingw-static
Computing installation plan...
The following packages will be built and installed:
curl[core,non-http,schannel,ssl,sspi]:x64-mingw-static -> 7.82.0
* zlib[core]:x64-mingw-static -> 1.2.12
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-mingw-static...
Error: while detecting compiler information:
The log content at C:\Users\Administrator\Downloads\vcpkg\buildtrees\detect_compiler\stdout-x64-mingw-static.log is:
-- Configuring x64-mingw-static
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:128 (message):
Command failed: ninja -v
Working Directory: C:/Users/Administrator/Downloads/vcpkg/buildtrees/detect_compiler/x64-mingw-static-rel/vcpkg-parallel-configure
Error code: 1
See logs for more information:
C:\Users\Administrator\Downloads\vcpkg\buildtrees\detect_compiler\config-x64-mingw-static-out.log
Call Stack (most recent call first):
scripts/cmake/vcpkg_configure_cmake.cmake:370 (vcpkg_execute_required_process)
scripts/detect_compiler/portfile.cmake:18 (vcpkg_configure_cmake)
scripts/ports.cmake:145 (include)
Error: vcpkg was unable to detect the active compiler's information. See above for the CMake failure output.
C:\Users\Administrator\Downloads\vcpkg>
How can I fix it? I have mingw installed on C:/mingw64 and C:/mingw32 and I'm using them in CLion without problems
Error in config-x64-mingw-static-out.log
[1/1] cmd /c "cd .. && "C:/Users/Administrator/Downloads/vcpkg/downloads/tools/cmake-3.22.2-windows/cmake-3.22.2-windows-i386/bin/cmake.exe" "C:/Users/Administrator/Downloads/vcpkg/scripts/detect_compiler" "-DCMAKE_MAKE_PROGRAM=C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/Users/Administrator/Downloads/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows-static" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v143" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=C:/Users/Administrator/Downloads/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=static" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=C:/Users/Administrator/Downloads/vcpkg" "-DZ_VCPKG_ROOT_DIR=C:/Users/Administrator/Downloads/vcpkg" "-D_VCPKG_INSTALLED_DIR=C:/Users/Administrator/Downloads/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=C:/Users/Administrator/Downloads/vcpkg/packages/detect_compiler_x64-windows-static""
-- The C compiler identification is MSVC 19.31.31107.0
-- The CXX compiler identification is MSVC 19.31.31107.0
#COMPILER_HASH#c3649029c7e070e5f43d9ce4d317605f000f9404
#COMPILER_C_HASH#2db604846bbf78fdf1b811ea56df2670f6b33536
#COMPILER_C_VERSION#19.31.31107.0
#COMPILER_C_ID#MSVC
#COMPILER_CXX_HASH#2db604846bbf78fdf1b811ea56df2670f6b33536
#COMPILER_CXX_VERSION#19.31.31107.0
#COMPILER_CXX_ID#MSVC
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_SHARED_LIBS
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_LIBDIR
VCPKG_TARGET_ARCHITECTURE
_VCPKG_ROOT_DIR
-- Build files have been written to: C:/Users/Administrator/Downloads/vcpkg/buildtrees/detect_compiler/x64-windows-static-rel
It looks like it detects microsoft compiler instead of mingw
The problem was not set gcc.exe in PATH, adding it resolved problem
This refers to the original question posted by Tom Doodler, and answered by Norbert Boros, on the same topic. I am also trying to get the MySQL Connector/C or /C++ to work. Using MS Visual Studio 2017. Following the steps in the answer, did all the steps till :
Run this command ( assuming you want the STATIC DEBUG ):
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Debug -DBUILD_STATIC=true -DBUNDLE_DEPENDENCIES=ON -DSTATIC_MSVCRT=OFF -DWITH_JDBC=ON
The output on the screen says:
Configuring incomplete, errors occurred! in the last few lines. No "MYSQLCPPCONN.sln" either.
I have a pdf of the output but do not know how to attach it here. The output says three files are missing and one test failed, these are towards the end of the file, highlighted. Of course, their could be more problems that I could not identify, being a green thumb.
Any ideas about how to address this ?
I found Protobuf.sln at E:\MySQL C++ Connector Unresolved Dependencies (VS 2015) *\mysql-connector-cpp-master\cdk\protobuf*. would this be of any use ?
Here is part of the output where problems occurred (there could be more problems elsewhere, have no idea. Also, had to format the output as "code", a posting requirement on the forum ?):
-- Looking for pthread.h
-- Looking for pthread.h - not found
.
.
-- Performing Test HAVE_STATIC_ASSERT - Success
-- Performing Test HAVE_IS_SAME
-- Performing Test HAVE_IS_SAME - Failed
-- Performing Test HAVE_SHARED_PTR
-- Performing Test HAVE_SHARED_PTR - Success
-- Performing Test HAVE_SYSTEM_ERROR
-- Performing Test HAVE_SYSTEM_ERROR - Success
-- Check size of wchar_t
-- Check size of wchar_t - done
-- Looking for sys/endian.h
-- Looking for sys/endian.h - not found
-- Looking for sys/byteorder.h
-- Looking for sys/byteorder.h - not found
Wrote configuration header: E:/MySQL C++ Connector Unresolved Dependencies (VS 2
015)/mysql-connector-cpp-master/cdk/include/mysql/cdk/config.h
Legacy library soversion: 7
Looking for MySQL Client library:
CMake Error at jdbc/cmake/DepFindMySQL.cmake:128 (message):
Could not find MySQL headers at:
Point at MySQL client library location using WITH_MYSQL or
MYSQL_INCLUDE_DIR, MYSQL_LIB_DIR settings.
Call Stack (most recent call first):
jdbc/cmake/DepFindMySQL.cmake:555 (main)
cdk/cmake/dependency.cmake:42 (include)
jdbc/CMakeLists.txt:147 (find_dependency)
-- Configuring incomplete, errors occurred!
As the title says. I'm trying to compile the code found on Google's Github. I don't know much about CMake. First I ran the following command as per instructions:
git submodule update --init --recursive
I got the following error message: fatal: not a git repository (or any of the parent directories): .git. After that I tried to run the following build command:
cmake -DCRC32C_BUILD_TESTS=0 -DCRC32C_BUILD_BENCHMARKS=0 .. && make all install
The output is shown below:
l install
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.22.27905.0
-- The CXX compiler identification is MSVC 19.22.27905.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Performing Test CRC32C_HAVE_NO_DEPRECATED
-- Performing Test CRC32C_HAVE_NO_DEPRECATED - Failed
-- Performing Test CRC32C_HAVE_NO_SIGN_COMPARE
-- Performing Test CRC32C_HAVE_NO_SIGN_COMPARE - Failed
-- Performing Test CRC32C_HAVE_NO_UNUSED_PARAMETER
-- Performing Test CRC32C_HAVE_NO_UNUSED_PARAMETER - Failed
-- Performing Test CRC32C_HAVE_NO_MISSING_FIELD_INITIALIZERS
-- Performing Test CRC32C_HAVE_NO_MISSING_FIELD_INITIALIZERS - Failed
-- Performing Test HAVE_BUILTIN_PREFETCH
-- Performing Test HAVE_BUILTIN_PREFETCH - Failed
-- Performing Test HAVE_MM_PREFETCH
-- Performing Test HAVE_MM_PREFETCH - Success
-- Performing Test HAVE_SSE42
-- Performing Test HAVE_SSE42 - Success
-- Performing Test HAVE_ARM64_CRC32C
-- Performing Test HAVE_ARM64_CRC32C - Failed
-- Performing Test HAVE_STRONG_GETAUXVAL
-- Performing Test HAVE_STRONG_GETAUXVAL - Failed
-- Performing Test HAVE_WEAK_GETAUXVAL
-- Performing Test HAVE_WEAK_GETAUXVAL - Failed
CMake Error at CMakeLists.txt:184 (add_subdirectory):
The source directory
C:/Source/crc32c-master/third_party/glog
does not contain a CMakeLists.txt file.
-- Configuring incomplete, errors occurred!
See also "C:/Source/crc32c-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/Source/crc32c-master/build/CMakeFiles/CMakeError.log".
I looked at the error log, but didn't get much help there. the third_party/glog directory is empty, so there wasn't any CMakeLists.txt file like there should have been. (The /benchmark and /googletest subdirectories under /third_party were also empty. ?)
Has anybody successfully built this using Visual Studio? If so, how?
I don't think it matters much, but I'm using VS2019 Community Edition 16.2.5 and CMake 3.15.2. TIA.
Alan Birtles gave me the correct answer.
I had just downloaded the .zip file, when I needed to do a git clone of the files. After that, everything worked like it was supposed to. Big thanks to Alan Birtles.
Environment:
OS: Fedora Release 26
Compiler: g++ (GCC) 7.2.1
CEGUI: 0.8.7
Configured with: cmake .. -DCEGUI_BUILD_RENDERER_OPENGL=OFF -DCEGUI_BUILD_RENDERER_OPENGL3=ON -DCEGUI_USE_EPOXY=ON -DCEGUI_USE_GLEW=OFF
Epoxy: Latest version from https://github.com/yaronct/libepoxy
PowerVR Graphics SDK and Tools: v2017_R2 from
https://community.imgtec.com/developers/powervr/graphics-sdk/
Code:
CEGUI::OpenGL3Renderer& myRenderer = CEGUI::OpenGL3Renderer::bootstrapSystem();
Error:
CEGUI::RendererException in function 'void
CEGUI::OpenGLInfo::initTypeAndVer()'
(/home/jay/tmp/cegui/cegui-0.8.7/cegui/src/RendererModules/OpenGL/GL.cpp:88)
: Failed to obtain desktop OpenGL version. terminate called after
throwing an instance of 'CEGUI::RendererException' what():
CEGUI::RendererException in function 'void
CEGUI::OpenGLInfo::initTypeAndVer()'
(/home/jay/tmp/cegui/cegui-0.8.7/cegui/src/RendererModules/OpenGL/GL.cpp:88)
: Failed to obtain desktop OpenGL version.
Include from header file:
#include <epoxy/gl.h>
Just in case this is helpful. Here is the output of the cmake to show what it was able to find and what it was not:
sudo cmake .. -DCEGUI_BUILD_RENDERER_OPENGL=OFF -DCEGUI_BUILD_RENDERER_OPENGL3=ON -DCEGUI_USE_EPOXY=ON -DCEGUI_USE_GLEW=OFF
CMake Deprecation Warning at CMakeLists.txt:6 (cmake_policy):
The OLD behavior for policy CMP0017 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- The C compiler identification is GNU 7.2.1
-- The CXX compiler identification is GNU 7.2.1
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /bin/c++
-- Check for working CXX compiler: /bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PCRE: /usr/lib64/libpcre.so
-- Found FREETYPE: /usr/lib64/libfreetype.so
-- Found MINIZIP: /usr/lib64/libminizip.so
-- Found PkgConfig: /bin/pkg-config (found version "1.3.12")
-- Checking for module 'fribidi'
-- Found fribidi, version 0.19.7
-- Found FRIBIDI: TRUE
-- Looking for iconv
-- Looking for iconv - found
-- Found OpenGL: /usr/lib64/libOpenGL.so
-- Found GLEW: /usr/lib64/libGLEW.so
-- Found GLM: /usr/include
-- Could NOT find GLFW (missing: GLFW_H_PATH)
-- Found GLFW3: /usr/lib64/libglfw.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found SDL2: /usr/lib64/libSDL2.so;-lpthread
-- Found SDL2IMAGE: /usr/lib64/libSDL2_image.so
-- Could NOT find DIRECTXSDK (missing: DIRECTXSDK_LIB_PATH DIRECTXSDK_H_PATH DIRECTXSDK_MAX_D3D)
-- Could NOT find D3DX11EFFECTS (missing: D3DX11EFFECTS_LIB D3DX11EFFECTS_H_PATH)
-- Found IRRLICHT: /usr/lib64/libIrrlicht.so
-- Could NOT find OGRE (missing: OGRE_LIB OGRE_H_PATH OGRE_H_BUILD_SETTINGS_PATH)
-- Found OIS: /usr/lib64/libOIS.so
-- Could NOT find DIRECTFB (missing: DIRECTFB_LIB DIRECTFB_H_PATH)
-- Could NOT find OPENGLES (missing: OPENGLES_LIB OPENGLES_H_PATH)
-- Found EPOXY: /usr/local/lib64/libepoxy.so
-- Found EXPAT: /usr/lib64/libexpat.so
-- Could NOT find XERCESC (missing: XERCESC_LIB XERCESC_H_PATH)
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.9.4")
-- Found TINYXML: /usr/lib64/libtinyxml.so
-- Performing Test TINYXML_API_TEST
-- Performing Test TINYXML_API_TEST - Success
-- Could NOT find RAPIDXML (missing: RAPIDXML_H_PATH)
-- Could NOT find IL (missing: IL_LIB IL_H_PATH)
-- Could NOT find ILU (missing: ILU_LIB)
-- Found FREEIMAGE: /usr/lib64/libfreeimage.so
-- Found SILLY: /usr/lib64/libSILLY.so
-- Could NOT find CORONA (missing: CORONA_LIB CORONA_H_PATH)
-- Could NOT find PVRTOOLS (missing: PVRTOOLS_LIB PVRTOOLS_H_PATH)
-- Found LUA51: /usr/lib64/liblua.so
-- Found TOLUAPP: /usr/lib64/libtolua++.so
-- Found PythonInterp: /bin/python (found version "2.7.14")
-- Found PythonLibs: //lib64/libpython2.7.so (found suitable exact version "2.7.14")
-- Boost version: 1.63.0
-- Found the following Boost libraries:
-- python
-- unit_test_framework
-- system
-- timer
-- Found Doxygen: /bin/doxygen (found version "1.8.13") found components: doxygen missing components: dot
-- Found GTK2_GTK: /usr/lib64/libgtk-x11-2.0.so
-- Configuring done
-- Generating done
-- Build files have been written to: xxx
I was able to resolve this issue and I wanted to share what worked for me.
The issue was that Epoxy was not finding the active context. OSG does not currently set the context that you have open ( which might be your only context ) as the current context. You have to manually set it as the current context as follows:
// You will need to have realized the viewer at least once
viewer.realize();
// You can get your camera's primary context by calling getGraphicsContext
// on it. I then also called realize on it. I'm not 100% certain if this
// is necessary, but it seemed to .
viewer.getCamera()->getGraphicsContext()->realize();
// Set the GraphicsContext as the current GraphicsContext.
viewer.getCamera()->getGraphicsContext()->makeCurrent();
Epoxy now sees the current context and this error goes away.
I'd like to test how biicode allows me to quickly create a project that uses boost. I (think I) have followed the procedure outlined in the bii docs.
After modifying the CMakeLists.txt, the configuration step does not succeed. The boost library does not seem to build to be built. I know that sometimes the configure step needs to be done twice (according to http://forum.biicode.com/t/error-could-not-find-the-following-static-boost-libraries-boost-thread/374), but this does not help.
I have pasted the exact steps I took below. I'd be very grateful if someone could show me where I went wrong.
1. Environnement : Windows 7 x64, Visual Studio 10 SP 1
PS G:\> bii --version
3.2
PS G:\> cmake --version
cmake version 3.2.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
PS G:\>
2. Start in a clean folder (G:\biitests)
3. Init the bii project
PS G:\biitests> bii init boostUsageTest -L
Successfully initialized biicode project boostUsageTest
4. Create the G:\biitests\boostUsageTest\main.cpp file with the following contents:
#include <boost/lexical_cast.hpp>
#include <boost/thread/mutex.hpp>
#include <iostream>
#include <exception>
int main (int argc, char *argv[])
{
boost::mutex uselessMutex;
auto value = boost::lexical_cast<int>(argv[0]);
std::cout << "value = " << value << std::endl;
return 0;
}
5. bii find
PS G:\biitests\boostUsageTest> bii find
INFO: Processing changes...
WARN: There are local unresolved dependencies
They will not be searched in the server
Unresolved: boost/lexical_cast.hpp
INFO: Finding missing dependencies in server
INFO: Looking for boost/thread...
WARN: Can't find block candidate for: boost/thread
INFO: No block candidates found
6. bii configure
PS G:\biitests\boostUsageTest> bii cpp:configure -G "Visual Studio 10"
INFO: Processing changes...
Running: "cmake" -G "Visual Studio 10" -Wno-dev ..\cmake
-- The C compiler identification is MSVC 16.0.40219.1
-- The CXX compiler identification is MSVC 16.0.40219.1
-- Check for working C compiler using: Visual Studio 10 2010
-- Check for working C compiler using: Visual Studio 10 2010 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10 2010
-- Check for working CXX compiler using: Visual Studio 10 2010 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
BLOCK: user/boostUsageTest
-----------------------------------------------------------
+ LIB: user_boostUsageTest
+ EXE: user_boostUsageTest_main
-- Configuring done
-- Generating done
-- Build files have been written to: G:/biitests/boostUsageTest/bii/build
PS G:\biitests\boostUsageTest>
7. edit CMakeLists.txt in the following way
(before my changes, the only non-commented line was ADD_BII_TARGETS() )
include(biicode/boost/setup)
INIT_BIICODE_BLOCK()
# Create Targets
ADD_BII_TARGETS()
bii_find_boost(COMPONENTS thread REQUIRED)
8. run bii find again
PS G:\biitests\boostUsageTest> bii find --update
INFO: Processing changes...
WARN: There are local unresolved dependencies
They will not be searched in the server
Unresolved: boost/lexical_cast.hpp
INFO: Finding missing dependencies in server
INFO: Looking for biicode/boost...
INFO: Block candidate: biicode/biicode/boost/master
INFO: Version biicode/boost: 9 (DEV) discarded
INFO: Version biicode/boost: 8 (STABLE) valid
INFO: Version biicode/boost: 7 (STABLE) valid
INFO: Version biicode/boost: 6 (STABLE) valid
INFO: Version biicode/boost: 5 (STABLE) valid
INFO: Version biicode/boost: 4 (STABLE) valid
INFO: Version biicode/boost: 3 (STABLE) valid
INFO: Version biicode/boost: 2 (STABLE) valid
INFO: Version biicode/boost: 1 (STABLE) valid
INFO: Version biicode/boost: 0 (STABLE) valid
INFO: Looking for boost/thread...
WARN: Can't find block candidate for: boost/thread
INFO: Analyzing compatibility for found dependencies...
Find resolved new dependencies:
biicode/boost: 8
ERROR: Find could not resolve:
boost/thread/mutex.hpp
INFO: Saving files from: toeb/cmakepp
INFO: Saving files from: biicode/boost
INFO: Saving files from: boost/install
9. Run bii configure again
PS G:\biitests\boostUsageTest> bii cpp:configure -G "Visual Studio 10"
INFO: Processing changes...
Running: "cmake" -G "Visual Studio 10" -Wno-dev ..\cmake
BLOCK: user/boostUsageTest
-----------------------------------------------------------
CALLING INIT_BIICODE_BLOCK IS NO LONGER NECESSARY
+ LIB: user_boostUsageTest
+ EXE: user_boostUsageTest_main
-- No linking type specified. Assuming static linking
-- Setting up biicode Boost configuration...
-- Building Boost 1.57.0 components with toolset msvc-10.0...
Starting thread library build job...
Building Boost components, please wait [ ]
Finished building thread library
-- Boost version: 1.57.0
CMake Error at ../deps/toeb/cmakepp/cmake/core/message.cmake:94 (_message):
Unable to find the requested Boost libraries.
Boost version: 1.57.0
Boost include path: G:/Users/bgo/.biicode/boost/1.57.0
Could not find the following static Boost libraries:
boost_thread
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindBoost.cmake:1182 (message)
../deps/toeb/cmakepp/cmake/targets/find_package.cmake:17 (_find_package)
../deps/boost/install/install.cmake:351 (find_package)
../../CMakeLists.txt:9 (bii_find_boost)
-- Configuring incomplete, errors occurred!
See also "G:/biitests/boostUsageTest/bii/build/CMakeFiles/CMakeOutput.log".
ERROR: CMake failed
And running bii cpp:configure after that always gives the exact same output.
Thanks a lot in advance !
Benjamin