Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Can't compile cpp and c together by eosio-cpp #652

Closed
conr2d opened this issue Sep 2, 2019 · 0 comments
Closed

Can't compile cpp and c together by eosio-cpp #652

conr2d opened this issue Sep 2, 2019 · 0 comments

Comments

@conr2d
Copy link
Contributor

conr2d commented Sep 2, 2019

eosio-cpp calls clang-7 as subprocess to build each source file, and clang determines whether given file is cpp or c. When compiling cpp and c source file together with eosio-cpp, -std=c++17 is added to compile options by default, but it causes an error during c source file compilation.

$ /home/conr2d/eosio/eosio.cdt/bin/eosio-cpp -o test.wasm test.cpp foo.c
Warning, empty ricardian clause file
Warning, empty ricardian clause file
Warning, action <hi> does not have a ricardian contract
Warning, empty ricardian clause file
Warning, empty ricardian clause file
Warning, action <hi> does not have a ricardian contract
error: invalid argument '-std=c++17' not allowed with 'C'
error: invalid argument '-std=c++17' not allowed with 'C'
error: invalid argument '--std=c++17' not allowed with 'C'
/home/conr2d/eosio/eosio.cdt/bin/wasm-ld: error: cannot open /tmp/foo.c.o: No such file or directory
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant