Pelles C forum

Pelles C => General discussions => Topic started by: Trouba on October 30, 2009, 07:16:20 PM

Title: Compiling with /MD, unresolved externals.
Post by: Trouba on October 30, 2009, 07:16:20 PM
Hi, when compiling using the multi-threaded dynamic version of the runtime library (/MD switch) I ended up with this linker errors:

POLINK: error: Unresolved external symbol '__imp__CreateProcessA@40'.
POLINK: error: Unresolved external symbol '__imp__WaitForSingleObject@8'.
POLINK: error: Unresolved external symbol '__imp__CloseHandle@4'.
POLINK: error: Unresolved external symbol '__imp__GetLastError@0'.
POLINK: error: Unresolved external symbol '__imp__FormatMessageA@28'.
POLINK: error: Unresolved external symbol '__imp__LocalFree@4'.

Any info on how to solve them? Are they not defined in the dynamic version of the CRT?

Thank you.

Title: Re: Compiling with /MD, unresolved externals.
Post by: JohnF on October 31, 2009, 08:40:34 AM
Those API's are from kernel32.lib

John
Title: Re: Compiling with /MD, unresolved externals.
Post by: Trouba on November 01, 2009, 10:41:16 AM
Thank you, strange behavior it has.

If using /MT it links automatically to kernel32.lib, if linking using /MD you have to specify kernel32.lib as a library to link to.