alarm-clock-applet / alarm-clock

Alarm Clock is a fully-featured alarm clock for use with an AppIndicator implementation.
https://alarm-clock-applet.github.io
GNU General Public License v2.0
121 stars 31 forks source link

Add `g++` install note #213

Closed boundless-forest closed 1 year ago

boundless-forest commented 1 year ago

。You need to install g++ to be able to compile locally, otherwise the following error will be reported

> cmake .. -DCMAKE_BUILD_TYPE=Release

-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at CMakeLists.txt:4 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
See also "/home/bear/working/alarm-clock/build/CMakeFiles/CMakeOutput.log".
See also "/home/bear/working/alarm-clock/build/CMakeFiles/CMakeError.log".
tatokis commented 1 year ago

Thanks for the PR, however the project doesn't use C++ at all, so it's best to instead tell cmake that the project doesn't need a C++ compiler at all. Would you like to give that a try instead? Should be pretty straightforward.

Also, it's typically a better idea to just add build-essential to the deps instead instead of just the compiler itself.

I'll close this PR but feel free to open another one with the changes above if you wish. Otherwise, please let me know so that I do it myself.

boundless-forest commented 1 year ago

Would you like to give that a try instead? Should be pretty straightforward.

Hmm, I have already forgotten all the basics of c language. So, please help me to fix it.

tatokis commented 1 year ago

Unfortunately, there really isn't much I can do to help. It's a just matter of looking up how to tell cmake that the project only uses C. There's no actual C involved.

I've gone ahead and committed the fix. https://github.com/alarm-clock-applet/alarm-clock/commit/8519defaef0369bf498e205eba794246aff633bc