quadsort icon indicating copy to clipboard operation
quadsort copied to clipboard

how to compile quadsort as a so file

Open nesteiner opened this issue 2 years ago • 2 comments

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 ?

nesteiner avatar Feb 18 '23 04:02 nesteiner

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

melonedo avatar Feb 18 '23 05:02 melonedo

thank you

nesteiner avatar Feb 18 '23 06:02 nesteiner