hacker / iii

iii - Eye-Fi card manager daemon open source implementation
http://kin.klever.net/iii/
MIT License
36 stars 6 forks source link

compilation error with recent gcc #6

Closed ctr49 closed 3 years ago

ctr49 commented 3 years ago

Trying to compile on a recent Focal system I'm facing the following compile error:

g++ -DHAVE_CONFIG_H -I.. -I. -I. -DWITH_IPV6 -DWITH_NO_IPV6_V6ONLY -DWITH_DOM     -DNDEBUG -DEYEKIN_CONF_DIR=\"/usr/local/etc/iii\" -DWITH_PURE_VIRTUAL   -g -O2 -MT iiid.o -MD -MP -MF .deps/iiid.Tpo -c -o iiid.o iiid.cc
iiid.cc: In function ‘int main(int, char**)’:
iiid.cc:128:17: error: invalid cast to abstract class type ‘eyefiworker’
     eyefiworker().run(port);
                 ^
In file included from iiid.cc:9:0:
eyefiworker.h:14:7: note:   because the following virtual functions are pure within ‘eyefiworker’:
 class eyefiworker : public eyefiService {
       ^~~~~~~~~~~
In file included from eyefiworker.h:7:0,
                 from iiid.cc:9:
soapeyefiService.h:94:21: note:     virtual int eyefiService::StartSession(const string&, const string&, int, long int, rns__StartSessionResponse&)
         virtual int StartSession(const std::string& macaddress, const std::string& cnonce, int transfermode, long transfermodetimestamp, struct rns__StartSessionResponse &r) SOAP_PURE_VIRTUAL;
                     ^~~~~~~~~~~~
soapeyefiService.h:96:21: note:     virtual int eyefiService::GetPhotoStatus(const string&, const string&, const string&, long int, const string&, int, rns__GetPhotoStatusResponse&)
         virtual int GetPhotoStatus(const std::string& credential, const std::string& macaddress, const std::string& filename, long filesize, const std::string& filesignature, int flags, struct rns__GetPhotoStatusResponse &r) SOAP_PURE_VIRTUAL;
                     ^~~~~~~~~~~~~~
soapeyefiService.h:98:21: note:     virtual int eyefiService::MarkLastPhotoInRoll(const string&, int, rns__MarkLastPhotoInRollResponse&)
         virtual int MarkLastPhotoInRoll(const std::string& macaddress, int mergedelta, struct rns__MarkLastPhotoInRollResponse &r) SOAP_PURE_VIRTUAL;
                     ^~~~~~~~~~~~~~~~~~~
soapeyefiService.h:100:21: note:    virtual int eyefiService::UploadPhoto(int, const string&, const string&, long int, const string&, const string&, int, rns__UploadPhotoResponse&)
         virtual int UploadPhoto(int fileid, const std::string& macaddress, const std::string& filename, long filesize, const std::string& filesignature, const std::string& encryption, int flags, struct rns__UploadPhotoResponse &r) SOAP_PURE_VIRTUAL;
                     ^~~~~~~~~~~
Makefile:452: recipe for target 'iiid.o' failed
make[2]: *** [iiid.o] Error 1

Not sure if the notes really make sense here as the virtual functions are intentionally pure (WITH_PURE_VIRTUAL) aren't they?

hacker commented 3 years ago

They do, the pure virtuals are in soapeyefiService.h and in eyefiworker.h they're supposed to be overridden. And they were, but it seems like the newer gsoap changed the signature, so they don't override them anymore.

I don't currently know where my eyefi card is, so I can't test if it actually works, but I applied a few fixes to make it build in focal, you can try getting fixes/focal branch, maybe it will do you some good.

ctr49 commented 3 years ago

Thanks a lot! This compiles and runs just fine.

hacker commented 3 years ago

Ah, cool, funny you should mention containers (elsewhere) — I used docker to test focal build, maybe I should just provide a Dockerfile (or, eventually, images) using something more lightweight than ubuntu:focal, possibly alpine

Anyway, glad this is resolved!

ctr49 commented 3 years ago

Yes that was also my goal, just reported this with focal as example as it is a little more common than Alpine. But the fixes you made for focal also work perfectly fine with alpine:latest, see https://github.com/ctr49/iii/blob/master/aux/Dockerfile.multistage.alpine

hacker commented 3 years ago

Ah cool, that's more or less what I was going to do, except for probably not going for /opt, but yes. I just need to find my card to make sure what I do works :-)

And I had no idea there was so much development of iii going on :)