When building the setupapi tests with VC9 and the MSVC headers (Vista version) after using msvcmaker, I get the following output:
2>------ Build started: Project: setupapi_test, Configuration: Debug MSVC Headers Win32 ------ 2>Linking... 2>misc.obj : error LNK2019: unresolved external symbol _MyFree referenced in function _test_SetupGetFileCompressionInfo 2>.\Output\Win32_Debug_MSVC_Headers/setupapi_test.exe : fatal error LNK1120: 1 unresolved externals
Where does MyFree come from?
Why does this work with a Wine/MinGW build and not VC9?
Thanks, - Reece
"Reece Dunn" msclrhd@googlemail.com wrote:
When building the setupapi tests with VC9 and the MSVC headers (Vista version) after using msvcmaker, I get the following output:
2>------ Build started: Project: setupapi_test, Configuration: Debug MSVC Headers Win32 ------ 2>Linking... 2>misc.obj : error LNK2019: unresolved external symbol _MyFree referenced in function _test_SetupGetFileCompressionInfo 2>.\Output\Win32_Debug_MSVC_Headers/setupapi_test.exe : fatal error LNK1120: 1 unresolved externals
Where does MyFree come from?
Looks like setupapi.lib from PSDK misses at least MyFree, MyMalloc and MyRealloc setupapi.dll exports.
Why does this work with a Wine/MinGW build and not VC9?
The answer is obvious I'd assume.
2008/10/15 Dmitry Timoshkov dmitry@codeweavers.com:
"Reece Dunn" msclrhd@googlemail.com wrote:
When building the setupapi tests with VC9 and the MSVC headers (Vista version) after using msvcmaker, I get the following output:
2>------ Build started: Project: setupapi_test, Configuration: Debug MSVC Headers Win32 ------ 2>Linking... 2>misc.obj : error LNK2019: unresolved external symbol _MyFree referenced in function _test_SetupGetFileCompressionInfo 2>.\Output\Win32_Debug_MSVC_Headers/setupapi_test.exe : fatal error LNK1120: 1 unresolved externals
Where does MyFree come from?
Looks like setupapi.lib from PSDK misses at least MyFree, MyMalloc and MyRealloc setupapi.dll exports.
According to MSDN: "Note that if the version of SetupAPI.dll is less than 5.0.2195, then the caller needs to use the exported function MyFree from SetupAPI to free the memory allocated by this function, rather then using LocalFree. If the call to LocalFree causes an Access Violation, you should solve the problem by using MyFree."
Therefore a GetProcAddress call is needed to get the MyFree function.
Why does this work with a Wine/MinGW build and not VC9?
The answer is obvious I'd assume.
It is obvious when you understand the answer to the previous question.
- Reece