Board index FlightGear Support Compiling

Build error Could NOT find DBUS

Building FlightGear from source, and in the need for help?

Build error Could NOT find DBUS

Postby owl--- » Sat Jun 22, 2019 6:26 pm

Hi!

I'm trying to build the FG from source with the download_and_compile.sh script under Ubuntu 16.04. It fails with errors (compilation_log.txt):

[...]
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for modules 'IMPORTED_TARGET;dbus-1'
-- No package 'IMPORTED_TARGET' found
-- Could NOT find DBUS (missing: DBUS_INCLUDE_DIRS DBUS_LIBRARIES)
-- Found LIBEVENT: /usr/include
CMake Warning at CMakeLists.txt:292 (message):
SWIFT support disabled, dbus and/or LibEvent not found
[...]
[ 42%] Linking CXX executable fgfs
CMakeFiles/fgfs.dir/screensaver_control.cxx.o: In function `fgOSDisableScreensaver()':
/home/yan/.fgfs/FGFS_SRC/build/flightgear/src/Main/screensaver_control.cxx:49: undefined reference to `dbus_bus_get'
/home/yan/.fgfs/FGFS_SRC/build/flightgear/src/Main/screensaver_control.cxx:50: undefined reference to `dbus_connection_set_exit_on_disconnect'
/home/yan/.fgfs/FGFS_SRC/build/flightgear/src/Main/screensaver_control.cxx:54: undefined reference to `dbus_message_new_method_call'
/home/yan/.fgfs/FGFS_SRC/build/flightgear/src/Main/screensaver_control.cxx:55: undefined reference to `dbus_message_append_args'
/home/yan/.fgfs/FGFS_SRC/build/flightgear/src/Main/screensaver_control.cxx:56: undefined reference to `dbus_connection_send'
/home/yan/.fgfs/FGFS_SRC/build/flightgear/src/Main/screensaver_control.cxx:59: undefined reference to `dbus_message_new_method_call'
/home/yan/.fgfs/FGFS_SRC/build/flightgear/src/Main/screensaver_control.cxx:60: undefined reference to `dbus_message_append_args'
/home/yan/.fgfs/FGFS_SRC/build/flightgear/src/Main/screensaver_control.cxx:61: undefined reference to `dbus_connection_send'
/home/yan/.fgfs/FGFS_SRC/build/flightgear/src/Main/screensaver_control.cxx:62: undefined reference to `dbus_connection_flush'
collect2: error: ld returned 1 exit status

Looks like it cannot find dbus headers and/or libraries. I've already installed libdbus-1 and libdbus-1-dev (both 1.10.6) and still get these errors.

I'm not a programmer and have no idea what to do. How can I pass DBUS_INCLUDE_DIRS and DBUS_LIBRARIES to the script? I've tried something like this:

DBUS_INCLUDE_DIRS=/usr/include/dbus-1.0/dbus DBUS_LIBRARIES=/lib/x86_64-linux-gnu/libdbus-1.so.3 FG_CMAKEARGS='-DENABLE_SWIFT=ON' ../fgmeta/download_and_compile.sh -pn -j2

But it gives no effect.
owl---
 
Posts: 2
Joined: Sat Jun 22, 2019 6:02 pm

Re: Build error Could NOT find DBUS

Postby legoboyvdlp » Sat Jun 22, 2019 6:30 pm

DBus appears to have some libraries or headers in odd places - I can't remember but I think there was some headers in /lib/dbus-1.0/dbus/ - try adding that to INCLUDE_DIRS? Or if not it was a library in include/ - not quite sure.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Build error Could NOT find DBUS

Postby wkitty42 » Sat Jun 22, 2019 7:26 pm

asking the obvious: has libdbus-dev been installed?
once i did that, i had no problems with the dnc script finding everything and building with SWIFT capability...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: Build error Could NOT find DBUS

Postby legoboyvdlp » Sat Jun 22, 2019 7:39 pm

Yep, it says he tried both 1.0 and dev.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Build error Could NOT find DBUS

Postby wkitty42 » Sat Jun 22, 2019 7:56 pm

ahhh, i missed that... yeah, -dev absolutely has to be installed or the build system won't find the necessary .h (header) files... that's all i have to offer... i prefer the pascal build format ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: Build error Could NOT find DBUS

Postby owl--- » Mon Jun 24, 2019 12:18 pm

All those errors were due to old cmake in my distribution. It builds fine with CMAKE component, so the problem is solved now. Thanks for assistance!
owl---
 
Posts: 2
Joined: Sat Jun 22, 2019 6:02 pm

Re: Build error Could NOT find DBUS

Postby wkitty42 » Mon Jun 24, 2019 5:12 pm

ahhh, yes, i ran into a problem like that some time ago... downloading and building a new cmake was added to the dnc script specifically for that problem and FG defined a minimum cmake version needed... i'm glad you figured out the problem and got it sussed :)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04


Return to Compiling

Who is online

Users browsing this forum: No registered users and 2 guests