I have gave up on creating a GUI directly from the windows API so I'm going to use forms. I would like to multithread my app and wrap the GUI in a class and put it in a separate thread. When I click a button, etc, it would change a value in a struct that will be read from the main thread. My problem is, when I compile my application I get an error with the linker.
1>Core.obj : error LNK2022: metadata operation failed (8013119F) : A TypeRef exists which should, but does not, have a corresponding TypeDef: (dummy): (0x0100001f).
My code for main is as follows.
int main() { //create thread object pointer boost::thread *GUIThread; //create pointer to GUIInterface, which contains a member function that //contains the Application::Run GUIInterface *myinterface; myinterface = new GUIInterface; GUIThread = new boost::thread(boost::bind(&GUIInterface::MainFunction, myinterface)); return 0; }
It works fine when creating the class and calling the function in the main thread, but using boost causes problems. I built boost using the correct compiler MSVC-10.0 and the threading library has always worked in the past, but clr just causes problems. Any recommendations on how to fix this? OR if I should just use .net multithreading(if I do, I really need some links to how to use in with c++, most stuff I find is in C#). Thanks.
See Question&Answers more detail:os