J'ai créé le fichier exe (d.out) en compilant un autre programme. Et la fonction nlist renvoie toujours -1. fopen func renvoie! = null. S'il importe compiler mon prog comme ça gcc -I/usr/include main.c -L/usr/lib/i386-linux-gnu/pkgconfig -lbsd
La fonction nlist renvoie toujours -1
#include <string.h>
#include <bsd/nlist.h>
#include <stdio.h>
#include <stdlib.h>
int test(){
struct nlist nl[2];
memset(&nl, 0, sizeof(nl));
return nlist("d.out", nl);
// return nl[0].n_value;
}
int main(){
printf("%d \n", test());
}
il existe bien sûr. J'ai essayé de l'ouvrir et ça revient! = NULL. –
@ArseniyErmilov Et bien sûr les x bits ne manquent pas? Et 'fichier d.out' dit que c'est un exécutable? – Jens
'd.out: Exécutable LSB 32 bits ELF ...' '-rwxrwxrwx 1 nom d'utilisateur ...' –