TheAssassin / AppImageLauncher

Helper application for Linux distributions serving as a kind of "entry point" for running and integrating AppImages
https://assassinate-you.net/tags/appimagelauncher/
MIT License
5.69k stars 265 forks source link

Error during compilation #628

Open Sachin-Bhat opened 9 months ago

Sachin-Bhat commented 9 months ago

Pre-submit checks

Describe the bug

Get the following error while compiling, particularly running make:

In file included from /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.cpp:9: /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:19:25: error: 'uint8_t' was not declared in this scope 19 std::vector md5(std::istream& data); ^~~ /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:1:1: note: 'uint8_t' is defined in header ''; did you forget to '#include '? +++ +#include 1 #pragma once /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:19:32: error: template argument 1 is invalid 19 std::vector md5(std::istream& data); ^ /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:19:32: error: template argument 2 is invalid /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:26:25: error: 'uint8_t' was not declared in this scope 26 std::vector md5(const std::string& data); ^~~ /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:26:25: note: 'uint8_t' is defined in header ''; did you forget to '#include '? /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:26:32: error: template argument 1 is invalid 26 std::vector md5(const std::string& data); ^ /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:26:32: error: template argument 2 is invalid /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:33:43: error: 'uint8_t' was not declared in this scope 33 std::string toHex(std::vector digest); ^~~ /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:33:43: note: 'uint8_t' is defined in header ''; did you forget to '#include '? /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:33:50: error: template argument 1 is invalid 33 std::string toHex(std::vector digest); ^ /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:33:50: error: template argument 2 is invalid /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.cpp:19:34: error: ambiguating new declaration of 'std::vector appimage::utils::hashlib::md5(std::istream&)' 19 std::vector md5(std::istream& data) { ^~~ /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:19:34: note: old declaration 'int appimage::utils::hashlib::md5(std::istream&)' 19 std::vector md5(std::istream& data); ^~~ /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.cpp:42:34: error: ambiguating new declaration of 'std::vector appimage::utils::hashlib::md5(const std::string&)' 42 std::vector md5(const std::string& data) { ^~~ /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:26:34: note: old declaration 'int appimage::utils::hashlib::md5(const std::string&)' 26 std::vector md5(const std::string& data); ^~~ /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.cpp: In function 'std::vector appimage::utils::hashlib::md5(const std::string&)': /home/sachin/Downloads/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.cpp:44:27: error: could not convert 'appimage::utils::hashlib::md5(ss.std::__cxx11::basic_stringstream::.std::basic_iostream::)' from 'int' to 'std::vector' 44 return md5(ss); ~^~
int

make[2]: [lib/libappimage/src/libappimage/utils/CMakeFiles/appimage_utils.dir/build.make:104: lib/libappimage/src/libappimage/utils/CMakeFiles/appimage_utils.dir/hashlib.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:2462: lib/libappimage/src/libappimage/utils/CMakeFiles/appimage_utils.dir/all] Error 2 make: *** [Makefile:156: all] Error 2

Expected behavior

A smmooth compilation

Steps to reproduce the issue

  1. Clone the repository with the stable branch
  2. Follow BUILD.md
  3. At the process of make libappimage libappimageupdate libappimageupdate-qt and at the make command you should see this error
  4. The sudo make install also gives the same error

Screenshots

No response

Distribution and desktop environment

Distribution: Void Linux Kernel: 6.6.16_1 DE: Xfce 4.18

Installed AppImageLauncher version

Latest Release Build v2.2.0 Sep 29, 2020 commit: 0f91801

List of AppImages you tried

No response

Additional context

No response

rasmussibbern88 commented 8 months ago

I got a slightly different error message on Void Linux, that suggested adding cstdint

modifying AppImageLauncher-2.2.0/lib/libappimage/src/libappimage/utils/hashlib.cpp in the build process to include cstdint fixed the compilation issues for me

#include <cstdint>
TheAssassin commented 7 months ago

PRs welcome.

ricperry commented 6 months ago

I have a similar error when attempting to build this on Ubuntu 24.04 LTS:

