flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
24.52k stars 1.57k forks source link

flameshot.cpp:147:24: error: ‘class QApplication’ has no member named ‘screenAt’ #3295

Open garumaru opened 1 year ago

garumaru commented 1 year ago

Flameshot Version

12.1.0

Installation Type

Compiled from source

Operating System type and version

centos7.9

Description

Hi there,

I followed the guide https://flameshot.org/docs/installation/source-code/, and got below error when make. The machine doesn't have internet connection, so I have to build flameshot from source code.

flameshot-master/src/core/flameshot.cpp:147:24: error: ‘class QApplication’ has no member named ‘screenAt’; did you mean ‘screens’? 147 | screen = qApp->screenAt(globalCursorPos); | ^~~~ | screens [ 51%] Building CXX object src/CMakeFiles/flameshot.dir/core/flameshotdbusadapter.cpp.o [ 51%] Building CXX object src/CMakeFiles/flameshot.dir/core/qguiappcurrentscreen.cpp.o make[2]: [src/CMakeFiles/flameshot.dir/core/flameshot.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... make[1]: [src/CMakeFiles/flameshot.dir/all] Error 2 make: [all] Error 2

Steps to reproduce

  1. git clone https://github.com/flameshot-org/flameshot.git
  2. mkdir build
  3. cd build
  4. cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ../
  5. make

Screenshots or screen recordings

No response

System Information

cmake version 3.22.4 gcc (GCC) 9.3.0

daknin commented 11 months ago

I also encountered this when building on Amazon Linux 2 which has an outdated qt 5.9. It looks like QGuiApplication::screenAt(QPoint) is only available from 5.10.

I did manage to build the v11.0.0 tag which does what I need it to.