[Freeswitch-dev] fedora 12 compiler error and workaround

Douglas Hubler douglas at hubler.us
Tue Apr 6 13:15:53 PDT 2010


Here is the complier error (sorry for pasting it in here, but you'll
see why it's important in a second...)

Creating mod_amr.so...
/usr/lib/gcc/i686-redhat-linux/4.4.3/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
quiet_libtool: link: gcc -I/home/dhubler/work/freeswitch/src/include
-I/home/dhubler/work/freeswitch/src/include
-I/home/dhubler/work/freeswitch/libs/libteletone/src -fPIC -Werror
-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g
-ggdb -g -O2 -Wall -std=c99 -pedantic -Wdeclaration-after-statement
-D_GNU_SOURCE -DAMR_PASSTHROUGH -o .libs/mod_amr.so -Wl,-x
.libs/mod_amr.o  -lm
/home/dhubler/work/freeswitch/.libs/libfreeswitch.so
-L/home/dhubler/work/freeswitch/libs/apr-util/xml/expat/lib
/home/dhubler/work/freeswitch/libs/apr-util/xml/expat/lib/.libs/libexpat.a
/home/dhubler/work/freeswitch/libs/apr/.libs/libapr-1.a -lpq -luuid
-lrt -lcrypt -lpthread -lssl -lcrypto -ldl -lz -lncurses -Wl,-rpath
-Wl,/usr/local/freeswitch/lib -Wl,-rpath -Wl,/usr/local/freeswitch/mod


For some reason "-shared" is not on the link line

Don't ask me how i figured this out, but If I change in file build/modmake.rules
   SOLINK = -shared -Xlinker -x
to
   SOLINK = --shared -Xlinker -x

Everything compiles and freeswitch runs.  Something in the gnu tool
chain wants to strip out any "-foo" parameter to gcc but adding an
extra "-" it allows it through.

So i didn't find the problem, but i did find a weird workaround.



More information about the FreeSWITCH-dev mailing list