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

how to compile quadsort as a so file #18

Open
nesteiner opened this issue Feb 18, 2023 · 2 comments
Open

how to compile quadsort as a so file #18

nesteiner opened this issue Feb 18, 2023 · 2 comments

Comments

@nesteiner
Copy link

I have tried using this make

quadsort.o: quadsort.c quadsort.h
	gcc -c -Wall -Werror -fPIC quadsort.h
	gcc -shared -o libquadsort.so quadsort.o

but failed getting error
image

can you help me out ?

@melonedo
Copy link

You need to create a stub to include string.h.

// lib.c
#include <string.h>
#include "quadsort.h"

Then

gcc -fpic -c lib.c -o lib.o
gcc -shared lib.o -o libquadsort.so

@nesteiner
Copy link
Author

thank you

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