Errors in createthread file. Need help!
-
Hello, I am getting syntax errors in this file upon compile but I can't figure out what is wrong. Can someone comment? Thanks. The errors are: cinterface3.cpp(17) : error C2065: 'DWORD' : undeclared identifier cinterface3.cpp(17) : error C2146: syntax error : missing ';' before identifier 'tid' cinterface3.cpp(17) : error C2065: 'tid' : undeclared identifier cinterface3.cpp(19) : error C2065: 'HANDLE' : undeclared identifier cinterface3.cpp(19) : error C2146: syntax error : missing ';' before identifier 'hThread' cinterface3.cpp(19) : error C2065: 'hThread' : undeclared identifier cinterface3.cpp(21) : error C2065: 'CreateThread' : undeclared identifier cinterface3.cpp(23) : error C2146: syntax error : missing ';' before identifier 'CloseHandle' cinterface3.cpp(23) : error C2065: 'CloseHandle' : undeclared identifier #include #include struct io { char time[10]; int start; }; struct io cio; extern "C" __declspec(dllimport) void _stdcall FTREND3 ( long * ); void main (void) { DWORD tid, cio; HANDLE hThread; hThread = CreateThread(NULL, 0, FTREND3, &cio, 0, &tid) CloseHandle(hThread); printf("In c after fortran thread started\n\n"); printf("string = %s\n",cio.time); }
-
Hello, I am getting syntax errors in this file upon compile but I can't figure out what is wrong. Can someone comment? Thanks. The errors are: cinterface3.cpp(17) : error C2065: 'DWORD' : undeclared identifier cinterface3.cpp(17) : error C2146: syntax error : missing ';' before identifier 'tid' cinterface3.cpp(17) : error C2065: 'tid' : undeclared identifier cinterface3.cpp(19) : error C2065: 'HANDLE' : undeclared identifier cinterface3.cpp(19) : error C2146: syntax error : missing ';' before identifier 'hThread' cinterface3.cpp(19) : error C2065: 'hThread' : undeclared identifier cinterface3.cpp(21) : error C2065: 'CreateThread' : undeclared identifier cinterface3.cpp(23) : error C2146: syntax error : missing ';' before identifier 'CloseHandle' cinterface3.cpp(23) : error C2065: 'CloseHandle' : undeclared identifier #include #include struct io { char time[10]; int start; }; struct io cio; extern "C" __declspec(dllimport) void _stdcall FTREND3 ( long * ); void main (void) { DWORD tid, cio; HANDLE hThread; hThread = CreateThread(NULL, 0, FTREND3, &cio, 0, &tid) CloseHandle(hThread); printf("In c after fortran thread started\n\n"); printf("string = %s\n",cio.time); }
-
Hello, I am getting syntax errors in this file upon compile but I can't figure out what is wrong. Can someone comment? Thanks. The errors are: cinterface3.cpp(17) : error C2065: 'DWORD' : undeclared identifier cinterface3.cpp(17) : error C2146: syntax error : missing ';' before identifier 'tid' cinterface3.cpp(17) : error C2065: 'tid' : undeclared identifier cinterface3.cpp(19) : error C2065: 'HANDLE' : undeclared identifier cinterface3.cpp(19) : error C2146: syntax error : missing ';' before identifier 'hThread' cinterface3.cpp(19) : error C2065: 'hThread' : undeclared identifier cinterface3.cpp(21) : error C2065: 'CreateThread' : undeclared identifier cinterface3.cpp(23) : error C2146: syntax error : missing ';' before identifier 'CloseHandle' cinterface3.cpp(23) : error C2065: 'CloseHandle' : undeclared identifier #include #include struct io { char time[10]; int start; }; struct io cio; extern "C" __declspec(dllimport) void _stdcall FTREND3 ( long * ); void main (void) { DWORD tid, cio; HANDLE hThread; hThread = CreateThread(NULL, 0, FTREND3, &cio, 0, &tid) CloseHandle(hThread); printf("In c after fortran thread started\n\n"); printf("string = %s\n",cio.time); }
I am almost willing to bet that it is because you haven't specified /Mt or /Mtd, ( or whichever it is for your version of VC ), to enable multithreading. The Microsoft headers have a nifty ( not ;) ) set of defines which undef the multithreading functions if the _MT define, ( which comes through the /M... compiler switches ), aren't set. -=jarl=-
-
I am almost willing to bet that it is because you haven't specified /Mt or /Mtd, ( or whichever it is for your version of VC ), to enable multithreading. The Microsoft headers have a nifty ( not ;) ) set of defines which undef the multithreading functions if the _MT define, ( which comes through the /M... compiler switches ), aren't set. -=jarl=-