1

When I try to add ATL library installed by Visual Studio to my C++ project, I have a lot of compile errors in ATL files. For example:

error: 'warning' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
 } __pragma(warning(suppress:4127)) while (0)

What can it be caused by?

Dima Chubarov
  • 16,199
  • 6
  • 40
  • 76
  • Does this answer your question? [What is __pragma and what are the differences between __pragma and #pragma](https://stackoverflow.com/questions/23790112/what-is-pragma-and-what-are-the-differences-between-pragma-and-pragma) – n. m. could be an AI Nov 28 '20 at 17:59
  • 1
    You'll need to use the MSVC toolchain with ATL (or MFC). – dxiv Nov 28 '20 at 18:04
  • @dxiv Use MSVC toolchain instead of MinGW or instead what? – Кирилл Волков Nov 28 '20 at 18:41
  • @КириллВолков Yes, the [MSVC compiler](https://www.jetbrains.com/help/clion/quick-tutorial-on-configuring-clion-on-windows.html#msvc-compiler). Or switch the project to Visual Studio altogether. – dxiv Nov 28 '20 at 18:53
  • @dxiv When I use MSVC compiler, it can not load libraries that are pointed in Makefile. Is it possible to use MSVC with Makefile? – Кирилл Волков Dec 01 '20 at 13:30
  • 1
    @КириллВолков It certainly is possible, and you can find some pointers at [Create a C++ makefile project](https://learn.microsoft.com/en-us/cpp/build/reference/creating-a-makefile-project?view=msvc-160). Though makefiles require more familiarity with the VC++ compiler/linker switches than using Visual Studio's default solution/project system. – dxiv Dec 02 '20 at 04:14

0 Answers0