libunwind
-
Huhu,
kennt sich jmd mit der Lib. aus?
hab mal nen einfaches Prog. geschrieben um mal nen bisschen zu spielen#include <stdio.h> #include <stdlib.h> #include <libunwind.h> int fakultaet (int i) { unw_cursor_t cursor; unw_context_t uc; if(i == 0) { unw_getcontext(&uc); unw_init_local(&cursor, &uc); return 1; } else { unw_getcontext(&uc); unw_init_local(&cursor, &uc); //printf("%d\n",uc); return i*fakultaet(i-1); } } int main () { printf("Hallo ich bin eine Rekusive Funktion\n"); int i; i = 10; printf("%d! = %d\n",i, fakultaet(i)); return 0; }
bekommen folgende fehler
Fakultaet.c:(.text+0x25): undefined reference to
\_Ux86\_64_getcontext' Fakultaet.c:(.text+0x3e): undefined reference to
_Ux86_64_init_local'
Fakultaet.c:(.text+0x54): undefined reference to\_Ux86\_64_getcontext' Fakultaet.c:(.text+0x6d): undefined reference to
_Ux86_64_init_local'bedeutet ja das libunwind iwie nicht richtig rockt oder?
wenn ichs aber nur mit dem include libunwind.h kompiliere gehts, heißt das die lib installiert und gefunden wurden.muss ich das mit iwelchen flags kompilieren oder was mach ich falsch, komm nicht wirklich weiter, bei Beispielcodes kommt das selbe Prob...
mfg nippler
-
got it
gcc Fakultaet.c -lunwind-x86_64 -lunwind