[k3b] K3b 2.0 RC2

Michał Małek michalm at jabster.pl
Wed Mar 10 19:35:20 UTC 2010


Ryan Stonecipher-Fisher wrote:
> Hey y'all,
> I'm working on porting k3b to OS X as part of the MacPorts project.
> So far I have met all dependencies for 1.91.0 except musicbrainz and
> musepack, so k3b configures fine and begins building.
> I'm encountering an error when building:
> 
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/work
> /k3b-1.91.0/libk3bdevice/k3bdevice.cpp: In constructor
> 'K3b::Device::Device::Private::Private()':
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/work
> /k3b-1.91.0/libk3bdevice/k3bdevice.cpp:123: error: 'HANDLE_DEFAULT_VALUE'
> was not declared in this scope
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/work
> /k3b-1.91.0/libk3bdevice/k3bdevice.cpp: In member function 'bool
> K3b::Device::Device::open(bool) const':
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/work
> /k3b-1.91.0/libk3bdevice/k3bdevice.cpp:1800: error: 'HANDLE_DEFAULT_VALUE'
> was not declared in this scope
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/work
> /k3b-1.91.0/libk3bdevice/k3bdevice.cpp:1803: error: 'HANDLE_DEFAULT_VALUE'
> was not declared in this scope
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/work
> /k3b-1.91.0/libk3bdevice/k3bdevice.cpp: In member function 'void
> K3b::Device::Device::close() const':
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/work
> /k3b-1.91.0/libk3bdevice/k3bdevice.cpp:1811: error: 'HANDLE_DEFAULT_VALUE'
> was not declared in this scope
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/work
> /k3b-1.91.0/libk3bdevice/k3bdevice.cpp:1821: error: 'HANDLE_DEFAULT_VALUE'
> was not declared in this scope
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/work
> /k3b-1.91.0/libk3bdevice/k3bdevice.cpp: In member function 'bool
> K3b::Device::Device::isOpen() const':
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/work
> /k3b-1.91.0/libk3bdevice/k3bdevice.cpp:1827: error: 'HANDLE_DEFAULT_VALUE'
> was not declared in this scope
> Linking CXX executable k3bsetuphelper.app/Contents/MacOS/k3bsetuphelper
> cd
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/wor
> k/k3b-1.91.0/k3bsetup && /opt/local/bin/cmake -E cmake_link_script
> CMakeFiles/k3bsetuphelper.dir/link.txt --verbose=1
> /usr/bin/g++-4.2    -arch x86_64 -isysroot
> /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -O2 -arch
> x86_64  -fno-common -Woverloaded-virtual -fvisibility=hidden
> -fvisibility-inlines-hidden -O2 -DNDEBUG -DQT_NO_DEBUG
> -Wl,-search_paths_first -headerpad_max_install_names -L/opt/local/lib
> CMakeFiles/k3bsetuphelper.dir/k3bsetuphelper_automoc.o
> CMakeFiles/k3bsetuphelper.dir/k3bsetupworker.o
> CMakeFiles/k3bsetuphelper.dir/k3bsetupprogramitem.o  -o
> k3bsetuphelper.app/Contents/MacOS/k3bsetuphelper
> -F/opt/local/libexec/qt4-mac/lib -L/opt/local/lib
> /opt/local/lib/libkdecore.5.4.0.dylib -framework QtDBus -framework
> QtCore -lpthread -framework Carbon
> make[2]: *** [libk3bdevice/CMakeFiles/k3bdevice.dir/k3bdevice.o] Error 1
> make[1]: *** [libk3bdevice/CMakeFiles/k3bdevice.dir/all] Error 2
> make[1]: *** Waiting for unfinished jobs....
> cd
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/wor
> k/k3b-1.91.0/k3bsetup && /opt/local/bin/cmake
> -D_filename=/opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_
> kde_k3b/work/k3b-1.91.0/k3bsetup/k3bsetuphelper.app/Contents/MacOS/k3bsetup
> helper.shell -D_library_path_variable=DYLD_LIBRARY_PATH
> -D_ld_library_path="/opt/local/var/macports/build/_Volumes_Users_ryan_Build
> s_ports_kde_k3b/work/k3b-1.91.0/lib/./:/opt/local/lib"
> -D_executable=/opt/local/var/macports/build/_Volumes_Users_ryan_Builds_por
> ts_kde_k3b/work/k3b-1.91.0/k3bsetup/k3bsetuphelper.app/Contents/MacOS/k3bse
> tuphelper -P /opt/local/share/apps/cmake/modules/kde4_exec_via_sh.cmake
> /opt/local/bin/cmake -E cmake_progress_report
> /opt/local/var/macports/build/_Volumes_Users_ryan_Builds_ports_kde_k3b/work
> /k3b-1.91.0/CMakeFiles 59
> [ 38%] Built target k3bsetuphelper
> make: *** [all] Error 2
> 
> I'm just doing this MacPorts stuff as a hobby and am a mechanical
> engineer, not a programmer, so any advice on how to find and fix the
> source of this error would be appreciated.

Hi,
Well, you stumbled upon the first thing to port :)
At the beginning of k3bdevice.cpp file you can find following fragment:

#ifdef Q_OS_FREEBSD
#define HANDLE_DEFAULT_VALUE 0
#endif
#ifdef Q_OS_WIN32
#define HANDLE_DEFAULT_VALUE INVALID_HANDLE_VALUE
#endif
#ifdef Q_OS_LINUX
#define HANDLE_DEFAULT_VALUE -1
#endif
#ifdef Q_OS_NETBSD
#define HANDLE_DEFAULT_VALUE -1
#endif

Because there is no #ifdef Q_OS_MAC condition here, HANDLE_DEFAULT_VALUE 
doesn't become defined and compiler complains about it when it's used later.
Look also into k3bdevice.h for definition of Device::Handle:

#if defined(Q_OS_FREEBSD)
            typedef struct cam_device* Handle;
#elif defined(Q_OS_WIN32)
            // file handle
            typedef HANDLE Handle;
#else
            // file descriptor
            typedef int Handle;
#endif

Find how the file descriptor looks like on Mac OS X and than define it's 
default value (HANDLE_DEFAULT_VALUE) accordingly. E.g. if it's "int" add

#ifdef Q_OS_MAC
#define HANDLE_DEFAULT_VALUE -1
#endif

-- 
Best regards,
Michał



More information about the k3b mailing list