Windows 7 - Visual Studio 2010 - Link problem: error LNK2019: unresolved external symbol __imp__timeGetTime

1,274 views
Skip to first unread message

Joseph Gagnon

unread,
May 15, 2015, 3:20:07 PM5/15/15
to cppu...@googlegroups.com
I have just started evaluating CppUTest and am trying to see if I can use it successfully on a PC running Windows 7 with Visual Studio 2010.  I think I followed the build instructions properly and then set up a very simple test program.  It compiles but fails linking with the following error:

1>------ Build started: Project: CPPUnitTest, Configuration: Debug Win32 ------
1>CppUTestd.lib(UtestPlatform.obj) : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "long __cdecl VisualCppTimeInMillis(void)" (?VisualCppTimeInMillis@@YAJXZ)

I assume that I need to point the project at <CppUTest home directory>/lib/CppUTestd.lib (I had to in order to clear multiple link errors).  Is there something else I need to do?

A. Robert S.

unread,
May 22, 2015, 12:37:30 AM5/22/15
to cppu...@googlegroups.com
Can you check your test program's settings vs the ones used by CppUTest's own project? I have seen this error before, and it has something to do with certain switches passed to the compiler / linker; unfortunately I can't tell offhand which ones.
Robert

Charlie Schultz

unread,
Dec 9, 2015, 2:04:39 PM12/9/15
to cpputest
Was there ever a definitive answer? I recently upgraded from cpputest 3.4 (or 3.5?) to 3.7.1 and am now seeing this same problem.

Charlie Schultz

unread,
Dec 9, 2015, 2:24:11 PM12/9/15
to cpputest
Aha, found it. Need to add Winmm.lib to my test project properties file (Linker | Input | Additional Dependencies).

Cale McCollough

unread,
Mar 20, 2017, 5:37:37 PM3/20/17
to cpputest
Thank you! Winmm.lib fixed it for me too!
Reply all
Reply to author
Forward
0 new messages