eosio.cdt icon indicating copy to clipboard operation
eosio.cdt copied to clipboard

CMake error include could not find load file

Open koga73 opened this issue 2 years ago • 4 comments

I used eosio-init to generate the demo project on Ubuntu but am unable to compile it. I am using eosio-cpp version 1.8.1

INPUT:

cd build
cmake ..

OUTPUT:

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/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: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/local/lib/cmake/eosio.cdt/eosio.cdt-config.cmake:8 (include):
  include could not find load file:

    EosioWasmToolchain
Call Stack (most recent call first):
  CMakeLists.txt:4 (find_package)


CMake Error at /usr/local/lib/cmake/eosio.cdt/eosio.cdt-config.cmake:11 (include):
  include could not find load file:

    EosioCDTMacros
Call Stack (most recent call first):
  CMakeLists.txt:4 (find_package)


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.10)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

koga73 avatar Mar 10 '22 20:03 koga73

If you installed cmake after eosio.cdt, it may be unable to locate the necessary cmake modules. You might want to try reinstalling eosio-cdt.

praphael avatar Mar 10 '22 20:03 praphael

The issue turned out that EOSIO_CDT_ROOT was not defined, as a result the cmake script was looking in /tmp/eosio.cdt for the includes. The solution was to add this variable to the cmake command:

cmake .. -DEOSIO_CDT_ROOT=/usr/local

koga73 avatar Apr 08 '22 00:04 koga73

Update - after getting past cmake with the added environment variable I now get stuck on the make command. It turns out that it is a problem with the image "wax-1.8.1-2.0.13wax03" - while this older image works perfectly "wax-1.6.1-2.0.13wax03". Hopefully the team will fix this issue in the next docker image.

koga73 avatar Apr 11 '22 02:04 koga73