Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vcpkg installation problem #104

Closed
Belkovinov opened this issue Feb 5, 2024 · 2 comments
Closed

Vcpkg installation problem #104

Belkovinov opened this issue Feb 5, 2024 · 2 comments

Comments

@Belkovinov
Copy link

I did vcpkg install minio-cpp and Qt Creator could not find package configuration file.
"error: Could not find a package configuration file provided by "miniocpp" with any of the following names: miniocppConfig.cmake miniocpp-config.cmake Add the installation prefix of "miniocpp" to CMAKE_PREFIX_PATH or set "miniocpp_DIR" to a directory containing one of the above files. If "miniocpp" provides a separate development package or SDK, be sure it has been installed."
Vcpkg can install another libraries ant they work in Qt Creator.
My OS is Ubuntu 23.10
What can corrupt installation?

@balamurugana
Copy link
Member

Below cmake works fine

cmake_minimum_required(VERSION 3.10)
project(hello)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)

if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
  message(FATAL_ERROR "FATAL: In-source builds are not allowed. You should create a separate directory for build files.")
endif()

set(requiredlibs)

if(CMAKE_COMPILER_IS_GNUCC)
  set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -Werror")
  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0 AND NOT MINGW)
    list(APPEND requiredlibs stdc++fs)
  endif()
endif()

find_path(MINIOCPP_INCLUDE_DIRS miniocpp/client.h)
find_library(MINIOCPP_LIBRARIES miniocpp)
include_directories(${MINIOCPP_INCLUDE_DIRS})
list(APPEND requiredlibs ${MINIOCPP_LIBRARIES})

message(STATUS "Found required libs: ${requiredlibs}")

add_executable(hello main.cpp)
target_link_libraries(hello ${requiredlibs})

@Belkovinov
Copy link
Author

Below cmake works fine

cmake_minimum_required(VERSION 3.10)
project(hello)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)

if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
  message(FATAL_ERROR "FATAL: In-source builds are not allowed. You should create a separate directory for build files.")
endif()

set(requiredlibs)

if(CMAKE_COMPILER_IS_GNUCC)
  set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -Werror")
  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0 AND NOT MINGW)
    list(APPEND requiredlibs stdc++fs)
  endif()
endif()

find_path(MINIOCPP_INCLUDE_DIRS miniocpp/client.h)
find_library(MINIOCPP_LIBRARIES miniocpp)
include_directories(${MINIOCPP_INCLUDE_DIRS})
list(APPEND requiredlibs ${MINIOCPP_LIBRARIES})

message(STATUS "Found required libs: ${requiredlibs}")

add_executable(hello main.cpp)
target_link_libraries(hello ${requiredlibs})

Thank you. It was error in cmakelists file. Now library is connected to the project.

Now i get this problem when i added minio-cpp in the project. What could cause it to happen?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants