|
|
Giant GCC difficult problems
|
|
Secretary xxx library catalog is dynamic and static versions, and is libxxx.a libxxx.so, options are -lxxx chain. So, I just want to be static version of the libxxx.a Secretary xxx chain, or other chain. So, how?
|
|
|
Re : the huge GCC difficult problems
|
|
The easy way out, change the name of a copy libxxx.a
|
|
|
Re : the huge GCC difficult problems
|
|
L try to use designated. A path of absolute
|
|
|
Re : the huge GCC difficult problems
|
|
Gcc. . . -Wl, -static -lxxx -Wl, -Bdynamic. . .
|
|
|
Re : the huge GCC difficult problems
|
|
Try and put libxxx.a. O documents on linking together Gcc -o program ao bo Co. libxxx.a -lyy -lzz
I have not tested this, you try playing
|
|
|
Re : the huge GCC difficult problems
|
|
Not : ( A simple code : #include "Pthread.h> Int main () {
Return pthread_self (); }
Bash# cc test.c /usr/lib/libpthread.a Results : /usr/lib/libpthread.a (Pthread.o) (. Text+0x166) : In function `pthread_initialize ': : Undefined reference to `_res' /usr/lib/libpthread.a (Pthread.o) (. Text+0x7d4) : In function `__pthread_reset_main_thread ': : Undefined reference to `_errno ' /usr/lib/libpthread.a (Pthread.o) (. Text+0x7e4) : In function `__pthread_reset_main_thread ': : Undefined reference to `_h_errno ' /usr/lib/libpthread.a (Pthread.o) (. Text+0x7ee) : In function `__pthread_reset_main_thread ': : Undefined reference to `_res' /usr/lib/libpthread.a (Pthread.o) (. Data+0x6b8) : undefined reference to `_errno ' /usr/lib/libpthread.a (Pthread.o) (. Data+0x6c0) : undefined reference to `_h_errno ' /usr/lib/libpthread.a (Pthread.o) (. Data+0x6c8) : undefined reference to `_res' /usr/lib/libpthread.a (Ptw-read.o) (. Text+0x25) : In function `read ': : Undefined reference to `__syscall_error ' /usr/lib/libpthread.a (Ptw-read.o) (. Text+0x55) : In function `read ': : Undefined reference to `__syscall_error ' /usr/lib/libpthread.a (Ptw-close.o) (. Text+0x1f) : In function `close ': : Undefined reference to `__syscall_error ' /usr/lib/libpthread.a (Ptw-close.o) (. Text+0x4a) : In function `close ': : Undefined reference to `__syscall_error ' /usr/lib/libpthread.a (Ptw-nanosleep.o) (. Text+0x23) : In function `nanosleep ': : Undefined reference to `__syscall_error ' /usr/lib/libpthread.a (Ptw-nanosleep.o) (. Text+0x51) : `__syscall_error more undefined references to 'follow Collect2 : ld returned 1 exit status
|
|
|
Re : the huge GCC difficult problems
|
|
Cc test.c -Wl, -static -lpthread -Wl, -Bdynamic
Have the same mistakes
|
|
|
Re : the huge GCC difficult problems
|
|
You procedures pthread not connected to the reservoir that can be translated to, no significance.
Now look at the procedures and the operation can say whether the process?
$ Cat ac #include "Pthread.h> Void *fun1 (void 6-12) {
}
Int main () {
Pthread_t tons. Pthread_attr_t a; Pthread_create (&t, &a, fun1, 0); }
$ Gcc ac -oa /tmp/cc8FdBCn.o (. Text+0x25) : In function `main ': : Undefined reference to `pthread_create ' Collect2 : ld returned 1 exit status
$ Gcc ac -oa -lpthread $ File a ELF : a bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs). not stripped A $ ldd Libpthread.so.0> /lib/i686/libpthread.so.0 (0x4001e000) Libc.so.6> /lib/i686/libc.so.6 (0x40070000) /lib/ld-linux.so.2> /lib/ld-linux.so.2 (0x40000000)
$ Gcc ac -oa -lpthread -static A $ ldd Not a dynamic executable $ File a ELF : a bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, statically linked, not stripped
$ Gcc ac -oa /usr/lib/libpthread.a /usr/lib/libc_p.a A $ ldd Libc.so.6> /lib/i686/libc.so.6 (0x4001e000) /lib/ld-linux.so.2> /lib/ld-linux.so.2 (0x40000000) $ File a ELF : a bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs). not stripped
I do libc_p.a is also unclear what looks like a thread libc support base? I just find it inside the lack of definition of the symbols, put it into a link
|
|
|
Re : the huge GCC difficult problems
|
|
Ah, I used the wrong pthread is a special case could be tried in other
Think of this method, just think that is not up to the standards, elegant canopy of good
|
|
|
Re : the huge GCC difficult problems
|
|
"I do not libc_p.a is also what looks like a thread libc support base?
No, libc_p.a code is an instrument inserted the profile of the C standard library.
|
|
|
Re : the huge GCC difficult problems
|
|
Thank you.
I am not sure why we can not just static links libpthread. Take time to look at. Glibc is perhaps the bugs.
|