Hello I am writing a IOManager, but I get this error:
Error 1 error C2143: syntax error : missing ';' before '<class-head>'
My code is this:
#pragma once
#include <vector>
class IOManager{
public:
static bool readFileToBuffer(std::string filePath, std::vector<unsigned char>& buffer);
};
I don't know what I did wrong!
You use std::string
, but did not include <string>
header. Add this line to the top:
#include <string>
So you will get:
#pragma once
#include <string>
#include <vector>
class IOManager{
public:
static bool readFileToBuffer(std::string filePath, std::vector<unsigned char>& buffer);
};
It should work.
I got this in my C++ code for unreal engine. It was because I forgot the semi-colon at the end of the class declaration in my header (.h) file.
class MyClass{
private: //Stuff here
public: //Stuff here
}; //<--------DONT FORGET THE SEMICOLON
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With