Bug 337921 - Unable to compile due to pointer type issue in gpcamera
Summary: Unable to compile due to pointer type issue in gpcamera
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Portability-Compilation (show other bugs)
Version: 4.11.0
Platform: Slackware Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-30 18:19 UTC by Cor
Modified: 2017-08-19 20:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.12.0


Attachments
compile logs compressed (109.98 KB, application/x-xz)
2014-07-31 18:29 UTC, Cor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor 2014-07-30 18:19:00 UTC
I'm trying to compile digikam from source (starting with 3.1.0 continuing towards 4.1.0) but every attempt fails on the following issue:

core/utilities/importui/backend/gpcamera.cpp:1668:31: error: request for member 'path' in 'info', which is of pointer type 'GPPortInfo {aka _GPPortInfo*}' (maybe you meant to use '->' ?)
             plist.append(info.path);

I'm doubting whether this is an actual bug (as it is showing up from 3.1.0 onwards (perhaps earlier) and not a compiler setting.

Not sure what additional information is needed, I'm willing to provide more information when necessary, but please guide me towards the correct information.

This appears when compiling using SlackBuild scripting on a Slackware 14.1 system.
uname -a output: 3.10.17-smp #2 SMP Wed Oct 23 17:13:14 CDT 2013 i686 Intel(R) Core(TM) i5-3330 CPU @ 3.00GHz GenuineIntel GNU/Linux

I'm not a C/C++ programmer so please be patient in telling me where to look and what to look for.
Comment 1 caulier.gilles 2014-07-31 06:43:05 UTC
We need a compilation backtrace with the error occurred.

Also, we need to know which libgphoto2 version you use on your system...

Gilles Caulier
Comment 2 Cor 2014-07-31 18:29:04 UTC
Created attachment 88065 [details]
compile logs compressed

please find the compile log and compile error log attached.
Comment 3 Cor 2014-08-01 18:02:40 UTC
And I see that my comment containing the version of libgphoto2 has not been copied... I have version libgphoto2-2.5.2-i486-1 as packaged in Slackware 14.1 by default (unmodified).
Comment 4 Christoph Feck 2014-08-20 21:21:29 UTC
Is this still an issue with digikam 4.2.0?
Comment 5 Cor 2014-08-22 15:01:27 UTC
I'm sorry to say that it is still an issue with 4.2.0.
Comment 6 caulier.gilles 2015-06-24 16:16:49 UTC
New digiKam 4.11.0 is available :

https://www.digikam.org/node/740

Can you reproduce the problem with this release ?

