Error “ld: image not discovered for structure x86_64” | by Muhammad Muizzsuddin

0
13

On this Article we offer you detailed Data on Error “ld: image not discovered for structure x86_64” | by Muhammad Muizzsuddin
:

Muhammad Muizzsuddin

This error point out that your code, normally from C household language, has imported a header however has not but been linked to it’s implementation.

For instance there’s a header SimpleMath.h

// SimpleMath.hint divide_by_zero(int i);

Then we import it in essential.c

// essential.c#embrace "SimpleMath.h"int essential() {
int consequence = divide_by_zero(100);
printf("Result's %d", consequence);
}

Once we compile it with out implementation of SimpleMath.h then we we’ll get ld: image not ... (bla-bla-bla)

The answer is to compile it with SimpleMath.c

clang essential.c SimpleMath.c -o program

Or to hyperlink it with system implementation if there any.

clang essential.c -LSimpleMath -o program

Fastened? Not but. You’ll wish to learn extra about C language then.

Oh sure, our SimpleMath.c implementation is

// SimpleMath.c#embrace "SimpleMath.h"int divide_by_zero(int i) {
exit(1);
}

Completely satisfied fixing error!

#Error #image #structure #x8664 #Muhammad #Muizzsuddin