0
votes

Getting this compilation error:

Error 4107 fatal error C1189: #error : ATL requires C++ compilation (use a .cpp suffix) C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlbase.h 59

How to resolve this?

1

1 Answers

2
votes

Exactly as the error message says. If your source file ends in .c the compiler assumes it's a straight C source which is incompatible with the C++ required for ATL. Change the filename to .cpp and it will compile.

If you really do need to stay with C then you'll have to find another library other than ATL to help you.