Toxic c c++ code Block errors and its solutions

Error #1: C++0x_warning.h

Hi there, if you are using a code block ide then in any case if you got the error ” compiler requires library support for ISO C++ 2011 standard. Enabled with the  ‘std=c++11 or ‘std=gnu++11 compiler options “

At this instant, you should take the following 3 steps  mentioned below

  1. Open CodeBlock ide and create a project
  2. Project —> Build options
ISO C++ 2011 standard. Enabled with the  ?std=c++11 or ?std=gnu++11 compiler options
  1. Select Have g++ follow the c++11 ISO c++ language [-std=c++11]
Have g++ follow the c++11 ISO c++ language [-std=c++11]

Error #2: error.exe has stopped working

error.exe has stopped working

There might be many reasons for the occurrence of this error but one reason is program  crash’s due to faulty address is provided

At this instant, I was using file handling functions in c++ to read and write audio wave files

using namespace std;

const int SAMPLE_RATE = 44100;

const string IN_DIR = "C:\Users\Mohammed Anees\Desktop\New folder (2)\2016-06_MusicTech\AudioDSPBasics\InputFiles";
const string OUT_DIR = "C:\Users\Mohammed Anees\Desktop\New folder (2)\2016-06_MusicTech\AudioDSPBasics\OutputFiles\";

Basically, the path has to be in a double backslash(//)

using namespace std;

const int SAMPLE_RATE = 44100;

const string IN_DIR = "C:\\Users\Mohammed Anees\\Desktop\New folder (2)\\2016-06_MusicTech\\AudioDSPBasics\\InputFiles\\";
const string OUT_DIR = "C:\\Users\\Mohammed Anees\\Desktop\\New folder (2)\\2016-06_MusicTech\\AudioDSPBasics\\OutputFiles\\";

Error #3: assert.exe has stopped working

Besides, there is another reason for the cause of assert.exe has stopped working, Read the below article

Assertion failed error

Error #4:(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<float, std::allocator<float> > const&, int, int)’

I don’t know the exact reason for this error it might be some linker issue  but this has gone after I copied and pasted all the project files to the freshly created project

Error#5: Comparison b/w signed and unsigned integer  expressions

for (int i = 0; i < numFrames; i++)
    {
        // Get input sample
        float x = sourceBuf[i];

        // Copy it to the output buffer
        float gain = 0.5;
        outBuf[i] = gain * x;
    }

When ever I was compiling the above code i was facing the warning such as comparison b/w signed and unsigned integer expressions

However, this warning can be over come by using  size_t or unsigned type instead of int type

Error#6: Vector: no such file or directory

I was doing a C++ project which contains three files such as main.cpp, wav.cpp, and wav.h

But the problem occurs here because by mistake I save the wav.cpp as wav.c extension

Mohammed Anees

Hey there, welcome to aneescraftsmanship I am Mohammed Anees an independent developer/blogger. I like to share and discuss the craft with others plus the things which I have learned because I believe that through discussion and sharing a new world opens up

Leave a Reply

Your email address will not be published.