screen_capture_lite icon indicating copy to clipboard operation
screen_capture_lite copied to clipboard

LNK2001 error without cmake

Open bluetooth12 opened this issue 2 years ago • 6 comments

Hi, First of all, thank you for sharing your code. I'm trying to figure out how it works. I pulled out all the windows C++ header and source files and put them into a MVS 2017 project. I then added dwmapi.lib to Linker>>Input>>Additional Dependencies. I am currently getting two identical LNK2001 errors:

Severity Code Description Project File Line Suppression State Error LNK2001 unresolved external symbol "class std::shared_ptr<class SL::Screen_Capture::ICaptureConfiguration<class std::function<void __cdecl(struct SL::Screen_Capture::Image const &,struct SL::Screen_Capture::Monitor const &)> > > __cdecl SL::Screen_Capture::CreateCaptureConfiguration(class std::function<class std::vector<struct SL::Screen_Capture::Monitor,class std::allocator<struct SL::Screen_Capture::Monitor> > __cdecl(void)> const &)" (?CreateCaptureConfiguration@Screen_Capture@SL@@YA?AV?$shared_ptr@V?$ICaptureConfiguration@V?$function@$$A6AXABUImage@Screen_Capture@SL@@ABUMonitor@23@@Z@std@@@Screen_Capture@SL@@@std@@ABV?$function@$$A6A?AV?$vector@UMonitor@Screen_Capture@SL@@V?$allocator@UMonitor@Screen_Capture@SL@@@std@@@std@@XZ@4@@Z) ScreenCapture XX\screen_capture_lite\ScreenCapture\ScreenCapture\ScreenCapture.obj 1

bluetooth12 avatar Jun 29 '22 17:06 bluetooth12

seems to be related to: Severity Code Description Project File Line Suppression State Error (active) E0312 no suitable user-defined conversion from "std::shared_ptr<Screen_Capture::ScreenCaptureConfiguration>" to "std::shared_ptr<SL::Screen_Capture::ICaptureConfigurationSL::Screen_Capture::ScreenCaptureCallback>" exists ScreenCapture XX\screen_capture_lite\ScreenCapture\ScreenCapture\ScreenCapture.cpp 131

for lines 131, 139 and 147 in ScreenCapture.cpp

bluetooth12 avatar Jun 29 '22 19:06 bluetooth12

as well as this Severity Code Description Project File Line Suppression State Error (active) E0312 no suitable user-defined conversion from "std::shared_ptr<Screen_Capture::WindowCaptureConfiguration>" to "std::shared_ptr<SL::Screen_Capture::ICaptureConfigurationSL::Screen_Capture::WindowCaptureCallback>" exists ScreenCapture XX\screen_capture_lite\ScreenCapture\ScreenCapture\ScreenCapture.cpp 174

for lines 174, 181 and 189 in ScreenCapture.cpp

bluetooth12 avatar Jun 29 '22 20:06 bluetooth12

I was able to build and run the code in MVS 2019 with c++20 (I think). Do you have a version that runs on MVS 2017?

bluetooth12 avatar Jun 29 '22 22:06 bluetooth12

Whats the reason for needing to support 2017? Latest VS is free for everyone, and if your working for a company and using this repo, then you should be able to modify the codebase to support older versions of vs. :)

smasherprog avatar Jun 30 '22 14:06 smasherprog

Understood. I'm trying to see whether what you have is something I would be able to use for a video conferencing tool. I need to write individual images (screen captures to a buffer). The rest of the system is written in an old version of MVS 2017.

bluetooth12 avatar Jun 30 '22 15:06 bluetooth12

That should be straight forward.. It will take a little bit of time.. maybe an hour or so. I originally developed this library to do exactly that, which is why there are separate callsbacks for getting the FULL image, the parts that have changed, and the mouse is decoupled from the main image. All of these make coding a little bit more work, but the savings is significant in terms of bandwidth/cpu and memory

smasherprog avatar Jun 30 '22 15:06 smasherprog

Going to close this unless there's something new to add.

smasherprog avatar Aug 24 '22 23:08 smasherprog