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

fatal error C1083: Cannot open include file: 'json/json.h': No such file or directory #662

Open
Zhaojun-Liu opened this issue Feb 24, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@Zhaojun-Liu
Copy link

Zhaojun-Liu commented Feb 24, 2023

  • I've read Brief overview section and do understand basic concepts. [Yes]
  • I've read F.A.Q. section and there is no solution to my problem there. [Yes]
  • I've read Code of Conduct, I promise to be polite and will do my best at being constructive. [Yes]
  • I've read Reporting bugs section carefully. [Yes]
  • I've checked that all the hunter_add_package/find_package API used by me in the example is the same as in documentation. [Yes]
  • I'm using latest Hunter URL/SHA1. [Yes]

Hi all,
I tried to build Aleth with VS2022 on Windows, but it failed at the cmake step. Could anyone helps look at this issue? Thanks in advance.

Environment:
VS2022 + Windows Server

Repro steps:

  1. Open a VS 2022 x64 Native Tools command.
  2. git clone https://github.com/ethereum/aleth F:\gitP\ethereum\aleth
  3. cd F:\gitP\ethereum\aleth
  4. git submodule update --init --recursive
  5. mkdir build_amd64 & cd build_amd64
  6. set HUNTER_ROOT=F:\gitP\ethereum\hunter_tools_New
  7. cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 -DCMAKE_BUILD_TYPE=Release ..

CmakeLists.txt
CMakeLists.txt

Result:
F:\gitP\ethereum\hunter_tools_New_Base\8010d63\7ad3772\0db49b4\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release-prefix\src\libjson-rpc-cpp-Release-build\gen\jsonrpccpp\common\jsonparser.h(13,10): fatal error C1083: Cannot open include file: 'json/json.h': No such file or directory (C:\repos\msvc\src\vctools\Compiler\CxxFE\sl\p1\c\p0prepro.c:1955)

detailed logs:
camke.log

@NeroBurner
Copy link

does the same thing happen when you try to compile the json-rpc-cpp example from the Hunter repo? https://github.com/cpp-pm/hunter/blob/master/examples/libjson-rpc-cpp/CMakeLists.txt

@Zhaojun-Liu
Copy link
Author

Hi @NeroBurner,
I tried the json-rpc-cpp example from the Hunter repo, the same error as below:

Checking Build System
    Building Custom Rule F:/hunter/_Base/xxxxxxx/18afadb/e1cac17/Build/libjson-rpc-cpp/Source/src/jsonrpccpp/CMakeLists.txt
    errors.cpp
F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release-prefix\src\libjson-rpc-cpp-Release-build\gen\jsonrpccpp\common\jsonparser.h(13,10): fatal error C1083: Cannot open include file: 'json/json.h': No such file or directory (C:\repos\msvc\src\vctools\Compiler\CxxFE\sl\p1\c\p0prepro.c:1955) [F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release-prefix\src\libjson-rpc-cpp-Release-build\src\jsonrpccpp\common.vcxproj] [F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release.vcxproj]
    exception.cpp
F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release-prefix\src\libjson-rpc-cpp-Release-build\gen\jsonrpccpp\common\jsonparser.h(13,10): fatal error C1083: Cannot open include file: 'json/json.h': No such file or directory (C:\repos\msvc\src\vctools\Compiler\CxxFE\sl\p1\c\p0prepro.c:1955) [F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release-prefix\src\libjson-rpc-cpp-Release-build\src\jsonrpccpp\common.vcxproj] [F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release.vcxproj]
    procedure.cpp
F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release-prefix\src\libjson-rpc-cpp-Release-build\gen\jsonrpccpp\common\jsonparser.h(13,10): fatal error C1083: Cannot open include file: 'json/json.h': No such file or directory (C:\repos\msvc\src\vctools\Compiler\CxxFE\sl\p1\c\p0prepro.c:1955) [F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release-prefix\src\libjson-rpc-cpp-Release-build\src\jsonrpccpp\common.vcxproj] [F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release.vcxproj]
    specificationparser.cpp
F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release-prefix\src\libjson-rpc-cpp-Release-build\gen\jsonrpccpp\common\jsonparser.h(13,10): fatal error C1083: Cannot open include file: 'json/json.h': No such file or directory (C:\repos\msvc\src\vctools\Compiler\CxxFE\sl\p1\c\p0prepro.c:1955) [F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release-prefix\src\libjson-rpc-cpp-Release-build\src\jsonrpccpp\common.vcxproj] [F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release.vcxproj]
    specificationwriter.cpp
F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release-prefix\src\libjson-rpc-cpp-Release-build\gen\jsonrpccpp\common\jsonparser.h(13,10): fatal error C1083: Cannot open include file: 'json/json.h': No such file or directory (C:\repos\msvc\src\vctools\Compiler\CxxFE\sl\p1\c\p0prepro.c:1955) [F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release-prefix\src\libjson-rpc-cpp-Release-build\src\jsonrpccpp\common.vcxproj] [F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release.vcxproj]
    Generating Code...
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: Custom build for 'F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\CMakeFiles\9f5ec4964eacb4fbc840882a51edb310\libjson-rpc-cpp-Release-mkdir.rule;F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\CMakeFiles\9f5ec4964eacb4fbc840882a51edb310\libjson-rpc-cpp-Release-download.rule;F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\CMakeFiles\9f5ec4964eacb4fbc840882a51edb310\libjson-rpc-cpp-Release-update.rule;F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\CMakeFiles\9f5ec4964eacb4fbc840882a51edb310\libjson-rpc-cpp-Release-patch.rule;F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\CMakeFiles\9f5ec4964eacb4fbc840882a51edb310\libjson-rpc-cpp-Release-configure.rule;F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\CMakeFiles\9f5ec4964eacb4fbc840882a51edb310\libjson-rpc-cpp-Release-build.rule;F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\CMakeFiles\9f5ec4964eacb4fbc840882a51edb310\libjson-rpc-cpp-Release-install.rule;F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\CMakeFiles\19fef4e8c90eb21d5e0265405175d8fc\libjson-rpc-cpp-Release-complete.rule;F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\CMakeFiles\1286d4e0ece16bcfef655e2b57d1dd65\libjson-rpc-cpp-Release.rule;F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\CMakeLists.txt' exited with code 1. [F:\hunter\_Base\xxxxxxx\18afadb\e1cac17\Build\libjson-rpc-cpp\Build\libjson-rpc-cpp-Release.vcxproj]

[hunter ** FATAL ERROR **] Build step failed (dir: F:/hunter/_Base/xxxxxxx/18afadb/e1cac17/Build/libjson-rpc-cpp
[hunter ** FATAL ERROR **] [Directory:F:/hunter/cmake/projects/libjson-rpc-cpp]

------------------------------ ERROR -----------------------------
    https://hunter.readthedocs.io/en/latest/reference/errors/error.external.build.failed.html
------------------------------------------------------------------

CMake Error at F:/hunter/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
  F:/hunter/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
  F:/hunter/cmake/modules/hunter_download.cmake:623 (hunter_fatal_error)
  F:/hunter/cmake/projects/libjson-rpc-cpp/hunter.cmake:61 (hunter_download)
  F:/hunter/cmake/modules/hunter_add_package.cmake:62 (include)
  CMakeLists.txt:8 (hunter_add_package)


-- Configuring incomplete, errors occurred!
See also "F:/hunter/examples/libjson-rpc-cpp/build/CMakeFiles/CMakeOutput.log".

@Zhaojun-Liu
Copy link
Author

Hi @NeroBurner, any update for this issue?

@rbsheth rbsheth added the bug Something isn't working label Mar 16, 2023
@NeroBurner
Copy link

There is no entry in the package status page for libjson-rpc-cpp so I can't say if it is an expected error (compiler/OS not supported) or a new error of an outdated package (in comparison to the compiler)

I can confirm that the issue persists compiling on Ubuntu 22.04 with gcc 11.3.0.

So it is probably an always broken package. PRs with a fix and update for the package are very welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants