1

I have two different configurations of a project and I wish to link one against one against windows' standard opengl32.lib and the other against Angle. The trouble is, both of these libraries implement the OpenGL interface and I see no way of choosing between them other than removing one library from vcpkg. It seems to prefer Angle. I've tried setting the angle libraries 'no default libs' in the project settings and also using

#pragma comment(linker,"/nodefaultlib:libANGLE.lib")
#pragma comment(linker,"/nodefaultlib:libEGL.lib")
#pragma comment(linker,"/nodefaultlib:libGLESv2.lib")

within the source but these don't seem to be respected by whatever magic black box handles vcpkg linking (and, usually, I'm very grateful for that black box)

Is it possible to get vcpkg to ignore a set of libraries within a specific project configuration?

Luther
  • 1,786
  • 3
  • 21
  • 38
  • 1
    This is one of the problems with vcpkg, packages are installed globally and of you want different packages for different projects it doesn't seem to be easy: https://vcpkg.readthedocs.io/en/latest/about/faq/#how-do-i-use-different-versions-of-a-library-on-one-machine, Conan is better in this area – Alan Birtles Jul 28 '21 at 05:06
  • They cite that the header file conflict is one reason to not even try and do this but when installing angle, it gives no indication that there would be a conflict. This seems like a fairly fundamental flaw, do you know if they have any plans to address it? – Luther Jul 28 '21 at 08:37
  • The only solution I've found so far is to have separate vcpkg installations and simply don't install any libraries that might conflict. This is usually not a problem - libraries don't often conflict in this way but openGL has a long and chequered history when it comes to compatibility on windows, which is probably why there's a menagerie of libraries out there to paper over the cracks and therefore, conflicts (e.g. between Angle, glew, glfw, standard GL headers etc). Microsoft did much to cause this situation, perhaps they could also fix it with the otherwise excellent vcpkg? – Luther Aug 02 '21 at 15:45

0 Answers0