For an open windows source-project to be built with Mingw-w64 I figured, it was nice, if the application was conscious of its version.
To get this, I copied/pastes/edited a small wrapper, which would read the version-information from the application’s own resources. This code builds well, when being done with Visual Studio environment (using vcvars32.bat).
However, when I try to build it with MinGw, the compiler runs through nicely, but the linker does not. There’s an error, that a functions from the version.dll is not found:
VersSample.cpp:(.text+0x14f): undefined reference to VerQueryValueW
I did add the –lversion compiler-switch in the build-command-line, but it appears, not to work. Anybody a hint, what I am missing?
The build-command looks as follows:
set PATH=C:\Tools\MinGw\mingw64\bin\;%PATH%
windres VersSample.rc -O coff -o VersSample.res
g++ -o VersSample.exe -mwindows -static-libgcc -static-libstdc++ -lversion VersSample.cpp VersSample.res
BTW: I did not want to make this bigger as needed, but if there's some nterest, I could post the whole function.