I took a seperate project and just pasted this example I am trying to get working. This is 100% of the code.
Code:
#include <iostream>
#include "SDL/SDL_thread.h"
#include "SDL/SDL_timer.h"
using namespace std;
int processFile(void* data)
{
string& sFilePath = *static_cast<std::string*>(data);
// process file here
return 0;
}
int main()
{
SDL_Thread *thread;
string sFilePath = "/home/myuser/test.txt";
thread = SDL_CreateThread(processFile, "processFile", &sFilePath);
return 0;
}
Code:
ThreadingTest/main.cpp|18|error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]|
Line 18 referenced above is
Code:
thread = SDL_CreateThread(processFile, "processFile", &sFilePath);