Can't compile cpp and c together by eosio-cpp
Closed this issue · 0 comments
conr2d commented
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
(-std=c++2a
in sio4.cdt) 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