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

error while loading shared libraries: libjson-c.so.4 #481

Closed
FerenczD opened this issue Mar 19, 2019 · 2 comments
Closed

error while loading shared libraries: libjson-c.so.4 #481

FerenczD opened this issue Mar 19, 2019 · 2 comments

Comments

@FerenczD
Copy link

FerenczD commented Mar 19, 2019

I followed the building instructions of the library and I'm getting the following error when I try to run my JSON application.
error while loading shared libraries: libjson-c.so.4: cannot open shared object file: No such file or directory

This is my make file

CC=gcc

CFLAGS += $(shell pkg-config --cflags json-c)
LDFLAGS += $(shell pkg-config --libs json-c)

OBJ=jsonTest.o

all:  jsonTest

jsonTest: $(OBJ)
	$(CC) $^ -o $@ $(LDFLAGS) $(CFLAGS) 

I checked the path /usr/local/lib and indeed the libjson.so.4 is there.

How can I solve this?

EDIT: I'm running Ubuntu 14.04, and made sure all dependencies were over the version requirements.

@hawicz
Copy link
Member

hawicz commented Mar 20, 2019

1 - Check that the library names actually match. Do you have a libjson.so.4 or libjson-c.so.4?
2 - Try adding -Wl,-R/usr/local/lib to your LDFLAGS

@FerenczD
Copy link
Author

I re installed the program after rebooting the OS and it magically worked. Thanks for the reply tho.

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

No branches or pull requests

2 participants