Advertisement
Guest User

gcc problem

a guest
Jun 30th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. This works:
  2. gcc with_main.c -o dynamically_linked -L. -l v2lin -I../../lib -pthread -lrt -ldl
  3.  
  4. This does not:
  5. The compile (-c) works:
  6. gcc -I../../lib -g -D _USR_SYS_INIT_KILL -Wall -Wno-format -Wno-unused-label -Wno-unused-variable -fmessage-length=0 -fPIC -DDEBUG -I../../lib -c -o with_main.o with_main.c
  7.  
  8. Linking does not:
  9. gcc -L . -l v2lin -pthread -ldl -lrt with_main.o -o with_main
  10. with_main.o: In function `main':
  11. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `trace'
  12. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `gettid'
  13. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `tid'
  14. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `gettid'
  15. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `tid'
  16. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `my_task'
  17. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `my_task'
  18. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `my_task'
  19. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `tid'
  20. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `trace_time'
  21. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `trace_fn'
  22. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `trace_fn'
  23. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:33: undefined reference to `trace_fn'
  24. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:34: undefined reference to `v2lin_init'
  25. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `trace'
  26. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `gettid'
  27. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `tid'
  28. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `gettid'
  29. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `tid'
  30. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `my_task'
  31. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `my_task'
  32. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `my_task'
  33. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `tid'
  34. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `trace_time'
  35. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `trace_fn'
  36. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `trace_fn'
  37. /home/jcv/v2lin/v2lin_v02/samples/with_main/with_main.c:35: undefined reference to `trace_fn'
  38. collect2: ld returned 1 exit status
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement