Error Deploying on Locally Built IC

After building and running IC locally, i built a c++ project, started dfx, then tried to deploy, but it gave me the following error:

An error happened during communication with the replica: error sending request for url (http://127.0.0.1:4943/api/v2/canister/rrkah-fqaaa-aaaaa-aaaaq-cai/call): error writing a body to connection: Broken pipe (os error 32)

Steps Followed:

./gitlab-ci/container/build-ic.sh -b -c --no-release
./gitlab-ci/container/container-run.sh
//From inside the ic dev container
sudo pip install icpp-pro==3.17.0rc3
cd projectDir
icpp build-wasm
sudo dfx start --clean --background
sudo dfx deploy

I tried starting dfx using the following command:

sudo dfx start --clean --background --emulator

Now i’m receiving the following error:

The Replica returned an error: code 5, message: “Parsing failed: getMathPrefix: illegal op 10”

Thanks for the heads up., let me ping folks.

Thanks a lot. I also found out that dfx used in the build is 0.12 while the latest is 0.20. When changing that to the latest, it solved the problem.
It didn’t reflect my code changes though, so when i delved into the scripts, it seems it is using ic containers from docker.io.
I tried using build-image.sh and it built a container in docker. Not sure if it is building through the local source code though and not sure whether container-run.sh is actually running this local container after removing docker.io form IMAGE!

If there is a complete guide to building and running ic locally, would be highly appreciating.