I was trying to compile a contract with the following includes:
#include <eosio/eosio.hpp>
#include <eosio/asset.hpp>
#include <eosio/contract.hpp>
#include <eosiolib/crypto.h>
#include <string>
The compiler raised a warning with the following text: #warning "<eosiolib/crypto.h> is deprecated use <eosio/crypto.h>. however the text should suggest to use <eosio/crypto.hpp> instead because the include <eosio/crypto.h> do not exist.

@Dexaran Hey, this is more of a eosio-cdt issue, but I'm glad to help either way. So the warning you are getting is actually in good form.
Let me explain:
There are two main tools to work with when developing smart contracts using EOSIO's contract development toolkit: eosio-cc and eosio-cpp.
#include <eosio/eosio.hpp>
struct [[eosio::contract]] test : public eosio::contract {
using contract::contract;
[[eosio::action]] void act()
{ }
};
Given this minimal smart contract with a no-op action, we can see that it includes one file;
#include <eosio/eosio.hpp>.
But you might ask, where in the world is that file?
On my mac I can see that these _includes_ can be found in the directory: /usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/.
In here you will find five directories:
total 8
drwxr-xr-x 28 john.debord staff 896 2019-03-22 19:03 boost
drwxr-xr-x 3 john.debord staff 96 2019-03-22 19:03 eosio
drwxr-xr-x 41 john.debord staff 1312 2019-04-09 15:13 eosiolib
drwxr-xr-x 59 john.debord staff 1888 2019-03-22 19:03 libc
drwxr-xr-x 127 john.debord staff 4064 2019-03-22 19:03 libcxx
You might be thinking, "Oh, so the files that get included are in directory eosio/".
That's actually not the case.
If we look at the directory structure, we can see that this directory is where the files for testing and running smart contracts natively reside.
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include $ ll
total 8
drwxr-xr-x 28 john.debord staff 896 2019-03-22 19:03 boost
drwxr-xr-x 3 john.debord staff 96 2019-03-22 19:03 eosio
drwxr-xr-x 41 john.debord staff 1312 2019-04-09 15:13 eosiolib
drwxr-xr-x 59 john.debord staff 1888 2019-03-22 19:03 libc
drwxr-xr-x 127 john.debord staff 4064 2019-03-22 19:03 libcxx
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include $ tree eosio/
eosio/
โโโ native
โโโ crt.hpp
โโโ intrinsics.hpp
โโโ intrinsics_def.hpp
โโโ native
โย ย โโโ eosio
โย ย โโโ crt.hpp
โย ย โโโ intrinsics.hpp
โย ย โโโ intrinsics_def.hpp
โย ย โโโ tester.hpp
โโโ tester.hpp
3 directories, 8 files
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include $
The directories that we're primarily concerned with are in the directory eosiolib/.
If we follow that directory structure we can see that the ones we are particularly interested in are the subdirectories capi/, contracts/, core/, and native/.
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib $ ls
action.h contracts eosio.hpp permission.hpp serialize.hpp transaction.h
action.hpp core fixed_bytes.hpp print.h singleton.hpp transaction.hpp
asset.hpp crypto.h ignore.hpp print.hpp stdlib.hpp types.h
binary_extension.hpp crypto.hpp multi_index.hpp privileged.h symbol.hpp varint.hpp
capi datastream.hpp name.hpp privileged.hpp system.h
chain.h db.h native producer_schedule.hpp system.hpp
contract.hpp dispatcher.hpp permission.h public_key.hpp time.hpp
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib $ tree
.
โโโ action.h
โโโ action.hpp
โโโ asset.hpp
โโโ binary_extension.hpp
โโโ capi
โย ย โโโ eosio
โย ย โโโ action.h
โย ย โโโ chain.h
โย ย โโโ crypto.h
โย ย โโโ db.h
โย ย โโโ permission.h
โย ย โโโ print.h
โย ย โโโ privileged.h
โย ย โโโ system.h
โย ย โโโ transaction.h
โย ย โโโ types.h
โโโ chain.h
โโโ contract.hpp
โโโ contracts
โย ย โโโ eosio
โย ย โโโ action.hpp
โย ย โโโ contract.hpp
โย ย โโโ dispatcher.hpp
โย ย โโโ eosio.hpp
โย ย โโโ multi_index.hpp
โย ย โโโ permission.hpp
โย ย โโโ privileged.hpp
โย ย โโโ producer_schedule.hpp
โย ย โโโ singleton.hpp
โย ย โโโ system.hpp
โย ย โโโ transaction.hpp
โโโ core
โย ย โโโ eosio
โย ย โโโ asset.hpp
โย ย โโโ binary_extension.hpp
โย ย โโโ check.hpp
โย ย โโโ crypto.hpp
โย ย โโโ datastream.hpp
โย ย โโโ fixed_bytes.hpp
โย ย โโโ ignore.hpp
โย ย โโโ name.hpp
โย ย โโโ print.hpp
โย ย โโโ rope.hpp
โย ย โโโ serialize.hpp
โย ย โโโ symbol.hpp
โย ย โโโ time.hpp
โย ย โโโ varint.hpp
โโโ crypto.h
โโโ crypto.hpp
โโโ datastream.hpp
โโโ db.h
โโโ dispatcher.hpp
โโโ eosio.hpp
โโโ fixed_bytes.hpp
โโโ ignore.hpp
โโโ multi_index.hpp
โโโ name.hpp
โโโ native
โย ย โโโ eosio
โย ย โโโ crt.hpp
โย ย โโโ intrinsics.hpp
โย ย โโโ intrinsics_def.hpp
โย ย โโโ tester.hpp
โโโ permission.h
โโโ permission.hpp
โโโ print.h
โโโ print.hpp
โโโ privileged.h
โโโ privileged.hpp
โโโ producer_schedule.hpp
โโโ public_key.hpp
โโโ serialize.hpp
โโโ singleton.hpp
โโโ stdlib.hpp
โโโ symbol.hpp
โโโ system.h
โโโ system.hpp
โโโ time.hpp
โโโ transaction.h
โโโ transaction.hpp
โโโ types.h
โโโ varint.hpp
8 directories, 74 files
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib $
So, when you're developing a smart contract and include the file:
#include <eosio/eosio.hpp>, you're actually including the file: /usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/contracts/eosio/eosio.hpp.
And when you include the file:
#include <eosiolib/eosio.hpp>,
you're actually including:
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/eosio.hpp.
Note that this former include has been deprecated and not encouraged; hence the warnings.
Now let's get back to your warning which is found in file: /usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/crypto.h.
/**
* @file
* @copyright defined in eos/LICENSE
*/
#pragma once
#include "types.h"
#warning "<eosiolib/crypto.h> is deprecated use <eosio/crypto.h>. If you are using C++ the .h header files will be removed from inclusion entirely in v1.7.0"
// ...
This warning is actually in good form because the file /usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/crypto.h should never be included in the first place when using C++ and the contract development toolkit; instead, the file /usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/core/eosio/crypto.hpp should have been included because it provides C++ wrappers over the C functions that would be called otherwise.
This particular warning is meant for someone working on a project in C; where including /usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/capi/eosio/crypto.h is found perfectly fine when using the eosio-cc compiler.
Note that this confusion is only temporary, though.
Hopefully that clears up how the new directory structure works, as well as how the deprecations will take full effect post eosio.cdt v1.7.0.
@johndebord thank you for the excellent explanation. having just upgraded to 1.6.1 it seems that every reference to eosiolib in an include needs to be replaced with eosio though this is not stated in the release notes or anywhere. how does eosio-cpp know what directories to look for the includes in? (and what directories do I now need in my c_cpp_properties.json in VSCode?
You need to use:
#include <eosio/crypto.hpp>
Most helpful comment
@Dexaran Hey, this is more of a eosio-cdt issue, but I'm glad to help either way. So the warning you are getting is actually in good form.
Let me explain:
There are two main tools to work with when developing smart contracts using EOSIO's contract development toolkit:
eosio-ccandeosio-cpp.Given this minimal smart contract with a no-op action, we can see that it includes one file;
#include <eosio/eosio.hpp>.But you might ask, where in the world is that file?
On my mac I can see that these _includes_ can be found in the directory:
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/.In here you will find five directories:
You might be thinking, "Oh, so the files that get included are in directory
eosio/".That's actually not the case.
If we look at the directory structure, we can see that this directory is where the files for testing and running smart contracts natively reside.
The directories that we're primarily concerned with are in the directory
eosiolib/.If we follow that directory structure we can see that the ones we are particularly interested in are the subdirectories
capi/,contracts/,core/, andnative/.So, when you're developing a smart contract and include the file:
#include <eosio/eosio.hpp>, you're actually including the file:/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/contracts/eosio/eosio.hpp.And when you include the file:
#include <eosiolib/eosio.hpp>,you're actually including:
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/eosio.hpp.Note that this former include has been deprecated and not encouraged; hence the warnings.
Now let's get back to your warning which is found in file:
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/crypto.h.This warning is actually in good form because the file
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/crypto.hshould never be included in the first place when using C++ and the contract development toolkit; instead, the file/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/core/eosio/crypto.hppshould have been included because it provides C++ wrappers over the C functions that would be called otherwise.This particular warning is meant for someone working on a project in C; where including
/usr/local/Cellar/eosio.cdt/1.6.1/opt/eosio.cdt/include/eosiolib/capi/eosio/crypto.his found perfectly fine when using theeosio-cccompiler.Note that this confusion is only temporary, though.
Hopefully that clears up how the new directory structure works, as well as how the deprecations will take full effect post
eosio.cdt v1.7.0.