Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8145217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:35:37+00:00 2026-06-06T13:35:37+00:00

When I try to compile my program on ubuntu using gcc, i get these

  • 0

When I try to compile my program on ubuntu using gcc, i get these errors:

main.c:(.text+0x162): undefined reference to json_parse'
main.c:(.text+0x182): undefined reference to
json_value_free’

However, these functions are included in a file called json.h, which I import in main.c and which I include in my gcc command.

Anyone got a clue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:35:39+00:00Added an answer on June 6, 2026 at 1:35 pm

    You should not compile the “json.h” header. The undefined reference is not a compiler error, it’s a linker error. It means you have either not compiled the file containing json_value_free to your code, or haven’t linked to the library containing it. You should do either action instead of trying to compile the header file itself.

    So, if you have a separate json.c file, you have to compile and link it also to your main.c file. Try (I assume GCC):

    gcc -o myprog main.c json.c
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to compile my program I get these errors: btio.c:19: error: ‘O_RDWR’
I receiving a undefined reference error when try to compile an c++ program. I'm
When I try to compile my program, I get the following error: main.cpp: In
Solved When I try to compile this program i keep getting these errors: (50)
When I try and compile this program, I get errors (included below the code)
I'm try to get things work with Box2D. I can compile my program but
I have written a simple C program using gcc compiler in Ubuntu enviroment. The
If I try to compile a program with #include <pthread.h> in it, I get
I'm using GHC 7.4.1 to try to compile a program that uses Repa. But
I have Simple java program named MainController.java. Wehn I try to compile it from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.