In file included from ~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.cpp:9:
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:19:25: error: ‘uint8_t’ was not declared in this scope
   19 |             std::vector<uint8_t> md5(std::istream& data);
      |                         ^~~~~~~
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:1:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
  +++ |+#include <cstdint>
    1 | #pragma once
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:19:32: error: template argument 1 is invalid
   19 |             std::vector<uint8_t> md5(std::istream& data);
      |                                ^
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:19:32: error: template argument 2 is invalid
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:26:25: error: ‘uint8_t’ was not declared in this scope
   26 |             std::vector<uint8_t> md5(const std::string& data);
      |                         ^~~~~~~
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:26:25: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:26:32: error: template argument 1 is invalid
   26 |             std::vector<uint8_t> md5(const std::string& data);
      |                                ^
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:26:32: error: template argument 2 is invalid
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:33:43: error: ‘uint8_t’ was not declared in this scope
   33 |             std::string toHex(std::vector<uint8_t> digest);
      |                                           ^~~~~~~
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:33:43: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:33:50: error: template argument 1 is invalid
   33 |             std::string toHex(std::vector<uint8_t> digest);
      |                                                  ^
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:33:50: error: template argument 2 is invalid
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.cpp:19:34: error: ambiguating new declaration of ‘std::vector<unsigned char> appimage::utils::hashlib::md5(std::istream&)’
   19 |             std::vector<uint8_t> md5(std::istream& data) {
      |                                  ^~~
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:19:34: note: old declaration ‘int appimage::utils::hashlib::md5(std::istream&)’
   19 |             std::vector<uint8_t> md5(std::istream& data);
      |                                  ^~~
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.cpp:42:34: error: ambiguating new declaration of ‘std::vector<unsigned char> appimage::utils::hashlib::md5(const std::string&)’
   42 |             std::vector<uint8_t> md5(const std::string& data) {
      |                                  ^~~
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.h:26:34: note: old declaration ‘int appimage::utils::hashlib::md5(const std::string&)’
   26 |             std::vector<uint8_t> md5(const std::string& data);
      |                                  ^~~
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.cpp: In function ‘std::vector<unsigned char> appimage::utils::hashlib::md5(const std::string&)’:
~/AppImageLauncher/lib/libappimage/src/libappimage/utils/hashlib.cpp:44:27: error: could not convert ‘appimage::utils::hashlib::md5(ss.std::__cxx11::basic_stringstream<char>::<anonymous>.std::basic_iostream<char>::<anonymous>)’ from ‘int’ to ‘std::vector<unsigned char>’
   44 |                 return md5(ss);
      |                        ~~~^~~~
      |                           |
      |                           int
make[2]: *** [lib/libappimage/src/libappimage/utils/CMakeFiles/appimage_utils.dir/build.make:104: lib/libappimage/src/libappimage/utils/CMakeFiles/appimage_utils.dir/hashlib.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2084: lib/libappimage/src/libappimage/utils/CMakeFiles/appimage_utils.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
ricperry commented 6 months ago

I added the line #include <cstdint> in the system includes at the top of hashlib.cpp, but now I'm getting this error:

[ 49%] Linking CXX shared library libappimage.so
/usr/bin/ld: desktop_integration/CMakeFiles/appimage_desktop_integration.dir/integrator/Integrator.cpp.o:(.rodata+0xa0): multiple definition of `_ZGRN15StringSanitizer13asciiLetters_E_'; utils/CMakeFiles/appimage_utils.dir/StringSanitizer.cpp.o:(.rodata+0x20): first defined here
/usr/bin/ld: desktop_integration/CMakeFiles/appimage_desktop_integration.dir/integrator/Integrator.cpp.o:(.rodata+0xd8): multiple definition of `_ZGRN15StringSanitizer12asciiDigits_E_'; utils/CMakeFiles/appimage_utils.dir/StringSanitizer.cpp.o:(.rodata+0x58): first defined here
/usr/bin/ld: desktop_integration/CMakeFiles/appimage_desktop_integration.dir/integrator/Integrator.cpp.o:(.rodata+0xe2): multiple definition of `_ZGRN15StringSanitizer14pathSafeChars_E_'; utils/CMakeFiles/appimage_utils.dir/StringSanitizer.cpp.o:(.rodata+0x62): first defined here
/usr/bin/ld: desktop_integration/CMakeFiles/appimage_desktop_integration.dir/integrator/DesktopEntryEditor.cpp.o:(.rodata+0x20): multiple definition of `_ZGRN15StringSanitizer13asciiLetters_E_'; utils/CMakeFiles/appimage_utils.dir/StringSanitizer.cpp.o:(.rodata+0x20): first defined here
/usr/bin/ld: desktop_integration/CMakeFiles/appimage_desktop_integration.dir/integrator/DesktopEntryEditor.cpp.o:(.rodata+0x58): multiple definition of `_ZGRN15StringSanitizer12asciiDigits_E_'; utils/CMakeFiles/appimage_utils.dir/StringSanitizer.cpp.o:(.rodata+0x58): first defined here
/usr/bin/ld: desktop_integration/CMakeFiles/appimage_desktop_integration.dir/integrator/DesktopEntryEditor.cpp.o:(.rodata+0x62): multiple definition of `_ZGRN15StringSanitizer14pathSafeChars_E_'; utils/CMakeFiles/appimage_utils.dir/StringSanitizer.cpp.o:(.rodata+0x62): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libappimage/src/libappimage/CMakeFiles/libappimage.dir/build.make:194: lib/libappimage/src/libappimage/libappimage.so.1.0.3] Error 1
make[1]: *** [CMakeFiles/Makefile2:2028: lib/libappimage/src/libappimage/CMakeFiles/libappimage.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Anonymous941 commented 6 months ago

I added the line #include <cstdint> in the system includes at the top of hashlib.cpp, but now I'm getting this error:

Same issue here, #147 appears to be related

robinhood2014 commented 2 months ago

I'm getting the same errors trying to build it on Gentoo.

TheAssassin commented 2 months ago

Probably because #662 has not been merged yet. Since #662 does not link to an issue that it really tries to resolve, would you mind building that branch and checking whether it fixes your problem? I need a successful test before I consider merging that PR.

trinitronx commented 1 month ago

Since #662 does not link to an issue that it really tries to resolve,

@TheAssassin: I initially put that info in the commit message for 9768162. Also, just commented here to clarify. Sorry for the confusion!