Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
426 views
in Technique[技术] by (71.8m points)

visual studio code - vscode c++ - The file "source" cannot be opened: "boolinq/boolinq.h"

I am using VSCode with CMake under Windows and added the following to settings.json to use vcpkg:

{
    "cmake.configureSettings": {
        "CMAKE_TOOLCHAIN_FILE": "C:/Program Files/vcpkg/scripts/buildsystems/vcpkg.cmake"
    }
}

And this is in CMakeList.txt to use boolinq:

cmake_minimum_required(VERSION 3.0.0)
project(passwordtest VERSION 0.1.0)

include(CTest)
enable_testing()

add_executable(passwordtest main.cpp)

find_path(BOOLINQ_INCLUDE_DIRS "boolinq/boolinq.h")
target_include_directories(passwordtest PRIVATE ${BOOLINQ_INCLUDE_DIRS})

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)

And this is my main.cpp:

#include <iostream>
#include <boolinq/boolinq.h>

int main(int, char**) {
    std::cout << "Hello, world!
";
}

But the line with the #include <boolinq/boolinq.h> is underlined in red and it says: The file "source" cannot be opened: "boolinq/boolinq.h" Can someone help me with this problem? I would be grateful for any help.

question from:https://stackoverflow.com/questions/66060463/vscode-c-the-file-source-cannot-be-opened-boolinq-boolinq-h

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...