Giter Site home page Giter Site logo

CMake linking problem about backward-cpp HOT 7 CLOSED

bombela avatar bombela commented on August 27, 2024
CMake linking problem

from backward-cpp.

Comments (7)

bombela avatar bombela commented on August 27, 2024

I haven't worked on the cmake side of things. I really don't understand shit about cmake. I think you could try removing the ${BACKWARD_ENABLE}.

from backward-cpp.

bombela avatar bombela commented on August 27, 2024

@edisongustavo maybe you have some insight.

from backward-cpp.

edisongustavo avatar edisongustavo commented on August 27, 2024

(As an aside, the logic located in BackwardConfig.cmake makes it seem like HAS_DW or HAS_BFD could only be true mutually exclusively, was this the intention?)

Not really, if you look at the code in BackwardConfig.cmake you will see that those only represent the detection of each library (libdw and libbfd respectively).

The order that they're applied can be seen on the series of if, elseif:

        if (LIBDW_FOUND)
		LIST(APPEND _BACKWARD_INCLUDE_DIRS ${LIBDW_INCLUDE_DIRS})
		LIST(APPEND BACKWARD_LIBRARIES ${LIBDW_LIBRARIES})
		set(STACK_DETAILS_DW TRUE)
		set(STACK_DETAILS_BFD FALSE)
		set(STACK_DETAILS_BACKTRACE_SYMBOL FALSE)
	elseif(LIBBFD_FOUND)
		LIST(APPEND _BACKWARD_INCLUDE_DIRS ${LIBBFD_INCLUDE_DIRS})
		LIST(APPEND BACKWARD_LIBRARIES ${LIBBFD_LIBRARIES})
		set(STACK_DETAILS_DW FALSE)
		set(STACK_DETAILS_BFD TRUE)
		set(STACK_DETAILS_BACKTRACE_SYMBOL FALSE)
	else()
		set(STACK_DETAILS_DW FALSE)
		set(STACK_DETAILS_BFD FALSE)
		set(STACK_DETAILS_BACKTRACE_SYMBOL TRUE)
	endif()

So in your case what should be done is linking with the libdw library.

I'm curious why you're getting those linking errors. What were the commands you issued? If you used make, could you re-run it with:

VERBOSE=1 make

from backward-cpp.

ljarin avatar ljarin commented on August 27, 2024

Sorry, I had stopped working on the problem I needed this for.
I messed around with it, and adding
target_link_libraries(backward PUBLIC ${BACKWARD_LIBRARIES}) to backward's CMakeLists.txt solved my problem. Not sure I could totally explain why.

from backward-cpp.

ljarin avatar ljarin commented on August 27, 2024

Just kidding, this made my stack traces bad:

         30: backward::SignalHandling sh;
         31: 
      >  32: } // namespace backward

Whatever, I will be satisfied with the old stack traces

from backward-cpp.

bombela avatar bombela commented on August 27, 2024

Else simply do not bother embedding the cmake config. Simply copy backward.hpp and backward.cpp in your project. Add some basic library detection in your build system if you fancy, else just set the list of libraries, set the corresponding #define and be done with it ;)

from backward-cpp.

ljarin avatar ljarin commented on August 27, 2024

Good point; thanks

from backward-cpp.

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.