ar - create, modify, and extract from archives ranlib - generate index to archive nm - list symbols from object files $ ar -r libmine.a mine.o yours.o $ ranlib libmine.a or $ ar -s -r libmine.a mine.o yours.o
32-bit/64-bit Problem
ranlib /home/andreas/src/software/lib/libCompany.xa g++ -L/home/andreas/src/software/lib -m32 -lpthread -lrt -ldl -shared -o /home/andreas/src/software/lib/libCompany.so -Wl,-whole-archive /home/andreas/src/software/lib/libCompany.xa -Wl,-no-whole-archive /usr/bin/ld: cannot find crti.o: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib64/libpthread.so when searching for -lpthread /usr/bin/ld: cannot find -lpthread /usr/bin/ld: skipping incompatible /usr/lib64/librt.so when searching for -lrt /usr/bin/ld: cannot find -lrt /usr/bin/ld: skipping incompatible /usr/lib64/libdl.so when searching for -ldl /usr/bin/ld: cannot find -ldl /usr/bin/ld: skipping incompatible /usr/lib64/libm.so when searching for -lm /usr/bin/ld: cannot find -lm /usr/bin/ld: skipping incompatible /usr/lib64/libc.so when searching for -lc /usr/bin/ld: cannot find -lc /usr/bin/ld: cannot find crtn.o: No such file or directory collect2: error: ld returned 1 exit status make[1]: *** [/home/andreas/src/software/lib/libCompany.so] Error 1 make: *** [/home/andreas/src/software/common/ipc] Error 2
-Wl,option Pass option as an option to the linker. If option contains commas, it is split into multiple options at the commas. You can use thi syntax to pass an argument to the option. For example, -Wl,-Map,output.map passes -Map output.map to the linker. When using the GNU linker, you can also get the same effect with `-Wl,-Map=output.map'. --whole-archive For each archive mentioned on the command line after the `--whole-archive' option, include every object file in the archive in the link, rather than searching the archive for the required object files. This is normally used to turn an archive file into a shared library, forcing every object to be included in the resulting shared library. This option may be used more than once.
ranlib /home/andreas/src/software/lib/libCompany.xa g++ -L/home/andreas/src/software/lib -L/home/andreas/src/software/lib -m32 -lpthread -lrt -ldl -shared -o /home/andreas/src/software/lib/libCompany.so -Wl,-whole-archive /home/andreas/src/software/lib/libCompany.xa -Wl,-no-whole-archive /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(Ipc.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcEndpoint.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcSock.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcBaseTransport.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcFifoTransport.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcMsgQTransport.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcUdpTransport.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcRelUdpTransport.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcTcpTransport.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcTransportInfo.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcStatus.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcTimer.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcMonotonicTime.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcHeader.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcLog.xo)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/home/andreas/src/software/lib/libCompany.xa(IpcGuard.xo)' is incompatible with i386 output