[REGRESSION] [FIX] eosiocpp library problems
Problem
Commit 67393d7 introduced several regressions for users by removing several libraries.
The commit possibly slipped through during general enhancement of the installation-scripts within #4844.
Solved
With version 1.2.0, the team has reactivated eosiocpp an the related libraries, and announced their deprecation for the 1.3.0 release:
#5204 #5226 - https://github.com/EOSIO/eos/releases/tag/v1.2.0
Use 1.2.0, migrate towards using eosio.wasmsdk, ensure to read the future release-notes.
Workaround (for Users)
sudo rm -rf /usr/local/bin/eosiocpp # remove possibly existent old file
sudo rm -rf /usr/local/eosio/ # remove possibly existent old files
cd $HOME/eos
git revert -n 67393d7
./eosio_build.sh
cd build
sudo make install
which eosiocppshould be/usr/local/eosio/eosiocpplocate eosio.hppshould contain/usr/local/eosio/include/eosiolib/eosio.hpp
To verify if paths/libs are ok again
cd $HOME
mkdir sand
cd sand
eosiocpp -n hello
cd hello
eosiocpp -o hello.wast hello.cpp
eosiocpp -g hello.abi hello.cpp
Verified on ubuntu 18.04 (VirtualBox)
Further Steps
If the above does not solve it, then you should have a tiny chance by trying
-
A fresh clone, revert, build, install
-
this:
locate eosio.hpp
Pick the path which is NOT in the directory build, remove /eosiolib/eosio.hpp, and export it like this:
`export EOSIOCPP_CFLAGS='-I/my/strange/location'
#within eos dir
export EOSIOCPP_CFLAGS='-I/usr/local/eosio/include'
rm -rf build/tools/eosiocpp
./eosio_build.sh
cd build
sudo make install
Solution (by Team)
Revert 67393d7 (which broke existent behavior) within 1.1.x (next bug-fix release) and make a coordinated and announced switch to an alternate eosio.wasmsdk based implementation (see #5040)
Alternatively
Document clearly this regression, thus user know what to do (both categories, using build or using docker)
Done
#5204 #5226 - https://github.com/EOSIO/eos/releases/tag/v1.2.0
using macOS. still library error occurs
/usr/local/eosio/include/eosiolib/symbol.hpp:2:10: fatal error: 'eosiolib/core_symbol.hpp' file not
found
code
#include <eosiolib/eosio.hpp>
#include <eosiolib/currency.hpp>
using namespace eosio;
class hello : public eosio::contract {
public:
using contract::contract;
/// @abi action
void hi( account_name user ) {
print( "Hello, ", name{user} );
}
};
extern "C" {
void apply( uint64_t receiver, uint64_t code, uint64_t action ) {
if (N(transfer) == action) {
auto trans = unpack_action_data<currency::transfer>();
print(trans.quantity.amount);
}
}
}
error
cleos set contract shangzebeiok /work/hello -p shangzebeiok@active
Reading WAST/WASM from /work/hello/hello.wasm...
Using already assembled WASM...
Publishing contract...
Error 3070000: WASM Exception
console
{"module":"env","export":"free"}
thread-0 wasm_interface.hpp:42 resolve
{"mod_name":"env","export_name":"free"}
thread-0 wasm_interface.hpp:44 resolve
pending console output:
{"console":""}
wrong #4941
Thanks brother , After several days of rigorous searching for fix for errors , at last it is working now.
@newbieh4cker , please try with a fresh clone, revert, build, install, test
@helperShang , please file a new issue and link back here, if you think its related. Note that you can delete the comments that you've posted here, just copy them over to the new issue).
@dev1644 good to know. Thanks for reporting the success.
@lazaridiscom not working T.T
@newbieh4cker answered within https://github.com/EOSIO/eos/issues/5129#issuecomment-412002267
These files have been removed purposefully.
Please use the point releases. Since the latest version is not always stable as it is a work in progress.
These files have been removed purposefully.
You cannot remove files from a released software, without documenting clearly.
Please use the point releases. Since the latest version is not always stable as it is a work in progress.
We're talking about "master", which is the latest stable release.
I can confirm that this fix works on Ubuntu 16.04.
Before you start a fresh clone delete the following folder:
/usr/local/eosio/
You will need a fresh clone, revert, build, install.
thanks for the confirmation, I've updated the instructions with delete and fresh clone option
Version 1.2.0 fixes this regression, see https://github.com/EOSIO/eos/releases/tag/v1.2.0
Update to 1.2.0.
it's work~ ! thinks