smasherprog / screen_capture_lite

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

internal/SCCommon.h also for production? #53

Closed jakakonda closed 6 years ago

jakakonda commented 6 years ago

Hello!

I've tried this library in a project for of mine and really like it (simple, fast and cross platform). However, there is one thing that can't really put together. In the example and internal/SCCommon.h file it's written:

//DONT USE THIS HEADER IN PRODUCTION CODE!!!! ITS INTERNAL FOR A REASON IT WILL CHANGE!!! ITS HERE FOR TESTS ONLY!!!

But if I skip this header I get an error:

Error C2036 'SL::Screen_Capture::Monitor *const ': unknown size ScreenCapture

Which makes sense since structs Point, Monitor, Window and Image are defined only in SCCommon.h file. If skipped, included ScreenCapture.h only does forward declaration, hence compiler doesn't know the size of it.

So finally my question is, how to correctly use this library without SCCommon.h and successful compilation?

Thanks!

My environment: Win10 x64, VS2017 (currently doing only 32bit compilation).

smasherprog commented 6 years ago

your right ill have to move that out to the public api. let me see if i can do that now

smasherprog commented 6 years ago

Just committed the change to master and created a release on this. Thanks for that!

jakakonda commented 6 years ago

Works now, thanks!

plevexier commented 4 years ago

It still errors on master when I remove the "internal/SCCommon.h", getting "error: ‘ImageRect’ in namespace ‘SL::Screen_Capture’ does not name a type" for all the types defined there. Does the header still need to be removed for PROD?

smasherprog commented 4 years ago

you still need the header in your codebase, just dont include the header in your code directly. The library uses it internally.