Add the. cpp file to makefile. am.
The format is as follows:
Bin_programs = Executable File Name
* ** _ Sources = all. cpp files to be compiled, separated by Spaces
Libs =-lpthread-L/usr/local/lib-lpcap-LZ // Add to database
Defs + =-dnormal
Defs + =-dpdebug // open the debugging information to define dpdebug
Primary des =-I ../include // import the upper-level include path
# Includes = $ (deps_cflags)
# Ldadd = $ (deps_libs)
02-12-12, 00: 47
When I compile esound today, I did not notice that it is dependent on audiofile, resulting in an error. After the audiofile is compiled, the following error occurs when the esound is re-compiled:
(CD. libs & Rm-F libesddsp. So & ln-s libesddsp. so.0.2.29 libesddsp. So)
Ar cru. libs/libesddsp. A esddsp. o
Ranlib. libs/libesddsp.
Creating libesddsp. La
(CD. libs & Rm-F libesddsp. La & ln-S ../libesddsp. La libesddsp. La)
Gcc-dhave_config_h-I. -I. -I. -dsysconfdir =/"/etc/"-dserverdir =/"/usr/bin/"-g-O2-C esdcat. c
/Bin/sh./libtool -- mode = link GCC-g-O2-O esdcat. O libesd. La
Gcc-g-O2-o. libs/esdcat. O./. libs/libesd. So
./. Libs/libesd. So: Undefined reference to 'afgetsampleformat'
./. Libs/libesd. So: Undefined reference to 'afreadframes'
./. Libs/libesd. So: Undefined reference to 'afgetchann'
./. Libs/libesd. So: Undefined reference to 'afclofile'
./. Libs/libesd. So: Undefined reference to 'afgetrate'
./. Libs/libesd. So: Undefined reference to 'afgetframecount'
./. Libs/libesd. So: Undefined reference to 'afopenfile'
./. Libs/libesd. So: Undefined reference to 'afgettrackbytes'
Collect2: LD returned 1 exit status
Make [2]: *** [esdcat] Error 1
Make [2]: Leaving directory '/usr/src/esound-0.2.29'
Make [1]: *** [All-recursive] Error 1
Make [1]: Leaving directory '/usr/src/esound-0.2.29'
Make: *** [All-recursive-am] Error 2
When I was helpless, I decided to delete this directory (I want to make clean) and re-decommission and compile it. It turned out to be successful! What is the "undefined reference?
Tram
02-12-12, 08:32
This is the case. After you install audiofile, esound does not know because its configure script has been run and makefile is generated.Make clean + make distcleanSometimes it doesn't work. The make clean and make distclean scripts provided by some packages cannot completely delete the generated code. The cleanest way is to decompress the code again. I think the kernel's make mrproper may be the most complete script and can delete all the generated items. Undefined reference is a lack of type definition, which is usually a small header file.