rockowitz / ddcui

Graphical user interface for ddcutil - control monitor settings
http://www.ddcutil.com
GNU General Public License v2.0
147 stars 2 forks source link

Building on Ubuntu 16.04 with cmake fails due to incorrect C++ version #3

Closed VorpalBlade closed 5 years ago

VorpalBlade commented 5 years ago

The compiler defaults to using C++03, not C++11, so nullptr is considered an undeclared identifier. Setting CMAKE_CXX_FLAGS to contain -std=c++11 solves the issue. (Though the proper solution would be to set CMAKE_CXX_STANDARD in the CMakeLists.txt file).

aryoda commented 5 years ago

And add CONFIG += c++11 to the .pro file to enable C++11 on a Qt project.

I guess C++11 is the default on Ubuntu 18.04 (which I am using)

See: https://stackoverflow.com/questions/16948382/how-to-enable-c11-in-qt-creator

rockowitz commented 5 years ago

File CMakeLists.txt on branch 0.0.3 has been modified to require C++11 as per your suggestion.   It also outputs the value of DDCUTIL_LIBRARY_DIRS to aid in diagnosing the library location issue you raised in your post.

Thank you.

Sanford

On 09/17/2018 03:35 PM, Arvid Norlander wrote:

The compiler defaults to using C++03, not C++11, so nullptr is considered an undeclared identifier. Setting CMAKE_CXX_FLAGS to contain -std=c++11 solves the issue. (Though the proper solution would be to set CMAKE_CXX_STANDARD in the CMakeLists.txt file).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rockowitz/ddcui/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/ANhsbmHFZhVpC_OJi0tdPNZx6OUHZ1nhks5ub_l7gaJpZM4Wskf8.

VorpalBlade commented 5 years ago

The C++11 issue is fixed now yes. Thank you. Though I believe you typoed the line CMAKE_CSS_STANDARD_REQUIRED (should be CXX).

rockowitz commented 5 years ago

So I did.  Fixed.

On 09/18/2018 01:08 AM, Arvid Norlander wrote:

The C++11 issue is fixed now yes. Thank you. Though I believe you typoed the line CMAKE_CSS_STANDARD_REQUIRED (should be CXX).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rockowitz/ddcui/issues/3#issuecomment-422256753, or mute the thread https://github.com/notifications/unsubscribe-auth/ANhsble97Adbb-G_tLYTUuK2TovY_x83ks5ucH-0gaJpZM4Wskf8.