Building flipper contract - smartcontracts

I am following this tutorial https://substrate.dev/substrate-contracts-workshop/#/0/building-your-contract but am getting the following error. Does anyone know how to resolve this?
➜ flipper cargo +nightly contract build
[1/5] Building cargo project
Updating crates.io index
Compiling flipper v0.1.0 (/tmp/cargo-contract_dLtaWE)
error[E0277]: the trait bound `__ink_ConstructorDispatchEnum: parity_scale_codec::codec::WrapperTypeDecode` is not satisfied
--> /home/bill/flipper/lib.rs:5:1
|
5 | #[ink::contract]
| ^^^^^^^^^^^^^^^^ the trait `parity_scale_codec::codec::WrapperTypeDecode` is not implemented for `__ink_ConstructorDispatchEnum`
|
::: /home/bill/.cargo/registry/src/github.com-1ecc6299db9ec823/ink_env-3.0.0-rc3/src/api.rs:465:8
|
465 | T: scale::Decode,
| ------------- required by this bound in `decode_input`
|
= note: required because of the requirements on the impl of `parity_scale_codec::codec::Decode` for `__ink_ConstructorDispatchEnum`
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `__ink_MessageDispatchEnum: parity_scale_codec::codec::WrapperTypeDecode` is not satisfied
--> /home/bill/flipper/lib.rs:5:1
|
5 | #[ink::contract]
| ^^^^^^^^^^^^^^^^ the trait `parity_scale_codec::codec::WrapperTypeDecode` is not implemented for `__ink_MessageDispatchEnum`
|
::: /home/bill/.cargo/registry/src/github.com-1ecc6299db9ec823/ink_env-3.0.0-rc3/src/api.rs:465:8
|
465 | T: scale::Decode,
| ------------- required by this bound in `decode_input`
|
= note: required because of the requirements on the impl of `parity_scale_codec::codec::Decode` for `__ink_MessageDispatchEnum`
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.
error: could not compile `flipper`
To learn more, run the command again with --verbose.
ERROR: `"/home/bill/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo" "build" "--target=wasm32-unknown-unknown" "-Zbuild-std" "-Zbuild-std-features=panic_immediate_abort" "--no-default-features" "--release" "--target-dir=/home/bill/flipper/target"` failed with exit code: Some(101)

Related

incomplete type `std::string' when building OSDK on Raspberry Pi 4

I am trying to build the DJI Onboard-SDK on a Raspberry Pi 4, and have had errors with different libraries missing that I have managed to resolve by installing those libraries. I've now gotten an error saying std::string isan incomplete type and printf is not declared. The only suggestions I've found say to install build-essentials, which I've already got installed and up to date. Can anyone give me suggestions about where to look next?
I've tried reinstalling g++ and ensuring all packages are up to date. I'm still getting the following errors in my make output;
[ 26%] Building CXX object osdk-core/CMakeFiles/djiosdk-core.dir/modules/src/filemgr/impl/mmap_file_buffer.cpp.o
In file included from /home/pi/catkin_ws/src/Onboard-SDK/osdk-core/modules/src/filemgr/impl/mmap_file_buffer.cpp:4:
/home/pi/catkin_ws/src/Onboard-SDK/osdk-core/modules/inc/filemgr/impl/mmap_file_buffer.hpp:23:15: error: field ‘currentLogFilePath’ has incomplete type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’}
23 | std::string currentLogFilePath;
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/iosfwd:39,
from /usr/include/c++/10/memory:74,
from /home/pi/catkin_ws/src/Onboard-SDK/osdk-core/modules/inc/filemgr/impl/mmap_file_buffer.hpp:13,
from /home/pi/catkin_ws/src/Onboard-SDK/osdk-core/modules/src/filemgr/impl/mmap_file_buffer.cpp:4:
/usr/include/c++/10/bits/stringfwd.h:74:11: note: declaration of ‘std::string’ {aka ‘class std::__cxx11::basic_string<char>’}
74 | class basic_string;
| ^~~~~~~~~~~~
/home/pi/catkin_ws/src/Onboard-SDK/osdk-core/modules/src/filemgr/impl/mmap_file_buffer.cpp:15:39: error: ‘path’ has incomplete type
15 | bool MmapFileBuffer::init(std::string path, uint64_t fileSize) {
| ~~~~~~~~~~~~^~~~
In file included from /usr/include/c++/10/iosfwd:39,
from /usr/include/c++/10/memory:74,
from /home/pi/catkin_ws/src/Onboard-SDK/osdk-core/modules/inc/filemgr/impl/mmap_file_buffer.hpp:13,
from /home/pi/catkin_ws/src/Onboard-SDK/osdk-core/modules/src/filemgr/impl/mmap_file_buffer.cpp:4:
/usr/include/c++/10/bits/stringfwd.h:74:11: note: declaration of ‘std::string’ {aka ‘class std::__cxx11::basic_string<char>’}
74 | class basic_string;
| ^~~~~~~~~~~~
/home/pi/catkin_ws/src/Onboard-SDK/osdk-core/modules/src/filemgr/impl/mmap_file_buffer.cpp: In member function ‘bool DJI::OSDK::MmapFileBuffer::init(std::string, uint64_t)’:
/home/pi/catkin_ws/src/Onboard-SDK/osdk-core/modules/src/filemgr/impl/mmap_file_buffer.cpp:19:3: error: ‘printf’ was not declared in this scope
19 | printf("Preparing File : %s\n", this->currentLogFilePath.c_str());
| ^~~~~~
/home/pi/catkin_ws/src/Onboard-SDK/osdk-core/modules/src/filemgr/impl/mmap_file_buffer.cpp:7:1: note: ‘printf’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
6 | #include <string.h>
+++ |+#include <cstdio>
7 |
make[2]: *** [osdk-core/CMakeFiles/djiosdk-core.dir/build.make:524: osdk-core/CMakeFiles/djiosdk-core.dir/modules/src/filemgr/impl/mmap_file_buffer.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:580: osdk-core/CMakeFiles/djiosdk-core.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

__uint128 does not name a type

I am trying to compile cmake-3.21.4 on aarch64-linux-gnu. I get the following error
e/root/cmake-3.21.4/Utilities -c /home/root/cmake-3.21.4/Source/cmUVHandlePtr.cxx -o cmUVHandlePtr.o
In file included from /usr/include/bits/sigcontext.h:30,
from /usr/include/signal.h:301,
from /usr/include/sys/param.h:28,
from /home/root/cmake-3.21.4/Utilities/cmlibuv/include/uv/unix.h:41,
from /home/root/cmake-3.21.4/Utilities/cmlibuv/include/uv.h:70,
from /home/root/cmake-3.21.4/Utilities/cm3p/uv.h:10,
from /home/root/cmake-3.21.4/Source/cmUVHandlePtr.h:11,
from /home/root/cmake-3.21.4/Source/cmUVHandlePtr.cxx:4:
/usr/include/c++/11.2.0/bits/std_abs.h:84:29: error: '__uint128' does not name a type; did you mean '__int128'?
84 | inline _GLIBCXX_CONSTEXPR __GLIBCXX_TYPE_INT_N_0
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11.2.0/chrono:41,
from /usr/include/c++/11.2.0/mutex:39,
from /home/root/cmake-3.21.4/Source/cmUVHandlePtr.cxx:8:
/usr/include/c++/11.2.0/limits:1635:11: error: '__uint128' was not declared in this scope; did you mean '__int128'?
1635 | __INT_N(__GLIBCXX_TYPE_INT_N_0, __GLIBCXX_BITSIZE_INT_N_0,
| ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11.2.0/limits:1635:3: error: template argument 1 is invalid
1635 | __INT_N(__GLIBCXX_TYPE_INT_N_0, __GLIBCXX_BITSIZE_INT_N_0,
| ^~~~~~~
/usr/include/c++/11.2.0/limits:1635:3: error: template argument 1 is invalid
1635 | __INT_N(__GLIBCXX_TYPE_INT_N_0, __GLIBCXX_BITSIZE_INT_N_0,
| ^~~~~~~
I have searched through cmake source for __uint128 with no result. It's probably an issue with my c++ includes or gcc. What should I Do?
I had almost the same problem, the solution for me was to paste this code into the file that gave error:
typedef unsigned __int128 __uint128;
This code simply declares __uint128

stuck at "unresolved import" Rust Embedded

I am new to Rust and I am working in embedded development. I am making a project to blink the led of the stmf3 board. But I am getting errors while using the command cargo build
This Repo contains my code and structure. I am really stuck here. Can someone please a way to solve this?
The error I am getting is:
error[E0433]: failed to resolve: unresolved import
--> src/main.rs:4:12
|
4 | use crate::config::initialization::{entry,mycrate,OutputSwitch,stm32f3xx_hal::prelude::*};
| ^^^^^^
| |
| unresolved import
| help: a similar path exists: `blink_stm32::config`
error[E0432]: unresolved imports `crate::config::initialization::entry`, `crate::config::initialization::mycrate`, `crate::config::initialization::OutputSwitch`
--> src/main.rs:4:37
|
4 | use crate::config::initialization::{entry,mycrate,OutputSwitch,stm32f3xx_hal::prelude::*};
| ^^^^^ ^^^^^^^ ^^^^^^^^^^^^
error: cannot find attribute `entry` in this scope
--> src/main.rs:6:3
|
6 | #[entry]
| ^^^^^
error[E0425]: cannot find function `mycrate` in this scope
--> src/main.rs:9:29
|
9 | let (leds, mut delay) = mycrate();
| ^^^^^^^ not found in this scope
|
help: consider importing this function
|
4 | use blink_stm32::config::initialization::mycrate;
|

Module highlight.js has no exported member HLJSStatic & IModeBase

my package.json looks like below,
dependencies:
"highlight.js": "^10.4.0",
"vue-highlight.js": "^3.1.0",
devDependencies:
"#types/highlight.js": "^10.1.0",
FYI, Its already working fine but i have tried upgrade(Bump updates) im getting this issue.
error in D:/paypayWorkspace/bump-update/developer-panel-web/client/node_modules/vue-highlight.js/dist/types/HLJSLang.d.ts
ERROR in D:/paypayWorkspace/bump-update/developer-panel-web/client/node_modules/vue-highlight.js/dist/types/HLJSLang.d.ts
1:10 Module '"highlight.js"' has no exported member 'HLJSStatic'.
> 1 | import { HLJSStatic, IModeBase } from 'highlight.js';
| ^
2 | /**
3 | * Highlight.js language
4 | */
error in D:/paypayWorkspace/bump-update/developer-panel-web/client/node_modules/vue-highlight.js/dist/types/HLJSLang.d.ts
ERROR in D:/paypayWorkspace/bump-update/developer-panel-web/client/node_modules/vue-highlight.js/dist/types/HLJSLang.d.ts
1:22 Module '"highlight.js"' has no exported member 'IModeBase'.
> 1 | import { HLJSStatic, IModeBase } from 'highlight.js';
| ^
2 | /**
3 | * Highlight.js language
4 | */
ERROR Build failed with errors.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
make: *** [dev-env] Error 1
I have not enough reputation to comment, but I think the answer is that highlight.js updated to version 10.XX.XX and there are some breaking changes so vue-highlight.js is not working anymore.
https://github.com/gluons/vue-highlight.js/issues/66
I have just now realized that you opened the issue there... but I think my answer will help those who land here.

verifyAlertNotPresent() in selenium ide halts the execution on failure

I have written a script to Verify that alert is not present using verifyAlertNotPresent command. Using this command as I know execution should not stop even if alert is present and should continue but it halts the execution. My script is given below.
forXml | file:///E:/XML files/NAA_StateZip.xml
open |
clickAndWait | link=NAA Click & Lease
type | name=_OWNER | sdfsdf
type | name=OWNERFAX | 1234556
fireEvent | name=OWNERFAX | blur
verifyAlertNotPresent | Error: Invalid input format Please re-enter area code and phone number |
close
selectWindow | null
endForXml
When I am running this script Log shows this.
[info] Executing: |type | name=OWNERFAX | 1234556 |
[info] Executing: |fireEvent | name=OWNERFAX | blur |
[info] Executing: |verifyAlertNotPresent | Error: Invalid input format Please re-enter area code and phone number | |
[error] true
[info] Executing: |close | | |
[error] There was an unexpected Alert! [Error: Invalid input format Please re-enter area code and phone number]
[info] Test case fail
Please provide solution to this as I want to run this script for set of data.
To handle alerts using Selenium IDE, you will have to use 'assertFoo(pattern)' function. If you fail to assert the presence of a pop-up your next command will be blocked and you will get an error. Look at the Docs.