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

fix: include headers necessary to build with llvm #2181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

heather7283
Copy link

Problem description

ImHex fails to build on llvm-based system:

Error 1
In file included from /home/heather/downloads/ImHex/lib/libimhex/source/helpers/http_requests.cpp:1:
In file included from /home/heather/downloads/ImHex/lib/libimhex/include/hex/helpers/http_requests.hpp:158:
/home/heather/downloads/ImHex/lib/libimhex/include/hex/helpers/http_requests_native.hpp:82:29: error: expected ';' after expression
   82 |             std::scoped_lock lock(m_transmissionMutex);
      |                             ^
      |                             ;
/home/heather/downloads/ImHex/lib/libimhex/include/hex/helpers/http_requests_native.hpp:82:18: error: no member named 'scoped_lock' in namespace 'std'; did you mean 'adopt_lock'?
   82 |             std::scoped_lock lock(m_transmissionMutex);
      |             ~~~~~^~~~~~~~~~~
      |                  adopt_lock
/usr/include/c++/v1/__mutex/tag_types.h:35:31: note: 'adopt_lock' declared here
   35 | inline constexpr adopt_lock_t adopt_lock   = adopt_lock_t();
      |                               ^
In file included from /home/heather/downloads/ImHex/lib/libimhex/source/helpers/http_requests.cpp:1:
In file included from /home/heather/downloads/ImHex/lib/libimhex/include/hex/helpers/http_requests.hpp:158:
/home/heather/downloads/ImHex/lib/libimhex/include/hex/helpers/http_requests_native.hpp:82:30: error: use of undeclared identifier 'lock'
   82 |             std::scoped_lock lock(m_transmissionMutex);
      |                              ^
[ 67%] Building CXX object lib/libimhex/CMakeFiles/libimhex.dir/source/helpers/logger.cpp.o
3 errors generated.
gmake[2]: *** [lib/libimhex/CMakeFiles/libimhex.dir/build.make:373: lib/libimhex/CMakeFiles/libimhex.dir/source/helpers/http_requests.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/heather/downloads/ImHex/lib/libimhex/source/helpers/http_requests_native.cpp:3:
In file included from /home/heather/downloads/ImHex/lib/libimhex/include/hex/helpers/http_requests.hpp:158:
/home/heather/downloads/ImHex/lib/libimhex/include/hex/helpers/http_requests_native.hpp:82:29: error: expected ';' after expression
   82 |             std::scoped_lock lock(m_transmissionMutex);
      |                             ^
      |                             ;
/home/heather/downloads/ImHex/lib/libimhex/include/hex/helpers/http_requests_native.hpp:82:18: error: no member named 'scoped_lock' in namespace 'std'; did you mean 'adopt_lock'?
   82 |             std::scoped_lock lock(m_transmissionMutex);
      |             ~~~~~^~~~~~~~~~~
      |                  adopt_lock
/usr/include/c++/v1/__mutex/tag_types.h:35:31: note: 'adopt_lock' declared here
   35 | inline constexpr adopt_lock_t adopt_lock   = adopt_lock_t();
      |                               ^
In file included from /home/heather/downloads/ImHex/lib/libimhex/source/helpers/http_requests_native.cpp:3:
In file included from /home/heather/downloads/ImHex/lib/libimhex/include/hex/helpers/http_requests.hpp:158:
/home/heather/downloads/ImHex/lib/libimhex/include/hex/helpers/http_requests_native.hpp:82:30: error: use of undeclared identifier 'lock'
   82 |             std::scoped_lock lock(m_transmissionMutex);
      |                              ^
/home/heather/downloads/ImHex/lib/libimhex/include/hex/helpers/http_requests_native.hpp:82:13: error: expression result unused [-Werror,-Wunused-value]
   82 |             std::scoped_lock lock(m_transmissionMutex);
      |             ^~~~~~~~~~~~~~~~
/home/heather/downloads/ImHex/lib/libimhex/source/helpers/http_requests_native.cpp:92:26: note: in instantiation of function template specialization 'hex::HttpRequest::executeImpl<std::vector<unsigned char>>' requested here
   92 |             return this->executeImpl<std::vector<u8>>(response);
      |                          ^
4 errors generated.
gmake[2]: *** [lib/libimhex/CMakeFiles/libimhex.dir/build.make:387: lib/libimhex/CMakeFiles/libimhex.dir/source/helpers/http_requests_native.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:3284: lib/libimhex/CMakeFiles/libimhex.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
Error 2
/home/heather/downloads/ImHex/main/gui/source/messaging/linux.cpp:32:25: error: no member named 'write' in the global namespace
   32 |         std::ignore = ::write(fifo, data, dataSize);
      |                       ~~^
/home/heather/downloads/ImHex/main/gui/source/messaging/linux.cpp:33:9: error: use of undeclared identifier 'close'
   33 |         close(fifo);
      |         ^
/home/heather/downloads/ImHex/main/gui/source/messaging/linux.cpp:37:9: error: use of undeclared identifier 'unlink'
   37 |         unlink(CommunicationPipePath);
      |         ^
/home/heather/downloads/ImHex/main/gui/source/messaging/linux.cpp:47:32: error: no member named 'read' in the global namespace
   47 |                 int result = ::read(fifo, buffer.data(), buffer.size());
      |                              ~~^
/home/heather/downloads/ImHex/main/gui/source/messaging/linux.cpp:63:13: error: use of undeclared identifier 'close'
   63 |             close(fifo);
      |             ^

Implementation description

Included necessary headers

Screenshots

None

Additional things

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant