New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add build instructions #1
Comments
Aryoda,
I'm glad you were able to get ddcui to build and run. Quite impressed
actually. As the description says, ddcui is "under construction, not
yet for public use", which is why there are no instructions. It's very
much pre-alpha code, on Github so I can use the Coverity Scan static
analysis tool that's free to open source projects.
That said, I'd be happy to hear of any issues you encounter. They are
abundant.
Sanford
…On 06/24/2018 02:37 PM, aryoda wrote:
Great project - a UI for configuring the display via ddcutil - all I
ever wanted :-)
I have tried to build from the sources with Qt Creator 3.01 on Ubuntu
14.04 64 bit.
It would be great to add basic "how to build" instructions to the
readme file,
esp. the dev and build environment you are using.
*PS: For other reader who want to compile:*
What I did so far to compile the code (more or less successfully) with
* on Ubuntu 14.04
* Qt version 5.2.1
* and QtCreator 3.01
1.
Edited the |CMakeLists.txt| file
* Relaxed the required cmake version in first line:
|cmake_minimum_required(VERSION 2.8 FATAL_ERROR)|
* Added a line to get rid of the "nullptr not declared in scope"
error:
|set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")|
2.
Started Qt Creator and opened the |CMakeList.txt| as new project
via Ctrl + O
3.
In the "Edit" view:
* right click on the project root folder ("ddcui [master]")
* select "Run CMake"
4.
Fixed all compile errors due to the older Qt version 5.2.1 of
Ubuntu 14.04, mainly the error:
'asprintf' is not a member of 'QString'
by using |arg| instead, e. g.
|setObjectName(QString::asprintf("FeatureWidget-0x%02x",
_feature_code));|
becomes
|setObjectName(QString("FeatureWidget-0x%02x").arg(_feature_code));|
5.
Specifying the run target in "Projects > Run"
* working directory is the build folder
* arguments are
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANhsblgb4hQCE3sUgNvwVww1QLNGtqCiks5t_9x3gaJpZM4U1QPD>.
|
Update to build using Ubuntu 18.04 and Qt5 (for early users of CMake will show some errors if there are missing Qt5 packages:
If executing
you have to update the dynamic linker run-time bindings (because you have built and installed
Then clean and rebuild via QtCreator. Great work, Sanford! |
@rockowitz Thanks for adding the BUILDING.md :-) |
I followed the build instructions but qt-qreator spits out some error message about
|
Is libddcutil in your ldconfig search path? The following command will
show whether ldconfig finds it:
$ ldconfig -v | grep ddcutil
If not, where has libddcutil been installed?
To see the ldconfig search path:
$ ldconfig -v 2> /dev/null | grep -v ^$'\t'
|You may also want to check if pkg-config is finding ddcutil:
$ pkg-config ddcutil --libs
$ pkg-config ddcutil --cflags
|
…On 11/20/18 8:44 AM, ǝʞɔoʃʞ uɐʇsıɹʇ wrote:
I followed the build instructions but qt-qreator spits out some error
message about |/usr/bin/ld: cannot find -lddcutil|. I installed the
prebuilt binaries and development files through the ubuntu bionic ppa.
|14:37:25: Running steps for project ddcui... 14:37:25: Starting:
"/usr/bin/cmake" --build . --target all Scanning dependencies of
target ddcui_autogen [ 2%] Automatic MOC, UIC and RCC for target ddcui
[ 2%] Built target ddcui_autogen Scanning dependencies of target ddcui
[ 5%] Building CXX object
CMakeFiles/ddcui.dir/src/imported/QtWaitingSpinner/waitingspinnerwidget.cpp.o
[ 7%] Building CXX object
CMakeFiles/ddcui.dir/src/base/ddca_utils.cpp.o [ 10%] Building CXX
object CMakeFiles/ddcui.dir/src/base/ddcui_globals.cpp.o [ 12%]
Building CXX object CMakeFiles/ddcui.dir/src/base/debug_utils.cpp.o [
15%] Building CXX object
CMakeFiles/ddcui.dir/src/base/feature_selector.cpp.o [ 17%] Building
CXX object CMakeFiles/ddcui.dir/src/base/global_state.cpp.o [ 20%]
Building CXX object CMakeFiles/ddcui.dir/src/base/hline_widget.cpp.o [
22%] Building CXX object
CMakeFiles/ddcui.dir/src/base/other_options_state.cpp.o [ 25%]
Building CXX object CMakeFiles/ddcui.dir/src/nongui/ddc_error.cpp.o [
27%] Building CXX object
CMakeFiles/ddcui.dir/src/nongui/feature_base_model.cpp.o [ 30%]
Building CXX object
CMakeFiles/ddcui.dir/src/nongui/feature_value.cpp.o [ 32%] Building
CXX object CMakeFiles/ddcui.dir/src/nongui/msgbox_queue.cpp.o [ 35%]
Building CXX object CMakeFiles/ddcui.dir/src/nongui/vcprequest.cpp.o [
37%] Building CXX object
CMakeFiles/ddcui.dir/src/nongui/vcpthread.cpp.o [ 40%] Building CXX
object CMakeFiles/ddcui.dir/src/monitor_desc/monitor_desc_ui.cpp.o [
42%] Building CXX object
CMakeFiles/ddcui.dir/src/monitor_desc/monitor_desc_actions.cpp.o [
45%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_value_widgets/value_base_widget.cpp.o
[ 47%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_value_widgets/value_cont_widget.cpp.o
[ 50%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_value_widgets/value_nc_widget.cpp.o [
52%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_value_widgets/value_reset_widget.cpp.o
[ 55%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_value_widgets/value_2button_widget.cpp.o
[ 57%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_value_widgets/value_stacked_widget.cpp.o
[ 60%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_value_widgets/value_std_widget.cpp.o
[ 62%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_scrollarea/features_scrollarea_ui.cpp.o
[ 65%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_scrollarea/feature_widget.cpp.o [
67%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_scrollarea/feature_widget_header.cpp.o
[ 70%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_scrollarea/features_scrollarea_contents.cpp.o
[ 72%] Building CXX object
CMakeFiles/ddcui.dir/src/feature_scrollarea/features_scrollarea_view.cpp.o
[ 75%] Building CXX object
CMakeFiles/ddcui.dir/src/help/help_dialog.cpp.o [ 77%] Building CXX
object
CMakeFiles/ddcui.dir/src/option_dialogs/feature_selection_dialog.cpp.o
[ 80%] Building CXX object
CMakeFiles/ddcui.dir/src/option_dialogs/other_options_dialog.cpp.o [
82%] Building CXX object CMakeFiles/ddcui.dir/src/main/monitor.cpp.o [
85%] Building CXX object
CMakeFiles/ddcui.dir/src/main/mainwindow_ui.cpp.o [ 87%] Building CXX
object CMakeFiles/ddcui.dir/src/main/mainwindow.cpp.o [ 90%] Building
CXX object CMakeFiles/ddcui.dir/src/main/main.cpp.o [ 92%] Building
CXX object CMakeFiles/ddcui.dir/src/main/msgbox_thread.cpp.o [ 95%]
Building CXX object
CMakeFiles/ddcui.dir/ddcui_autogen/mocs_compilation.cpp.o [ 97%]
Building CXX object
CMakeFiles/ddcui.dir/ddcui_autogen/EWIEGA46WW/qrc_ddcui.cpp.o [100%]
Linking CXX executable ddcui /usr/bin/ld: cannot find -lddcutil
/usr/bin/ld: cannot find -lddcutil
CMakeFiles/ddcui.dir/build.make:1059: recipe for target 'ddcui' failed
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ddcui.dir/all'
failed Makefile:129: recipe for target 'all' failed collect2: error:
ld returned 1 exit status make[2]: *** [ddcui] Error 1 make[1]: ***
[CMakeFiles/ddcui.dir/all] Error 2 make: *** [all] Error 2 14:38:09:
The process "/usr/bin/cmake" exited with code 2. Error while
building/deploying project ddcui (kit: Importiertes Kit) When
executing step "Erstellen mit CMake" 14:38:09: Elapsed time: 00:44. |
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANhsbvY4-Ve1zXPjC3DdQ7AEgIXpA08Dks5uxAchgaJpZM4U1QPD>.
|
Thanks for answering. Here is the output of the commands you recommended.
|
I have recreated your problem using the PPA packages. The problem is
in the location of the -link_directories() statement in CMakeLists.txt,
which must come before add_executable(). A copy of CMakeLists.txt that
fixes this problem is attached. For details, see
#4.
Sanford
On 11/22/18 4:49 AM, ǝʞɔoʃʞ uɐʇsıɹʇ wrote:
Thanks for answering. Here is the output of the command you recommended:
|~ ldconfig -v | grep ddcutil /sbin/ldconfig.real: »stat()« kann nicht
für »/usr/local/lib/i386-linux-gnu« aufgerufen werden: Datei oder
Verzeichnis nicht gefunden /sbin/ldconfig.real: »stat()« kann nicht
für »/usr/local/lib/i686-linux-gnu« aufgerufen werden: Datei oder
Verzeichnis nicht gefunden /sbin/ldconfig.real: »stat()« kann nicht
für »/lib/i686-linux-gnu« aufgerufen werden: Datei oder Verzeichnis
nicht gefunden /sbin/ldconfig.real: »stat()« kann nicht für
»/usr/lib/i686-linux-gnu« aufgerufen werden: Datei oder Verzeichnis
nicht gefunden /sbin/ldconfig.real: »stat()« kann nicht für
»/usr/local/lib/x86_64-linux-gnu« aufgerufen werden: Datei oder
Verzeichnis nicht gefunden /sbin/ldconfig.real: Pfad
»/lib/x86_64-linux-gnu« mehrfach angegeben /sbin/ldconfig.real: Pfad
»/usr/lib/x86_64-linux-gnu« mehrfach angegeben /sbin/ldconfig.real:
/lib/i386-linux-gnu/ld-2.27.so is the dynamic linker, ignoring
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.27.so is the dynamic
linker, ignoring libddcutil.so.0 -> libddcutil.so.0.0.0
/sbin/ldconfig.real: /lib32/ld-2.27.so is the dynamic linker, ignoring
/sbin/ldconfig.real: Es ist nicht möglich, die temporäre Cache-Datei
/etc/ld.so.cache~ zu erzeugen: Keine Berechtigung ➜ ~ ldconfig -v 2>
/dev/null | grep -v ^$'\t' /usr/lib/x86_64-linux-gnu/libfakeroot:
/lib/i386-linux-gnu: /usr/lib/i386-linux-gnu: /usr/local/lib:
/lib/x86_64-linux-gnu: /usr/lib/x86_64-linux-gnu: /lib32: /usr/lib32:
/lib: /usr/lib: /usr/lib/i386-linux-gnu/tls: (hwcap:
0x8000000000000000) /usr/lib/i386-linux-gnu/sse2: (hwcap:
0x0000000000000001) /usr/lib/x86_64-linux-gnu/tls: (hwcap:
0x8000000000000000) ➜ ~ pkg-config ddcutil --libs -lddcutil -lglib-2.0
-lXrandr -lX11 ➜ ~ pkg-config ddcutil --cflags -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include |
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANhsbpcTFV8x2JWBQu-eazq4uR4ItDM9ks5uxnM8gaJpZM4U1QPD>.
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(ddcui)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(QT5_LIBRARIES Qt5::Widgets )
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build/build_cmake)
set(EXECUTABLE_OUTPUT_PATH, ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH, ${CMAKE_BINARY_DIR})
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
# ADDITIONAL_MAKE_CLEAN_FILES( ... )
# Find the QtWidgets library
# find_package(Qt5Widgets)
# ensures all Qt componenets have same version:
find_package(Qt5 COMPONENTS Core Widgets Gui Help REQUIRED)
# find_package(glib-2.0)
find_package (PkgConfig REQUIRED)
pkg_check_modules(GLIB2 REQUIRED glib-2.0)
pkg_check_modules(DDCUTIL REQUIRED ddcutil)
message( STATUS "DDCUTIL_INCLUDE_DIRS: ${DDCUTIL_INCLUDE_DIRS}" )
message( STATUS "DDCUTIL_LIBRARY_DIRS: ${DDCUTIL_LIBRARY_DIRS}" )
message( STATUS "DDCUTIL_LIBRARIES: ${DDCUTIL_LIBRARIES}" )
include_directories(SYSTEM ${Qt5Widgets_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS} ${DDCUTIL_INCLUDE_DIRS} )
# both work:
OPTION(APPLY_CANCEL "Use Accept/Cancel buttons" OFF)
set(ALT_FEATURES OFF)
# set(COVERITY_DUMMIES OFF)
configure_file(cconfig.h.in config.h)
include_directories(src)
set(SOURCES
src/imported/QtWaitingSpinner/waitingspinnerwidget.cpp
src/base/ddca_utils.cpp
src/base/ddcui_globals.cpp
src/base/debug_utils.cpp
src/base/feature_selector.cpp
src/base/global_state.cpp
src/base/hline_widget.cpp
src/base/other_options_state.cpp
src/nongui/ddc_error.cpp
src/nongui/feature_base_model.cpp
src/nongui/feature_value.cpp
src/nongui/msgbox_queue.cpp
src/nongui/vcprequest.cpp
src/nongui/vcpthread.cpp
src/monitor_desc/monitor_desc_ui.cpp
src/monitor_desc/monitor_desc_actions.cpp
src/feature_value_widgets/value_base_widget.cpp
src/feature_value_widgets/value_cont_widget.cpp
src/feature_value_widgets/value_nc_widget.cpp
src/feature_value_widgets/value_reset_widget.cpp
src/feature_value_widgets/value_2button_widget.cpp
src/feature_value_widgets/value_stacked_widget.cpp
src/feature_value_widgets/value_std_widget.cpp
src/feature_scrollarea/features_scrollarea_ui.cpp
src/feature_scrollarea/feature_widget.cpp
src/feature_scrollarea/feature_widget_header.cpp
src/feature_scrollarea/features_scrollarea_contents.cpp
src/feature_scrollarea/features_scrollarea_view.cpp
src/help/help_dialog.cpp
ddcui.qrc
src/option_dialogs/feature_selection_dialog.cpp
src/option_dialogs/other_options_dialog.cpp
src/main/monitor.cpp
src/main/mainwindow_ui.cpp
src/main/mainwindow.cpp
src/main/main.cpp
src/main/msgbox_thread.cpp
)
if (ALT_FEATURES)
set (SOURCES ${SOURCES}
src/alt/table_model_view/table_model_view_ui.cpp
src/alt/table_model_view/feature_table_model.cpp
src/alt/table_model_view/feature_value_tableitem_abstract_editor.cpp
src/alt/table_model_view/feature_value_tableitem_cb_editor.cpp
src/alt/table_model_view/feature_value_tableitem_cont_editor.cpp
src/alt/table_model_view/feature_value_tableitem_delegate.cpp
src/alt/table_widget/table_widget_ui.cpp
src/alt/list_model_view/list_model_view_ui.cpp
src/alt/list_model_view/feature_item_model.cpp
src/alt/list_widget/list_widget_ui.cpp
src/alt/list_widget/feature_list_widget.cpp
src/alt/list_widget/feature_widget_extended.cpp
)
endif()
# file(GLOB dummy_SOURCES src/dummies/*.cpp)
set(UI_SOURCES
src/option_dialogs/feature_selection_dialog.ui
src/option_dialogs/other_options_dialog.ui
)
# must come before add_executable():
link_directories(${DDCUTIL_LIBRARY_DIRS})
# qt5_wrap_ui(UI_GENERATED_HEADERS ${UI_SOURCES})
# add_executable(ddcui ${SOURCES} ${UI_GENERATED_HEADERS})
add_executable(ddcui ${SOURCES})
target_compile_options(ddcui PUBLIC "-fPIC")
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
# set_property(TARGET ddcui PROPERTY AUTOUIC)
# Use the Widgets module from Qt 5.
target_link_libraries(ddcui Qt5::Widgets ${GLIB2_LIBRARIES} ${DDCUTIL_LIBRARIES})
install(TARGETS ddcui DESTINATION bin)
|
I'm sorry can you attach the `CMakeLists.txt file because the formatting is completely destroyed when copy and pasted. |
Looks like the email attachment was converted to inline text by github. Here it is linked to using the github GUI. |
Great project - a UI for configuring the display via ddcutil - all I ever wanted :-)
I have tried to build from the sources with Qt Creator 3.01 on Ubuntu 14.04 64 bit.
It would be great to add basic "how to build" instructions to the readme file,
esp. the dev and build environment you are using.
PS: For other readers who want to compile:
What I did so far to compile the code (more or less successfully) with
Preconditions
ddcutil
from githubif you get the
cmake
error "No package 'ddcutil' found" you have forgotten this step (incl. the finalsudo make install
so that the C header files get installed)Edited the
CMakeLists.txt
filecmake_minimum_required(VERSION 2.8 FATAL_ERROR)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
Started Qt Creator and opened the
CMakeList.txt
as new project via Ctrl + Ohttps://codeyarns.com/2016/01/26/how-to-import-cmake-project-in-qt-creator/
In the "Edit" view:
Fixed all compile errors due to the older Qt version 5.2.1 of Ubuntu 14.04, mainly the error:
by using
arg
instead ofasprintf
, e. g.setObjectName(QString::asprintf("FeatureWidget-0x%02x", _feature_code));
becomes
setObjectName(QString("FeatureWidget-0x%02x").arg(_feature_code));
Specifying the run target in "Projects > Run > Run Configuration > Add > Custom executable"
ddcui
as ExecutableThe text was updated successfully, but these errors were encountered: