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

Cannot deploy contract with a header file. #109

Closed
peterokwara opened this issue May 28, 2019 · 2 comments
Closed

Cannot deploy contract with a header file. #109

peterokwara opened this issue May 28, 2019 · 2 comments

Comments

@peterokwara
Copy link

I am unable to deploy a contract which has an added header file in this.

An example of this is depoying the eosio.token contract whose .cpp file requires a .hpp file (#include <eosio.token/eosio.token.hpp>)

Any way around this?

@jcardenas9x
Copy link
Contributor

Hey; glad you used the tool. I assume you have resolved the issue by yourself or that you have closed this issue with help from someone else. However, in case you want extra clarification on this particular issue (or for others who are experiencing similar confusion), there is a way to deploy contracts requiring other .cpp or .hpp files.

Using the guide as a reference point, it is possible to bundle dependencies for your main .cpp file by organizing the folder accordingly. In the screenshot on that page, you can see that the .cpp file has the line #include "helpers/Characters.hpp, pointing to the ./helpers/Characters.hpp file in the Root Folder Path (so, the helpers folder has to be a sub-directory in the root folder path).

If you want to use #include <eosio.token/eosio.token.hpp> as an example, you would have to rewrite it as #include "eosio.token/eosio.token.hpp" and ensure that the eosio.token folder is a sub-directory of your working project folder.

I hope this is clearer for you and helps you to understand how to develop more complex smart contracts using the tool.

@peterokwara
Copy link
Author

peterokwara commented May 29, 2019

Thanks, what you have explained is what I did to make it run.

By changing the location of the header file to
Screenshot from 2019-05-29 13-03-17

and changing the #include of the cpp file to
Screenshot from 2019-05-29 13-04-01

I was able to point to the cpp file to the /src folder and was able to compile and upload the smart contract

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants