2011-9-4
Check the system installation package in Ubuntu (my current version is 9.04): dpkg-l
View the package installed in the system in RedHat: rpm-Qa
2011-9-21
Inputld --verbose | grep SEARCH
The current search path and sequence are displayed. To displayLDWhich files are connected, you can compile a pseudo (dummy) program and
--verbose
Parameters are passed to the connector. For example, entergcc dummy.c -Wl,--verbose 2>&1 | grep succeeded
All files successfully opened during connection are displayed.
The GCC configuration script does not search the directory in the path to find the tool to use.GccYou do not need to use the same search path. You need to knowGccWhich standard connector will be used? Run the following command:gcc -print-prog-name=ld
.
When compiling a pseudo programGcc
Command Transmission-VYou can obtain detailed information. For example:
gcc -v dummy.c
Detailed information in the preprocessing, compilation, and compilation phases, includingGccThe search path and sequence contained in the file.
Dummy. C: void main (){}
Xgy @ Ubuntu :~ /Tmp $ gcc-V dummy. c
Using built-in specs.
Target: i486-linux-gnu
Configured :.. /src/configure-V -- With-pkgversion = 'ubuntu 4.3.3-5ubuntu4' -- With-bugurl = file: // usr/share/doc/gcc-4.3/readme. bugs -- enable-languages ages = C, C ++, Fortran, objc, OBJ-C ++ -- prefix =/usr -- enable-shared -- With-system-zlib -- libexecdir =/usr/lib -- without-included-gettext
-- Enable-threads = POSIX -- enable-NLS -- With-gxx-include-Dir =/usr/include/C ++/4.3 -- Program-suffix =-4.3 -- enable-clocale = GNU -- enable-libstdcxx-Debug -- enable-objc-GC -- enable-mpfr -- enable-targets = all -- With-tune = generic -- enable-checking = release -- Build = i486-linux-gnu
-- Host = i486-linux-gnu -- target = i486-linux-gnu
Thread model: POSIX
GCC version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)
Collect_gcc_options = '-v''-mtune = generic'
/Usr/lib/GCC/i486-linux-gnu/4.3.3/PC3-quiet-V dummy. c-d_fortify_source = 2-quiet-dumpbase dummy. c-mtune = generic-auxbase dummy-version-fstack-protector-O/tmp/cchsoj5f. s
Ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
Ignoring nonexistent directory "/usr/lib/GCC/i486-linux-gnu/4.3.3/.../i486-linux-gnu/include"
Ignoring nonexistent directory "/usr/include/i486-linux-gnu"
# Include "..." search starts here:
# Include <...> search starts here:
/Usr/local/include
/Usr/lib/GCC/i486-linux-gnu/4.3.3/include
/Usr/lib/GCC/i486-linux-gnu/4.3.3/include-fixed
/Usr/include
End of search list.
Gnu c (Ubuntu 4.3.3-5ubuntu4) version 4.3.3 (i486-linux-gnu)
Compiled by gnu c version 4.3.3, GMP version 4.2.4, mpfr version 2.4.0.
GGC Heuristics: -- Param GGC-Min-expand = 64 -- Param GGC-Min-heapsize = 63688
Compiler executable checksum: 0bf5703b57e064ca90b48f4e2c186f4a
Collect_gcc_options = '-v''-mtune = generic'
As-v-QY-O/tmp/cccfknmd. O/tmp/cchsoj5f. s
GNU Debugger er version 2.19.1 (i486-linux-gnu) using BFD version (GNU binutils for Ubuntu) 2.19.1
Compiler_path =/usr/lib/GCC/i486-linux-gnu/4.3.3/:/usr/lib/GCC/i486-linux-gnu/4.3.3/:/usr/lib/GCC/i486-linux-gnu /: /usr/lib/GCC/i486-linux-gnu/4.3.3/:/usr/lib/GCC/i486-linux-gnu/:/usr/lib/GCC/i486-linux-gnu/4.3.3 /: /usr/lib/GCC/i486-linux-gnu/
LIBRARY_PATH =/usr/lib/GCC/i486-linux-gnu/4.3.3/:/usr/lib/GCC/i486-linux-gnu/4.3.3/:/usr/lib/GCC/i486-linux-gnu/4.3.3 /.. /.. /.. /.. /lib/:/lib /.. /lib/:/usr/lib /.. /lib/:/usr/lib/GCC/i486-linux-gnu/4.3.3 /.. /.. /.. /:/lib/:/usr/lib/
Collect_gcc_options = '-v''-mtune = generic'
/Usr/lib/GCC/i486-linux-gnu/4.3.3/collect2 -- Eh-frame-HDR-M elf_i386 -- hash-style = both-dynamic-linker/lib/ld-linux.so.2-Z relro/usr /lib/GCC/i486-linux-gnu/4.3.3 /.. /.. /.. /.. /lib/crt1.o/usr/lib/GCC/i486-linux-gnu/4.3.3 /.. /.. /.. /.. /lib/crti. o/usr/lib/GCC/i486-linux-gnu/4.3.3/crtbegin. O
-L/usr/lib/GCC/i486-linux-gnu/4.3.3-L/usr/lib/GCC/i486-linux-gnu/4.3.3-L/usr/lib/GCC/i486-linux-gnu/4.3.3 /.. /.. /.. /.. /lib-L/lib /.. /lib-L/usr/lib /.. /lib-L/usr/lib/GCC/i486-linux-gnu/4.3.3 /.. /.. /.. /tmp/cccfknmd. o-lgcc -- as-needed-lgcc_s -- no-as-needed
-LC-lgcc -- as-needed-lgcc_s -- no-as-needed/usr/lib/GCC/i486-linux-gnu/4.3.3/crtend. o/usr/lib/GCC/i486-linux-gnu/4.3.3 /.. /.. /.. /.. /lib/crtn. O
/Usr/lib/GCC/i486-linux-gnu/4.3.3/.../lib/crt1.o: In function '_ start ':
/Build/buildd/glibc-2.9/CSU/../sysdeps/i386/Elf/start. S: 115: Undefined reference to 'main'
Collect2: LD returned 1 exit status
Linux File SEARCH Command find, xargs detail http://www.linuxsir.org/main? Q = node/137 #4.9