0

I'm having a VC++ solution (VS 2013) which I'm compiling using only Microsoft provided "mincore.lib" & hence I untick the "Inherit from Parent or Project defaults" in the linker options , in C/C++-> preprocessor & also iu additional include directories.

I'm getting the following compilation error

COde snippet :

error LNK2019: unresolved external symbol __imp__CoInitialize@4 referenced in function _main

int main() 
{
CoInitialize(NULL);
.............
.............
}

This means I need to provide the definition for "CoInitialize()". But which library has this "CoInitialize() " definition ?

codeLover
  • 3,720
  • 10
  • 65
  • 121
  • 2
    The library is "ole32". Generally you can find out this sort of thing either by grepping the library dir (it contains function names in plain text) or googling the unresolved symbol – M.M Mar 05 '15 at 06:18

1 Answers1

0

Answer is use "CoInitializeEx() instead of CoInitialize().

codeLover
  • 3,720
  • 10
  • 65
  • 121