Skip to content
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

Closed
aryoda opened this issue Jun 24, 2018 · 9 comments
Closed

Please add build instructions #1

aryoda opened this issue Jun 24, 2018 · 9 comments

Comments

@aryoda
Copy link

@aryoda aryoda commented Jun 24, 2018

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

  • on Ubuntu 14.04
  • Qt version 5.2.1
  • and QtCreator 3.01
  1. Preconditions

    • clone and build ddcutil from github
      if you get the cmake error "No package 'ddcutil' found" you have forgotten this step (incl. the final sudo make install so that the C header files get installed)
  2. 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")
  3. Started Qt Creator and opened the CMakeList.txt as new project via Ctrl + O

  4. In the "Edit" view:

    • right click on the project root folder ("ddcui [master]")
    • select "Run CMake"
  5. 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 of asprintf, e. g.
    setObjectName(QString::asprintf("FeatureWidget-0x%02x", _feature_code));
    becomes
    setObjectName(QString("FeatureWidget-0x%02x").arg(_feature_code));

  6. Specifying the run target in "Projects > Run > Run Configuration > Add > Custom executable"

    • enter ddcui as Executable
@rockowitz

This comment has been minimized.

Copy link
Owner

@rockowitz rockowitz commented Jun 24, 2018

@aryoda

This comment has been minimized.

Copy link
Author

@aryoda aryoda commented Sep 14, 2018

Update to build using Ubuntu 18.04 and Qt5 (for early users of ddcui ;-):

CMake will show some errors if there are missing Qt5 packages:

  1. Could not find package Configuration file provided by "Qt5Help"

    You can find the missing Ubuntu package via apt-file search Qt5Help:

    sudo apt-get install qttools5-dev

If executing ddcui fails with this error message

./ddcui
./ddcui: error while loading shared libraries: libddcutil.so.0: cannot open shared object file:
 No such file or directory

you have to update the dynamic linker run-time bindings (because you have built and installed libddcutil.so.0.0.0 into /lib/usr/lib manually as described in the preconditions of my first post above):

# optionally try this if ldconfig does not help and retry ldconfig:
# LD_LIBRARY_PATH=/usr/local/lib
sudo /sbin/ldconfig -v

Then clean and rebuild via QtCreator. ddcui can be run now:

screenshot ddcui 1

Great work, Sanford!

@aryoda

This comment has been minimized.

Copy link
Author

@aryoda aryoda commented Sep 14, 2018

@rockowitz Thanks for adding the BUILDING.md :-)

@aryoda aryoda closed this Sep 15, 2018
@tristan-k

This comment has been minimized.

Copy link

@tristan-k tristan-k commented Nov 20, 2018

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.
@rockowitz

This comment has been minimized.

Copy link
Owner

@rockowitz rockowitz commented Nov 20, 2018

@tristan-k

This comment has been minimized.

Copy link

@tristan-k tristan-k commented Nov 22, 2018

Thanks for answering. Here is the output of the commands 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
➜  ~ sudo apt list --installed | grep 'libddcutil*'

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libddcutil-dev/bionic,now 0.9.2-1 amd64  [installiert]
libddcutil0/bionic,now 0.9.2-1 amd64  [installiert]
@rockowitz

This comment has been minimized.

Copy link
Owner

@rockowitz rockowitz commented Nov 22, 2018

@tristan-k

This comment has been minimized.

Copy link

@tristan-k tristan-k commented Nov 22, 2018

I'm sorry can you attach the `CMakeLists.txt file because the formatting is completely destroyed when copy and pasted.

@rockowitz

This comment has been minimized.

Copy link
Owner

@rockowitz rockowitz commented Nov 23, 2018

Looks like the email attachment was converted to inline text by github. Here it is linked to using the github GUI.

CMakeLists.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.