Practical Guide to Fedora and Red Hat Enterprise Linux, A (4th Edition)

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Answers to Even-numbered Exercises 1. Whnctions? 2. What command could you give to compile prog.c and func.c into an exe- cutable named cprog ? $ cc -o cprog prog.c func.c 3. Shoogram. 4. How are the names of system libraries abbreviated on the gcc command line? Where does gcc search for libraries named in this manner? Describe how to specify your own library on the gcc command line. Libraries have names such as lib xxx .a or lib xxx .so . To link on the com- mand line with a library, first strip away the lib prefix and the .a or .so suf- fix; then prefix the remaining name with –l , as in –l xxx . By default, gcc searches the /usr/lib directory for libraries. When you spec- ify –L pathname on the command line, gcc searches the pathname directory for each instance of –L . To specify a library in /home/mine named libyyy.a , for example, you could use either of the following command lines: $ gcc -o myprog myfile.c -L/home/mine -lyyy $ gcc -o myprog myfile.c /home/mine/libyyy.a 5. Write a hips:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 2

27.progtools.ans.even.RH4 - 27 Answers to Even-numbered...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online