sim590 / dpaste

A simple pastebin for light values (max 64KB) using OpenDHT distributed hash table (with support for encryption).
GNU General Public License v3.0
15 stars 4 forks source link

CMake: Build fails #13

Closed yurivict closed 5 years ago

yurivict commented 5 years ago
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/cipher.h:35:25: error: no template named 'variant' in namespace 'std'
using Parameters = std::variant<GPGParameters, AESParameters>;
                   ~~~~~^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/cipher.h:54:75: error: use of undeclared identifier 'Parameters'
        processPlainText(std::vector<uint8_t> plain_text, std::shared_ptr<Parameters>&& params) = 0;
                                                                          ^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/cipher.h:65:77: error: use of undeclared identifier 'Parameters'
        processCipherText(std::vector<uint8_t> cipher_text, std::shared_ptr<Parameters>&& params) = 0;
                                                                            ^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/cipher.h:75:71: error: use of undeclared identifier 'Parameters'
    static std::shared_ptr<Cipher> get(Scheme scheme, std::shared_ptr<Parameters>&& init_params={});
                                                                      ^
In file included from /usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/gpgcrypto.cpp:30:
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/gpgcrypto.h:48:75: error: use of undeclared identifier 'Parameters'
        processPlainText(std::vector<uint8_t> plain_text, std::shared_ptr<Parameters>&& params) override;
                                                                          ^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/gpgcrypto.h:51:77: error: use of undeclared identifier 'Parameters'
        processCipherText(std::vector<uint8_t> cipher_text, std::shared_ptr<Parameters>&& params) override;
                                                                            ^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/gpgcrypto.cpp:67:93: error: use of undeclared identifier 'Parameters'
std::vector<uint8_t> GPG::processPlainText(std::vector<uint8_t> plain_text, std::shared_ptr<Parameters>&& params)
                                                                                            ^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/gpgcrypto.cpp:88:74: error: use of undeclared identifier 'Parameters'
GPG::processCipherText(std::vector<uint8_t> cipher_text, std::shared_ptr<Parameters>&& params)
                                                                         ^
8 errors generated.
[2/4] /usr/bin/c++  -DPACKAGE_NAME=\"dpaste\" -DVERSION=\"0.3.3\" -I/usr/local/include -I/usr/local/include/curlpp -I/usr/local/include/glibmm-2.4 -I/usr/local/lib/glibmm-2.4/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/sigc++-2.0 -I/usr/local/lib/sigc++-2.0/include -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer  -I/usr/local/include/nlohmann -DBUFFERSIZE=1024 -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer  -I/usr/local/include/nlohmann -DBUFFERSIZE=1024   -std=gnu++14 -MD -MT CMakeFiles/dpaste.dir/src/bin.cpp.o -MF CMakeFiles/dpaste.dir/src/bin.cpp.o.d -o CMakeFiles/dpaste.dir/src/bin.cpp.o -c /usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.cpp
FAILED: CMakeFiles/dpaste.dir/src/bin.cpp.o 
/usr/bin/c++  -DPACKAGE_NAME=\"dpaste\" -DVERSION=\"0.3.3\" -I/usr/local/include -I/usr/local/include/curlpp -I/usr/local/include/glibmm-2.4 -I/usr/local/lib/glibmm-2.4/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/sigc++-2.0 -I/usr/local/lib/sigc++-2.0/include -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer  -I/usr/local/include/nlohmann -DBUFFERSIZE=1024 -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer  -I/usr/local/include/nlohmann -DBUFFERSIZE=1024   -std=gnu++14 -MD -MT CMakeFiles/dpaste.dir/src/bin.cpp.o -MF CMakeFiles/dpaste.dir/src/bin.cpp.o.d -o CMakeFiles/dpaste.dir/src/bin.cpp.o -c /usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.cpp
In file included from /usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.cpp:29:
In file included from /usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.h:34:
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/cipher.h:35:25: error: no template named 'variant' in namespace 'std'
using Parameters = std::variant<GPGParameters, AESParameters>;
                   ~~~~~^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/cipher.h:54:75: error: use of undeclared identifier 'Parameters'
        processPlainText(std::vector<uint8_t> plain_text, std::shared_ptr<Parameters>&& params) = 0;
                                                                          ^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/cipher.h:65:77: error: use of undeclared identifier 'Parameters'
        processCipherText(std::vector<uint8_t> cipher_text, std::shared_ptr<Parameters>&& params) = 0;
                                                                            ^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/cipher.h:75:71: error: use of undeclared identifier 'Parameters'
    static std::shared_ptr<Cipher> get(Scheme scheme, std::shared_ptr<Parameters>&& init_params={});
                                                                      ^
In file included from /usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.cpp:29:
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.h:70:76: error: no member named 'Parameters' in namespace 'dpaste::crypto'
    std::string paste(std::vector<uint8_t>&& data, std::unique_ptr<crypto::Parameters>&& params);
                                                                   ~~~~~~~~^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.h:71:81: error: no member named 'Parameters' in namespace 'dpaste::crypto'
    std::string paste(std::stringstream&& input_stream, std::unique_ptr<crypto::Parameters>&& params) {
                                                                        ~~~~~~~~^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.h:73:54: error: no member named 'Parameters' in namespace 'dpaste::crypto'
                std::forward<std::unique_ptr<crypto::Parameters>>(params));
                                             ~~~~~~~~^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.h:73:75: error: expected a type
                std::forward<std::unique_ptr<crypto::Parameters>>(params));
                                                                          ^
/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.h:74:6: error: expected '}'
    }
     ^

Revision 0.3.3-55-gf27df83. FreeBSD 11.2 amd64

sim590 commented 5 years ago

@yurivict Are you using c++17 compliant compiler? Structure std::variant is part of the c++17 standard, hence the error if I'm not mistaken.

yurivict commented 5 years ago

@sim590 It uses -std=gnu++14, not -std=c++17 that is needed to enable c++17 features. Additionally, the config.h header is missing:

/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.h:31:10: fatal error: 'config.h' file not found
#include "config.h"
         ^~~~~~~~~~
1 error generated.

So it is currently broken.

sim590 commented 5 years ago

@sim590 It uses -std=gnu++14, not -std=c++17 that is needed to enable c++17 features.

The check is missing in CMake, but is not missing in Autotools. Therefore, you're using CMake to build. Please, include those information when you're supplying a bug. I have to say that I may have ignored CMake for a bit when doing my last changes. That is wrong and I'll fix it.

Additionally, the config.h header is missing:

/usr/ports/misc/dpaste/work/dpaste-0.3.3-55-gf27df83/src/bin.h:31:10: fatal error: 'config.h' file not found
#include "config.h"
         ^~~~~~~~~~
1 error generated.

So it is currently broken.

I see that it's missing a

#ifdef HAVE_CONFIG_H
#endif

Again, another CMake related issue. I'm on it.

sim590 commented 5 years ago

@yurivict Can you try to build following changes in #14 (not yet merged) and confirm that the issue is fixed.

Thanks.

sim590 commented 5 years ago

Actually, you can't build it if #11 is not resolved also. If you can try that by manually including the json.hpp file, then we'll know if this issue is resolved.

sim590 commented 5 years ago

I have found a fix for #11 and I am integrating it now into master branch as well as the fix for this PR that I have tested on my machine. Since I have not received any news on this issue, I will consider that #14 fixes this issue, so I can close it. Feel free to try master branch again and reopen.