Gilles Caulier
Comment 7 Cor 2015-06-26 18:17:10 UTC
(In reply to Gilles Caulier from comment #6)
> New digiKam 4.11.0 is available :
> 
> https://www.digikam.org/node/740
> 
> Can you reproduce the problem with this release ?
> 
> Gilles Caulier

I will try and do so once the package is delivered through sbopkg. There are a couple of depencencies which are required for this version which I don't have at the moment (such as libkexiv2 and liblcms to name but a few).
I will come back on this.
Comment 8 Cor 2015-06-29 19:50:41 UTC
(In reply to Cor from comment #7)
> (In reply to Gilles Caulier from comment #6)
> > New digiKam 4.11.0 is available :
> > 
> > https://www.digikam.org/node/740
> > 
> > Can you reproduce the problem with this release ?
> > 
> > Gilles Caulier
> 
> I will try and do so once the package is delivered through sbopkg. There are
> a couple of depencencies which are required for this version which I don't
> have at the moment (such as libkexiv2 and liblcms to name but a few).
> I will come back on this.

I have tried it and the last message I get is this:

"/var/spool/sbopkg/digikam-4.11.0/core/utilities/importui/backend/gpcamera.cpp:1252:61: error: cannot convert 'CameraFile* {aka _CameraFile*}' to 'const char*' for argument '3' to 'int gp_camera_folder_put_file(Camera*, const char*, const char*, CameraFileType, CameraFile*, GPContext*)'
                                           d->status->context);
                                                             ^
/var/spool/sbopkg/digikam-4.11.0/core/utilities/importui/backend/gpcamera.cpp: In static member function 'static void Digikam::GPCamera::getSupportedPorts(QStringList&)':
/var/spool/sbopkg/digikam-4.11.0/core/utilities/importui/backend/gpcamera.cpp:1552:31: error: request for member 'path' in 'info', which is of pointer type 'GPPortInfo {aka _GPPortInfo*}' (maybe you meant to use '->' ?)
             plist.append(info.path);
                               ^
make[2]: *** [core/utilities/importui/CMakeFiles/importui.dir/backend/gpcamera.cpp.o] Error 1
make[2]: Leaving directory `/var/spool/sbopkg/digikam-4.11.0/build'
make[1]: *** [core/utilities/importui/CMakeFiles/importui.dir/all] Error 2
make[1]: Leaving directory `/var/spool/sbopkg/digikam-4.11.0/build'
make: *** [all] Error 2
" 
I have re-installed all mandatory dependencies and most optional but still I can't recompile.

Now, I can't find out which dependency contains gpcamera, or how to correct this. The gpcamera seems to be the same source of the problem, however I'm not sure whether we're facing the same problem here.
Comment 9 caulier.gilles 2015-06-29 20:37:29 UTC
Which libGphoto2 you use currently ?

Gilles Caulier
Comment 10 Cor 2015-07-01 15:46:30 UTC
(In reply to Gilles Caulier from comment #9)
> Which libGphoto2 you use currently ?
> 
> Gilles Caulier

pkgtool reports me the following:
PACKAGE NAME: libgphoto2-2.5.2-i486-1

root@machine:~# whereis libgphoto
libgphoto: /usr/lib/libgphoto2.so /usr/lib/libgphoto2.la

Is there any more information I can provide you with? If so, tell me what information preferably with the command (and flags) to use.

Thanks for your time and effort
Comment 11 Cor 2015-07-01 15:48:11 UTC
(In reply to Cor from comment #10)
> (In reply to Gilles Caulier from comment #9)
> > Which libGphoto2 you use currently ?
> > 
> > Gilles Caulier
> 
> pkgtool reports me the following:
> PACKAGE NAME: libgphoto2-2.5.2-i486-1
> 
> root@machine:~# whereis libgphoto
> libgphoto: /usr/lib/libgphoto2.so /usr/lib/libgphoto2.la
> 
> Is there any more information I can provide you with? If so, tell me what
> information preferably with the command (and flags) to use.
> 
> Thanks for your time and effort

the same information shown differently:

root@machine~# slackpkg search libgphoto2

Looking for libgphoto2 in package list. Please wait... DONE

The list below shows all packages with name matching "libgphoto2".

[ installed ] - libgphoto2-2.5.2-i486-1

You can search specific files using "slackpkg file-search file".
Comment 12 caulier.gilles 2015-07-01 16:18:24 UTC
In gpcamera.cpp the problem is here :

#ifdef HAVE_GPHOTO25
    errorCode = gp_camera_folder_put_file(d->camera,
                                          QFile::encodeName(folder).constData(),
                                          QFile::encodeName(itemName),
                                          GP_FILE_TYPE_NORMAL,
                                          cfile,
                                          d->status->context);
#else
    errorCode = gp_camera_folder_put_file(d->camera,
                                          QFile::encodeName(folder).constData(),
                                          cfile,
                                          d->status->context);    <<<<<<<<<<<<<<<<<<<<<<<<<<!!!!!
#endif

In fact the HAVE_GPHOTO25 flag is not set, but you use gphoto 2.5.2. 

So the problem can be :

- the detection of Gphoto2.5 by cmake.
- the packaging of gphoto2.5.2 on your system which do not set all properly for a fine detection.

I suspect the second one, because we have already tested with gphoto < 2.5 and gphoto >=2.5 on multiple system...

Gilles Caulier
Comment 13 caulier.gilles 2015-07-01 16:21:05 UTC
The flag is set by digiKAm cmake script like this :

# -- libgphoto2 rules --------------------------------------------------------------------------

MACRO_OPTIONAL_FIND_PACKAGE(Gphoto2)

if(NOT WIN32 AND GPHOTO2_FOUND)
    # See bug #268267 : digiKam need to be linked to libusb to prevent crash at gphoto2 init if opencv is linked with libdc1394
    MACRO_OPTIONAL_FIND_PACKAGE(USB)
endif()

if(GPHOTO2_FOUND)
    exec_program(gphoto2-config ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPHOTO2_VERSION)
    string(REPLACE "libgphoto2" "" GPHOTO2_VERSION "${GPHOTO2_VERSION}")
    MACRO_ENSURE_VERSION("2.4.0" "${GPHOTO2_VERSION}" VERSION_GPHOTO2)

    if(VERSION_GPHOTO2 AND LIBUSB_FOUND)
        set(GPHOTO2_FOUND true)
    else()
        set(GPHOTO2_FOUND false)
    endif()

    MACRO_ENSURE_VERSION("2.5.0" "${GPHOTO2_VERSION}" VERSION_GPHOTO25)

    if(VERSION_GPHOTO25)
        set(HAVE_GPHOTO25 1)
    else()
        set(HAVE_GPHOTO25 0)
    endif()
endif()

Typically, it run "gphoto2-config --version" CLI tool to check which version is installed on your system. What give this command on a console ?

Gilles Caulier
Comment 14 Cor 2015-07-01 17:20:55 UTC
(In reply to Gilles Caulier from comment #13)
> The flag is set by digiKAm cmake script like this :
> 
> # -- libgphoto2 rules
> --------------------------------------------------------------------------
> 
> MACRO_OPTIONAL_FIND_PACKAGE(Gphoto2)
> 
> if(NOT WIN32 AND GPHOTO2_FOUND)
>     # See bug #268267 : digiKam need to be linked to libusb to prevent crash
> at gphoto2 init if opencv is linked with libdc1394
>     MACRO_OPTIONAL_FIND_PACKAGE(USB)
> endif()
> 
> if(GPHOTO2_FOUND)
>     exec_program(gphoto2-config ARGS --version RETURN_VALUE _return_VALUE
> OUTPUT_VARIABLE GPHOTO2_VERSION)
>     string(REPLACE "libgphoto2" "" GPHOTO2_VERSION "${GPHOTO2_VERSION}")
>     MACRO_ENSURE_VERSION("2.4.0" "${GPHOTO2_VERSION}" VERSION_GPHOTO2)
> 
>     if(VERSION_GPHOTO2 AND LIBUSB_FOUND)
>         set(GPHOTO2_FOUND true)
>     else()
>         set(GPHOTO2_FOUND false)
>     endif()
> 
>     MACRO_ENSURE_VERSION("2.5.0" "${GPHOTO2_VERSION}" VERSION_GPHOTO25)
> 
>     if(VERSION_GPHOTO25)
>         set(HAVE_GPHOTO25 1)
>     else()
>         set(HAVE_GPHOTO25 0)
>     endif()
> endif()
> 
> Typically, it run "gphoto2-config --version" CLI tool to check which version
> is installed on your system. What give this command on a console ?
> 
> Gilles Caulier

root@machine:~# gphoto2-config --version
libgphoto2 2.4.11

Okay, so obviously something hasn't gone right when installing libgphoto2, how can I repair this?
Comment 15 caulier.gilles 2015-07-01 17:42:04 UTC
I don't know exactly. Ask to your distro team, trough IRC.

Tip : typically you mix more than one Gphoto2 version at the same time. Remove all Gphoto2, and re-install last one.

Gilles Caulier
Comment 16 Cor 2015-07-01 18:37:05 UTC
(In reply to Cor from comment #14)
> (In reply to Gilles Caulier from comment #13)
> > The flag is set by digiKAm cmake script like this :
> > 
> > # -- libgphoto2 rules
> > --------------------------------------------------------------------------
> > 
> > MACRO_OPTIONAL_FIND_PACKAGE(Gphoto2)
> > 
> > if(NOT WIN32 AND GPHOTO2_FOUND)
> >     # See bug #268267 : digiKam need to be linked to libusb to prevent crash
> > at gphoto2 init if opencv is linked with libdc1394
> >     MACRO_OPTIONAL_FIND_PACKAGE(USB)
> > endif()
> > 
> > if(GPHOTO2_FOUND)
> >     exec_program(gphoto2-config ARGS --version RETURN_VALUE _return_VALUE
> > OUTPUT_VARIABLE GPHOTO2_VERSION)
> >     string(REPLACE "libgphoto2" "" GPHOTO2_VERSION "${GPHOTO2_VERSION}")
> >     MACRO_ENSURE_VERSION("2.4.0" "${GPHOTO2_VERSION}" VERSION_GPHOTO2)
> > 
> >     if(VERSION_GPHOTO2 AND LIBUSB_FOUND)
> >         set(GPHOTO2_FOUND true)
> >     else()
> >         set(GPHOTO2_FOUND false)
> >     endif()
> > 
> >     MACRO_ENSURE_VERSION("2.5.0" "${GPHOTO2_VERSION}" VERSION_GPHOTO25)
> > 
> >     if(VERSION_GPHOTO25)
> >         set(HAVE_GPHOTO25 1)
> >     else()
> >         set(HAVE_GPHOTO25 0)
> >     endif()
> > endif()
> > 
> > Typically, it run "gphoto2-config --version" CLI tool to check which version
> > is installed on your system. What give this command on a console ?
> > 
> > Gilles Caulier
> 
> root@machine:~# gphoto2-config --version
> libgphoto2 2.4.11
> 
> Okay, so obviously something hasn't gone right when installing libgphoto2,
> how can I repair this?

So, can I just go into CMakeLists.txt and replace the code with any true part of the if-statements? Would that work?
Comment 17 caulier.gilles 2015-07-01 18:39:45 UTC
yes probably. But this is a weird work around with possible side effect.

Gilles Caulier
Comment 18 Cor 2015-07-01 18:42:39 UTC
(In reply to Gilles Caulier from comment #17)
> yes probably. But this is a weird work around with possible side effect.
> 
> Gilles Caulier

okay.. the guys at the IRC ask me if I've got the sources, but there is no /src folder in  digikam-4.11.0.tar.bz2, so aparently that is not the file they expect me to download.
Comment 19 Cor 2015-07-01 18:54:38 UTC
(In reply to Cor from comment #18)
> (In reply to Gilles Caulier from comment #17)
> > yes probably. But this is a weird work around with possible side effect.
> > 
> > Gilles Caulier
> 
> okay.. the guys at the IRC ask me if I've got the sources, but there is no
> /src folder in  digikam-4.11.0.tar.bz2, so aparently that is not the file
> they expect me to download.

By the way: modifying the script takes me until the part where it says that it can't find exiv2 at least in version 0.24 (my slackware has 0.23)
Comment 20 caulier.gilles 2015-07-01 19:13:21 UTC
Why do you compile digiKam with extra lib embeded.  it's for libkexiv2. Install this lib from your system as well. option for cmake are described here :

https://projects.kde.org/projects/extragear/graphics/digikam/digikam-software-compilation/repository/revisions/master/entry/README#L129

Gilles Caulier
Comment 21 Cor 2015-07-01 19:18:28 UTC
(In reply to Gilles Caulier from comment #20)
> Why do you compile digiKam with extra lib embeded.  it's for libkexiv2.
> Install this lib from your system as well. option for cmake are described
> here :
> 
> https://projects.kde.org/projects/extragear/graphics/digikam/digikam-
> software-compilation/repository/revisions/master/entry/README#L129
> 
> Gilles Caulier

Well... it is sort of sbopkg which does determine that for me... and here is the funny bit: if I'm using the sbopkg build-command, it doesn't complain about exiv2... so apparently they've found a way around this....
I'll try and tweak the CMakfiles.txt in /conf and let sbopkg use that, I'm quite curious as to where that will take me.

Mind you: I think the root-cause is the version reported back, not so much digikam...
Comment 22 Cor 2015-07-01 19:53:06 UTC
(In reply to Cor from comment #21)
> (In reply to Gilles Caulier from comment #20)
> > Why do you compile digiKam with extra lib embeded.  it's for libkexiv2.
> > Install this lib from your system as well. option for cmake are described
> > here :
> > 
> > https://projects.kde.org/projects/extragear/graphics/digikam/digikam-
> > software-compilation/repository/revisions/master/entry/README#L129
> > 
> > Gilles Caulier
> 
> Well... it is sort of sbopkg which does determine that for me... and here is
> the funny bit: if I'm using the sbopkg build-command, it doesn't complain
> about exiv2... so apparently they've found a way around this....
> I'll try and tweak the CMakfiles.txt in /conf and let sbopkg use that, I'm
> quite curious as to where that will take me.
> 
> Mind you: I think the root-cause is the version reported back, not so much
> digikam...

Alas, again no joy:

[ 45%] Generating index.cache.bz2
cd /tmp/SBo/digikam-4.11.0/doc-translated/nl && /usr/bin/meinproc4 --check --cache /tmp/SBo/digikam-4.11.0/build/doc-translated/nl/index.cache.bz2 /tmp/SBo/digikam-4.11.0/doc-translated/nl/index.docbook
index.docbook:120: parser error : Entity 'Ivo.de.Klerk' not defined
&Freek.de.Kruijf;&Ivo.de.Klerk; 
                               ^
make[2]: *** [doc-translated/nl/index.cache.bz2] Error 1
make[2]: Leaving directory `/tmp/SBo/digikam-4.11.0/build'
make[1]: *** [doc-translated/nl/CMakeFiles/nl-handbook.dir/all] Error 2
make[1]: Leaving directory `/tmp/SBo/digikam-4.11.0/build'
make: *** [all] Error 2

strange that this happens, don't you think?
Comment 23 caulier.gilles 2015-07-01 19:55:51 UTC
yes problem is know. Some translators of documentation use recent docbook syntax published with last KDE4x. It do not compile with older one.

It's hanbook, not digiKam source code.

Just disable doc compilation with cmake

Gilles Caulier
Comment 24 caulier.gilles 2015-07-02 06:53:56 UTC
Did you turn around the handbook compilation problem ?

Gilles Caulier
Comment 25 caulier.gilles 2015-07-02 08:13:35 UTC
Even if doc do not compile, the original report about broken compilation with libgphoto2 is fixed now.

Gilles Caulier
Comment 26 Cor 2015-07-02 08:48:36 UTC
(In reply to Gilles Caulier from comment #24)
> Did you turn around the handbook compilation problem ?
> 
> Gilles Caulier

Nope, not yet. I'll try again later on this week (weather permitting).