Ref undefined

Hi,

i have a trouble, during step link of compilation

/usr/bin/ld : /tmp/cc003HFL.o : dans la fonction « main » :
main.c:(.text+0x4c) : référence indéfinie vers « fz_new_context_imp »
/usr/bin/ld : main.c:(.text+0x5c) : référence indéfinie vers « fz_register_document_handlers »
/usr/bin/ld : main.c:(.text+0x76) : référence indéfinie vers « fz_open_document »
/usr/bin/ld : main.c:(.text+0x8d) : référence indéfinie vers « fz_count_pages »
/usr/bin/ld : main.c:(.text+0xb2) : référence indéfinie vers « fz_load_page »
/usr/bin/ld : main.c:(.text+0xc9) : référence indéfinie vers « fz_bound_page »
/usr/bin/ld : main.c:(.text+0xe1) : référence indéfinie vers « fz_new_text_page »
/usr/bin/ld : main.c:(.text+0xff) : référence indéfinie vers « fz_new_text_device »
/usr/bin/ld : main.c:(.text+0x123) : référence indéfinie vers « fz_identity »
/usr/bin/ld : main.c:(.text+0x12a) : référence indéfinie vers « fz_identity »
/usr/bin/ld : main.c:(.text+0x138) : référence indéfinie vers « fz_identity »
/usr/bin/ld : main.c:(.text+0x149) : référence indéfinie vers « fz_run_page »
/usr/bin/ld : main.c:(.text+0x16d) : référence indéfinie vers « fz_new_output_with_file »
/usr/bin/ld : main.c:(.text+0x18f) : référence indéfinie vers « fz_print_text_page_as_text »
/usr/bin/ld : main.c:(.text+0x1a2) : référence indéfinie vers « fz_drop_output »
/usr/bin/ld : main.c:(.text+0x1b5) : référence indéfinie vers « fz_drop_device »
/usr/bin/ld : main.c:(.text+0x1cd) : référence indéfinie vers « fz_drop_text_page »
/usr/bin/ld : main.c:(.text+0x1e0) : référence indéfinie vers « fz_drop_page »
/usr/bin/ld : main.c:(.text+0x203) : référence indéfinie vers « fz_drop_document »
/usr/bin/ld : main.c:(.text+0x20f) : référence indéfinie vers « fz_drop_context »
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status

to compile i use “gcc -Wall -Wextra main.c -o main” but i don’t know what add to link to mupdf (or fitz)

for example for gtk i add “pkg-config --cflags --libs gtk4"

thanks

Hi @fanfantasy7 !

Did you follow the steps as outlined here: Installation - PyMuPDF documentation

I don’t use Python but C

I’m not really familiar with the build steps for this - I could direct you to this: Installing - MuPDF 1.26.10 or if you still have issues with building then I would advise asking on our MuPDF Discord channel - we should some core MuPDF engineers there who will be able to troubleshoot I think.

ok, thanks