Git Product home page Git Product logo

Comments (4)

sarbjit-longia avatar sarbjit-longia commented on June 12, 2024

Did you happen to resolve this issue. I am kind of stuck in same kind of issue.

from jwt-cpp.

tkaplan avatar tkaplan commented on June 12, 2024

@sarbjit-longia I just switched to a different lib cpp-jwt which is a header only lib.

from jwt-cpp.

sarbjit-longia avatar sarbjit-longia commented on June 12, 2024

ohhh :(

from jwt-cpp.

pokowaka avatar pokowaka commented on June 12, 2024

The reason this happens is due to incorrect specification if link order. The correct line in the makefile should be:

jwt_test: jwt.o
g++ -std=c++11 -Wall -L ../src -I /usr/include -I ../../src/include/ -I /usr/local/include jwt/jwt_test.cpp jwt/jwt.o -o jwt/jwt_test.o -ljwt -lssl -lcrypto

The following question on stackoverflow explains it in detail:

https://stackoverflow.com/questions/45135/why-does-the-order-in-which-libraries-are-linked-sometimes-cause-errors-in-gcc

The GNU ld linker is a so-called smart linker. It will keep track of the functions used by preceding static libraries, permanently tossing out those functions that are not used from its lookup tables. The result is that if you link a static library too early, then the functions in that library are no longer available to static libraries later on the link line.

Since you included the libraries in the beginning all the required functions are tossed out of the lookup table, causing the strange linker issues.

from jwt-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.