Reputation: 17220
I get the above error message (which I googled and found is something to do with a missing curly brace or something), however, I cannot see where this missing bracket is?
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
using namespace std;
class Something{
static DWORD WINAPI thread_func(LPVOID lpParameter)
{
thread_data *td = (thread_data*)lpParameter;
cout << "thread with id = " << td->m_id << endl;
return 0;
}
int main()
{
for (int i=0; i< 10; i++)
{
CreateThread(NULL, 0, thread_func, new thread_data(i) , 0, 0);
}
int a;
cin >> a;
}
struct thread_data
{
int m_id;
thread_data(int id) : m_id(id) {}
};
}
Upvotes: 9
Views: 41878
Reputation: 43
As per CodeProject:
In my case, I fixed the error since there was a missing new line on my resource.rc
file.
(Basically, you just hit enter at the end of the file)
Upvotes: 0
Reputation: 31
you might have missed
#ifdef ROCKSTAR
#endif <--- this might be missing
Upvotes: 3
Reputation: 40947
Your class Something
needs to have a terminating semicolon.
class Something{
}; // missing
Upvotes: 6
Reputation: 28762
You need a semicolon (;
) after the closing brace (}
) of the class Something
definition
Upvotes: 3
Reputation: 262919
In C++, the class
keyword requires a semicolon after the closing brace:
class Something {
}; // <-- This semicolon character is missing in your code sample.
Upvotes: 23