smasherprog / screen_capture_lite

cross platform screen/window capturing library
MIT License
616 stars 156 forks source link

How do I compile this on windows? #134

Closed rlewkowicz closed 2 years ago

rlewkowicz commented 2 years ago

I feel like such a pleb in this windows space.

In visual studio, trying to compile the example application, I get:

Severity    Code    Description Project File    Line    Suppression State
Error   C2429   language feature 'nested-namespace-definition' requires compiler flag '/std:c++17'  ConsoleApplication1 C:\Repos\screen\screen_capture_lite-17.1.457\include\ScreenCapture_C_API.h  25  

Among other esoteric errors that just indicate compiler mismatches. I've tried setting both c and c++ to the 17 variant but then I get tons of things like:

Severity    Code    Description Project File    Line    Suppression State
Error   C2589   '(': illegal token on right side of '::'    ConsoleApplication1 C:\Users\Administrator\source\repos\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.cpp 485 

Is this supposed to be compile with visual studio, or am I supposed to use something else?

rlewkowicz commented 2 years ago

Ok, so I was trying to copy this into a fresh sln which was probably half, my issue. I'm now using the cmake integration but it is failing too:

Severity    Code    Description Project File    Line    Suppression State
Error       CMake Error at C:\Repos\screen\screen_capture_lite-17.1.457\Example_CPP\CMakeLists.txt:59 (install):
  install TARGETS given target "screen_capture_lite_shared" which does not
  exist.    screen_capture_example_cpp  C:\Repos\screen\screen_capture_lite-17.1.457\Example_CPP\CMakeLists.txt 59  

This is on visual studio 2022

rlewkowicz commented 2 years ago

Ok, so ymmv but for me the easiest thing was to get cmake: https://cmake.org/install/

And run:

cmake .
cmake install .

in the base dir of this repo.