Search code examples
c++pragma

Pragma ignoring comment [-Werror=unknown-pragmas]


I'm trying to make function which will return version from FileVersionInfo, so far i built funtcion, but i have issue when i want to include version.lib

#pragma comment(lib, "version.lib")

I have tried to link, libversion.a, something like this

#pragma comment(lib, "libversion.a")

but, again compiler was returning error like first time

Pragma ignoring comment [-Werror=unknown-pragmas]

I have tried, many combinations from internet, i cant even remember all of them. I'm using MinGW compiler. Thanks for your time i appricitate it :)


Solution

  • "This pragma to link libraries from C++ source code is only supported by MSVC"

    Switched compiler from gcc/g++ to MSVC, that's only solution :(