Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Errors in createthread file. Need help!

Errors in createthread file. Need help!

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionc++
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pecan204
    wrote on last edited by
    #1

    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); }

    A J 2 Replies Last reply
    0
    • P Pecan204

      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); }

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      #include is probably missing.

      A 1 Reply Last reply
      0
      • A Anonymous

        #include is probably missing.

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        sorry... the special quote characters are not displayed on this website: #include "windows.h" is prbably missing

        1 Reply Last reply
        0
        • P Pecan204

          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); }

          J Offline
          J Offline
          jarl
          wrote on last edited by
          #4

          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=-

          P 1 Reply Last reply
          0
          • J 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=-

            P Offline
            P Offline
            Pecan204
            wrote on last edited by
            #5

            Thanks all. The include windows.h cleaned up many errors.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups