[Live-devel] Compile issue with 2004.02.09 code

Clark N. Taylor cntaylor at ece.ucsd.edu
Thu Feb 12 07:33:03 PST 2004


I found the same problem when compiling on Solaris.  This is what I did 
to fix it.

The "<<" function is defined in 
BasicUsageEnvironment/BasicUsageEnvironment.cpp.  This is the only thing 
that points to cerr.

I changed those functions to the following (don't remember what it was 
before...):

UsageEnvironment& BasicUsageEnvironment::operator<<(char const* str) {
  fprintf (stderr,"%s",str);
    return *this;
}

UsageEnvironment& BasicUsageEnvironment::operator<<(int i) {
  fprintf (stderr,"%d",i);
    return *this;
}

UsageEnvironment& BasicUsageEnvironment::operator<<(unsigned u) {
  fprintf(stderr,"%d",u);
    return *this;
}

UsageEnvironment& BasicUsageEnvironment::operator<<(double d) {
  fprintf(stderr,"%f",d);
    return *this;
}

UsageEnvironment& BasicUsageEnvironment::operator<<(void* p) {
  fprintf(stderr,"%x",p);
    return *this;
}


Duncan Hill wrote:

>Good day,
>
>I've tried to find the fix for this problem with google, but only found people 
>having similar issues and no solutions.  
>
>Problem: testProgs and MPlayer are unable to compile.
>
>Error log from textProgs:
>c++ -c -I../UsageEnvironment/include -I../groupsock/include 
>-I../liveMedia/include -I../BasicUsageEnvironment/include -I. 
>-I/usr/include/g++-3/ -O -DSOCKLEN_T=socklen_t -Wno-deprecated -Wall -DBSD=1 
>testMP3Streamer.cpp
>c++ -otestMP3Streamer -L. 
>testMP3Streamer.o ../liveMedia/libliveMedia.a ../groupsock/libgroupsock.a ../UsageEnvironment/libUsageEnvironment.a ../BasicUsageEnvironment/libBasicUsageEnvironment.a
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x410): In function 
>`BasicUsageEnvironment::operator<<(char const*)':
>: undefined reference to `cerr'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x415): In function 
>`BasicUsageEnvironment::operator<<(char const*)':
>: undefined reference to `ostream::operator<<(char const*)'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x428): In function 
>`BasicUsageEnvironment::operator<<(int)':
>: undefined reference to `cerr'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x42d): In function 
>`BasicUsageEnvironment::operator<<(int)':
>: undefined reference to `ostream::operator<<(int)'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x440): In function 
>`BasicUsageEnvironment::operator<<(unsigned)':
>: undefined reference to `cerr'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x445): In function 
>`BasicUsageEnvironment::operator<<(unsigned)':
>: undefined reference to `ostream::operator<<(unsigned)'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x45b): In function 
>`BasicUsageEnvironment::operator<<(double)':
>: undefined reference to `cerr'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x460): In function 
>`BasicUsageEnvironment::operator<<(double)':
>: undefined reference to `ostream::operator<<(double)'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x471): In function 
>`BasicUsageEnvironment::operator<<(void*)':
>: undefined reference to `cerr'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x479): In function 
>`BasicUsageEnvironment::operator<<(void*)':
>: undefined reference to `cerr'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x47f): In function 
>`BasicUsageEnvironment::operator<<(void*)':
>: undefined reference to `hex(ios&)'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x48a): In function 
>`BasicUsageEnvironment::operator<<(void*)':
>: undefined reference to `cerr'
>../BasicUsageEnvironment/libBasicUsageEnvironment.a(.text+0x48f): In function 
>`BasicUsageEnvironment::operator<<(void*)':
>: undefined reference to `ostream::operator<<(void const*)'
>collect2: ld returned 1 exit status
>make[1]: *** [testMP3Streamer] Error 1
>make[1]: Leaving directory `/usr/local/lib/live/testProgs'
>make: *** [testProgs/testServer] Error 2
>
>Compiler environment:
>gcc-3.3.2-1
>gcc-c++-3.3.2-1
>glibc-2.3.2-101.4
>glibc-devel-2.3.2-101.4
>Linux - Fedora Core 1 w/2.6.2 kernel
>live - 2004.02.09
>
>If I remove testProgs from the makefile, the compile completes successfully.  
>However, when I try to enable live in mplayer, the same errors crop up.  This 
>is driving me scatty, as I've compiled live before, about 6 months ago and it 
>worked.  Would appreciate any info available for getting this to work.
>
>I have applied the 'if you have gcc 3' suggestions, and the resulting 
>config.linux is:
>COMPILE_OPTS =          $(INCLUDES) -I. -I/usr/include/g++-3/ -O 
>-DSOCKLEN_T=socklen_t
>C =                     c
>C_COMPILER =            cc
>C_FLAGS =               $(COMPILE_OPTS)
>CPP =                   cpp
>CPLUSPLUS_COMPILER =    c++
>CPLUSPLUS_FLAGS =       $(COMPILE_OPTS) -Wno-deprecated -Wall -DBSD=1
>OBJ =                   o
>LINK =                  c++ -o
>LINK_OPTS =             -L.
>CONSOLE_LINK_OPTS =     $(LINK_OPTS)
>LIBRARY_LINK =          ld -o
>LIBRARY_LINK_OPTS =     $(LINK_OPTS) -r -Bstatic
>LIB_SUFFIX =                    a
>LIBS_FOR_CONSOLE_APPLICATION =
>LIBS_FOR_GUI_APPLICATION =
>EXE =
>_______________________________________________
>live-devel mailing list
>live-devel at lists.live.com
>http://lists.live.com/mailman/listinfo/live-devel
>  
>

-- 
Clark N. Taylor
PhD Student and Research Assistant
University of California, San Diego
cntaylor at ece.ucsd.edu
http://esdat.ucsd.edu/~cntaylor





More information about the live-devel mailing list