#Hi, who can help me to add cpp libraries to project?

65 messages · Page 1 of 1 (latest)

heady swift
#

I work in vs code. And I want to add xtd library to my project. I was take gradle init with cpp-application. I viewed cmake and make very difficult. But, not as in java gradle projects, gradle cpp project doesnt to download libs from repository as mavenCentral or jCenter. For me as Java developer it is very not understanded.

vagrant bolt
#

there is vcpkg, its a dependency manager that you can use

#

you added the tags linux, windows, mac, on what operating system are you?

vagrant bolt
heady swift
vagrant bolt
#

on linux you can use package manager

#

apt for example

heady swift
wanton stagBOT
#

@heady swift has reached level 1. GG!

heady swift
#

Or can I use vcpkg with gradle?

heady swift
#

Now I will send link

#

How i can add this lib to my project

vagrant bolt
vagrant bolt
#

there is documentation on how to use

heady swift
heady swift
#

Yes, but I used gradle and I have downloaded this library and unarchived

#

And I transform it in my project, but when I run gradle build - crash happens

vagrant bolt
vagrant bolt
#

people usually use cmake because cmake is cool

heady swift
wanton stagBOT
#

@heady swift has reached level 2. GG!

vagrant bolt
#

wait, what ide do you use?

heady swift
#

With special extensions

vagrant bolt
#

cmd -> cmake --version

#

using visual studio would be easier

heady swift
# vagrant bolt cmd -> cmake --version

Now I was trying install cmake and vcpkg, and have it's installed, but when I trying to build cmake real project with vcpkg imported xtd library, I have error in command line

#

CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

heady swift
# vocal canopy Share your CMakeLists.txt

cmake_minimum_required(VERSION 3.20)
project(virtux-desktop-boot)

find_package(xtd REQUIRED)

add_executable(HelloWorld main.cpp)

target_link_libraries(HelloWorld PRIVATE xtd::xtd)

#

CMakePresets:

{
"version": 2,
"configurePresets": [
{
"name": "default",
"generator": "MSYS Makefiles",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
}
]
}

#

MSYS Makefiles is changed by me from Ninja

#

but no working

#

it looks like it, but it still doesn't make much sense to me.

#

cmake --preset=default
Preset CMake variables:

CMAKE_TOOLCHAIN_FILE="D:\Общее\Programs\vcpkg/scripts/buildsystems/vcpkg.cmake"

-- Running vcpkg install
All requested packages are currently installed.
A suitable version of 7zip was not found (required v24.6.0) Downloading portable 7zip 24.6.0...
Downloading 7zip...
https://github.com/ip7z/7zip/releases/download/24.06/7z2406-extra.7z->D:\╨Ю╨▒╤Й╨╡╨╡\Programs\vcpkg\downloads\7z2406-extra.7z
Downloading https://github.com/ip7z/7zip/releases/download/24.06/7z2406-extra.7z
Extracting 7zip...
Total install time: 900 ns
-- Running vcpkg install - done
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.40.33811.0
-- The CXX compiler identification is MSVC 19.40.33811.0
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:2 (project):
No CMAKE_CXX_COMPILER could be found.

-- Configuring incomplete, errors occurred!

#

It with this CMakePresets:
{
"version": 2,
"configurePresets": [
{
"name": "default",
"generator": "Visual Studio 17 2022",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
}
]
}

#

Preset CMake variables:

CMAKE_TOOLCHAIN_FILE="D:\Общее\Programs\vcpkg/scripts/buildsystems/vcpkg.cmake"

-- Running vcpkg install
All requested packages are currently installed.
Total install time: 900 ns
-- Running vcpkg install - done
CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_AR was not found, please set to archive program.
-- Configuring incomplete, errors occurred!

#

Its if
{
"version": 2,
"configurePresets": [
{
"name": "default",
"generator": "MSYS Makefiles",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
}
]
}

#

but i have installed msys2

#

with gcc, g++, gdb etc.

vocal canopy
#

Can you please use code blocks next time?

vocal canopy
heady swift
wanton stagBOT
#

@heady swift has reached level 3. GG!

heady swift
#

Error occurred still

heady swift
#

changed to Ninja and downloaded ninja.exe

vagrant bolt
heady swift
vagrant bolt
heady swift