Hi, I'm trying to create an object file (.o) using the "libelf" library. Below appear the full source code.
Does any body know why the "elf_begin" statement return NULL? #include < stdio.h> #include <stdlib.h> #include <libelf.h> int main() { int FileDes; Elf *pElf = elf_begin(FileDes, ELF_C_WRITE, NULL); // 3rd argument is ignored for "ELF_C_WRITE" if (!pElf) printf("elf_begin: error\n"); Elf32_Ehdr *pEhdr = elf32_newehdr(pElf); if (!pEhdr) printf("elf32_newehdr: error\n"); elf_end(pElf); // Free the memory free(pElf); free(pEhdr); return 0; } Thanx, Robe. _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"