Code Monkey home page Code Monkey logo

Comments (13)

GeorgeIoak avatar GeorgeIoak commented on May 14, 2024 2

I deleted the cloned directory and started over. I did have capstone downloaded, compiled and installed and I ran CC=gcc-10 CXX=g++-10 cmake .. and this time it compiled successfully so I'm not sure if it was the capstone, the change in cmake, or just user error.

from imhex.

Matir avatar Matir commented on May 14, 2024 1

If you change CMakeLists.txt like so, you should be able to build:

target_link_libraries(ImHex libglfw.so libmagic.so libcrypto.so libdl.so libcapstone.so ${LLVM_LIBRARY_DIRS}/libLLVMDemangle.a ${Python_LIBRARIES} nlohmann_json::nlohmann_json)

I haven't tested all the functionality yet, but it compiles and executes.

from imhex.

Matir avatar Matir commented on May 14, 2024 1

Ubuntu 20.10 has capstone 4.0.1 which also fails.

Except, it doesn't really. For reasons I can't figure out, Debian and Ubuntu have packaged 3.0.5 and called it 4.0.1: https://packages.ubuntu.com/groovy/libcapstone3 shows 4.0.1+really+3.0.5-2 as the version string. I've never seen anything like it, but if you look at the source, it really is a 3.0.5 build.

from imhex.

WerWolv avatar WerWolv commented on May 14, 2024

Hi!
It's possible that Ubuntu has an older version of capstone than the one I'm using. It builds fine with Capstone 4.0.2 on Arch linux as well as on mingw. I'll add the version requirement to the cmake script

from imhex.

popey avatar popey commented on May 14, 2024

Thanks for the quick reply! Yes, Ubuntu has capstone 3.x, so I guess I'll try building a newer one from source to fulfil that. Cheers!

from imhex.

xorhex avatar xorhex commented on May 14, 2024

Had the same issues on Ubuntu. Posting here so hopefully helps other folks compiling on Ubuntu.

  • Modified the CMakeLists.txt Python line to find_package(Python 3.8 COMPONENTS Interpreter Development)
  • Built and installed Capstone 4.0.2 from source
  • Called cmake: CC="gcc-10" CXX="g++-10" cmake .. to fix the fatal error: concepts: No such file or directory 6 | #include <concepts>

Now stuck at /usr/bin/ld: cannot find -lLLVMDemangle. llvm is installed but guessing I'm not using a new enough version.

[ 88%] Building CXX object CMakeFiles/ImHex.dir/libs/ImGui/source/imgui_demo.cpp.o
[ 91%] Building CXX object CMakeFiles/ImHex.dir/libs/ImGui/source/imgui_impl_opengl3.cpp.o
[ 94%] Building CXX object CMakeFiles/ImHex.dir/libs/ImGui/source/ImGuiFileBrowser.cpp.o
[ 97%] Building CXX object CMakeFiles/ImHex.dir/libs/ImGui/source/TextEditor.cpp.o
In file included from <redated>/opt/ImHex/source/lang/parser.cpp:3:
<redated>/opt/ImHex/include/helpers/utils.hpp: In instantiation of ‘std::string hex::format(const string&, Args ...) [with Args = {}; std::string = std::__cxx11::basic_string<char>]’:
<redated>/opt/ImHex/source/lang/parser.cpp:300:87:   required from here
<redated>/opt/ImHex/include/helpers/utils.hpp:25:32: warning: format not a string literal and no format arguments [-Wformat-security]
   25 |         ssize_t size = snprintf( nullptr, 0, format.c_str(), args ... );
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<redated>/opt/ImHex/include/helpers/utils.hpp:31:17: warning: format not a string literal and no format arguments [-Wformat-security]
   31 |         snprintf(buffer.data(), size + 1, format.c_str(), args ...);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[100%] Linking CXX executable ImHex
/usr/bin/ld: cannot find -lLLVMDemangle
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/ImHex.dir/build.make:595: ImHex] Error 1
make[1]: *** [CMakeFiles/Makefile2:77: CMakeFiles/ImHex.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

from imhex.

mbitsnbites avatar mbitsnbites commented on May 14, 2024

It would be nice if this could build with out-of-the-box stuff on Ubuntu 20.04 (as it's a popular LTS), though it requires GCC 10 (Ubuntu has GCC 9) and I had to hack the CMake file to require Python 3.8.5 instead of 3.8.6. Still haven't pulled off a full build. Will keep trying.

from imhex.

Matir avatar Matir commented on May 14, 2024

@xorhex Neither Debian nor Ubuntu seems to ship LLVMDemangle as a shared library, only a static library. I'm trying to figure out a way to link against the static version instead.

from imhex.

psifertex avatar psifertex commented on May 14, 2024

Ubuntu 20.10 has capstone 4.0.1 which also fails.

from imhex.

mbitsnbites avatar mbitsnbites commented on May 14, 2024

When my projects have dependencies on likely-to-not-be-present packages, I usually make the related functionality optional in the project (e.g. if LLVM demangling is not available, disable demangling via a define from CMake). Could perhaps be a possibility for some of the deps.

from imhex.

krionical avatar krionical commented on May 14, 2024

So is this issue fixed? I'm having the problem mentioned above on Ubuntu 20.10--the weird updated but not really updated deal.

from imhex.

psifertex avatar psifertex commented on May 14, 2024

yes, builds fine for me on a 20.10 box.

from imhex.

GeorgeIoak avatar GeorgeIoak commented on May 14, 2024

I just tried on a fresh install of 20.04.1 and following this thread I'm still getting the "concepts error:

george@Ubuntu-20:~/ImHex/build$ make clean
george@Ubuntu-20:~/ImHex/build$ CC=gcc-10 CXX=g++-10 cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/george/ImHex/build
george@Ubuntu-20:~/ImHex/build$ make -j 2
[  5%] Building CXX object CMakeFiles/ImHex.dir/source/window.cpp.o
[  5%] Building CXX object CMakeFiles/ImHex.dir/source/main.cpp.o
In file included from /home/george/ImHex/source/main.cpp:1:
/home/george/ImHex/include/window.hpp:3:10: fatal error: concepts: No such file or directory
    3 | #include <concepts>
      |          ^~~~~~~~~~
compilation terminated.
In file included from /home/george/ImHex/source/window.cpp:1:
/home/george/ImHex/include/window.hpp:3:10: fatal error: concepts: No such file or directory
    3 | #include <concepts>
      |          ^~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/ImHex.dir/build.make:63: CMakeFiles/ImHex.dir/source/main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/ImHex.dir/build.make:76: CMakeFiles/ImHex.dir/source/window.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:77: CMakeFiles/ImHex.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

from imhex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.