Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during compilation #628

Open
2 tasks done
Sachin-Bhat opened this issue Feb 11, 2024 · 8 comments
Open
2 tasks done

Error during compilation #628

Sachin-Bhat opened this issue Feb 11, 2024 · 8 comments
Labels
bug Something isn't working contributions welcome Users are encouraged to contribute needs verification Description of the issue needs to be verified by the team

Comments

@Sachin-Bhat
Copy link

Pre-submit checks

  • I checked for similar issues beforehand, but could not find any, not even closed ones. I could not add my bug report to any existing issue.
  • I am going to take the time to to fill in all the required details. I know that the bug report will be dismissed otherwise.

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<uint8_t> 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<uint8_t> 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<uint8_t> 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<uint8_t> 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<uint8_t> 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<uint8_t> 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<uint8_t> 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<uint8_t> 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<uint8_t> 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<uint8_t> 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

@Sachin-Bhat Sachin-Bhat added bug Something isn't working needs verification Description of the issue needs to be verified by the team labels Feb 11, 2024
@rasmussibbern88
Copy link

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
Copy link
Owner

PRs welcome.

@TheAssassin TheAssassin added the contributions welcome Users are encouraged to contribute label Apr 25, 2024
@ricperry
Copy link

ricperry commented May 4, 2024

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
Copy link

ricperry commented May 4, 2024

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
Copy link

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
Copy link

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

@TheAssassin
Copy link
Owner

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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working contributions welcome Users are encouraged to contribute needs verification Description of the issue needs to be verified by the team
Projects
None yet
Development

No branches or pull requests

7 participants