smasherprog / screen_capture_lite

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

Using in QtCreator #19

Closed KevinBLT closed 7 years ago

KevinBLT commented 7 years ago

Hello,

I am having troubles using this in QtCreator. I have tried compiling it in VS2015, it works.

But I also get Linking Errors in QtCreator. Can't I just include the headers and compile it into my application?

I have no idea at the moment where to start.

smasherprog commented 7 years ago

Ill post in about 7-8 hours

smasherprog commented 7 years ago

In general you can include headers and source files to build this project. If you are using just regular VS, then you can generate a project using cmake,then add that as a reference to your current project.

You can review the https://github.com/smasherprog/Screen_Capture/blob/master/src/CMakeLists.txt file for the platform specific files included.

Generally, you would just add the file above to your own cmake build process. But, it sounds like you arent using cmake.

Do you use vcpkg at all? I am considering adding this project there . .

dexter3k commented 7 years ago

You can't just include headers and compile. It's not a header-only library. As an easy workaround, you can compile this lib separately and then use it in QtCreator just like any other lib. How to add libs

smasherprog commented 7 years ago

Thanks for the input SMemsky.

I am closing this issue. If you need more help post a comment and I'll try and help.

JulianMined commented 7 years ago

Hello, i compiled the lib and included it - now i got the follow error:

liblibScreen_Capture.a(GetMonitors.cpp.o): undefined reference to symbol 'XOpenDisplay'

Edit: My fault, i forgot to add -lXext -lXfixes -lX11