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. timeGetTime() illegal ?

timeGetTime() illegal ?

Scheduled Pinned Locked Moved C / C++ / MFC
jsonquestion
5 Posts 2 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.
  • W Offline
    W Offline
    wogerdoger
    wrote on last edited by
    #1

    greetings all. I have a project consisting of about 20 source files. In some the call to timeGetTime() works. In others it is an illegal identifier. What include file do I need for this API call ? Cheers If sex is a pain in the ass, then you are doing it all wrong!

    L 1 Reply Last reply
    0
    • W wogerdoger

      greetings all. I have a project consisting of about 20 source files. In some the call to timeGetTime() works. In others it is an illegal identifier. What include file do I need for this API call ? Cheers If sex is a pain in the ass, then you are doing it all wrong!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Header: Declared in Mmsystem.h; include Windows.h. Library: Use Winmm.lib. How about taking a look at the MSDN? (no offense :)) regards

      W 1 Reply Last reply
      0
      • L Lost User

        Header: Declared in Mmsystem.h; include Windows.h. Library: Use Winmm.lib. How about taking a look at the MSDN? (no offense :)) regards

        W Offline
        W Offline
        wogerdoger
        wrote on last edited by
        #3

        Thanks...no offense taken... I have a few problems with MSDN and the C++ help files: namely that they told me that I needed a header called windows.h The source file in question has the following includes windows.h windowsx.h ddraw.h stdio.h (Exactly the same headers as the source file that works). NB: noticed that the source files that use timegetTime() are all class member functions: what is going on....MSDN does not cover this one (or I can't drive it). Cheers If sex is a pain in the ass, then you are doing it wrong!

        L 1 Reply Last reply
        0
        • W wogerdoger

          Thanks...no offense taken... I have a few problems with MSDN and the C++ help files: namely that they told me that I needed a header called windows.h The source file in question has the following includes windows.h windowsx.h ddraw.h stdio.h (Exactly the same headers as the source file that works). NB: noticed that the source files that use timegetTime() are all class member functions: what is going on....MSDN does not cover this one (or I can't drive it). Cheers If sex is a pain in the ass, then you are doing it wrong!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Well, if your project includes these four includes, then there's missing the mmsystem.h header file. And second, link with winmm.lib. I do it this way: #pragma comment(lib, "winmm.lib") But you can do it in the project options as well.

          W 1 Reply Last reply
          0
          • L Lost User

            Well, if your project includes these four includes, then there's missing the mmsystem.h header file. And second, link with winmm.lib. I do it this way: #pragma comment(lib, "winmm.lib") But you can do it in the project options as well.

            W Offline
            W Offline
            wogerdoger
            wrote on last edited by
            #5

            Cheers. I found some code that had the include winmm.lib and used that: worked fine. Can anyone shed light on why the object source files had no problem when they had the same include statements ? Thanks for all responses: much appreciated.;) If sex is a pain in the ass, then you are doing it wrong!

            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