Menu

[help] test Dir class, but fail when compile

Help
Anonymous
2000-11-03
2000-11-06
  • Anonymous

    Anonymous - 2000-11-03

    Dears:
    I installed CommonC++ library in  FreeBSD
    then write a program for test , but fail.
    please help me to find out where the problem is.

    ##########################
    ##   Source code of CC.cpp
    ##########################

    #include <cc++/file.h>
    #include <cc++/thread.h>
    #include <iostream>
                                                                                   
    int main(void)
    {
            char* aaa= "Dtest";
            Dir* dir = new Dir(aaa);
            //dir-> getName();
            delete dir;
    }

    ##########################
    ##    Error Mesages :
    ##########################
    g++ -Wall -W -g -O2  -I/home/staff/king/local/include -c CC.cpp
    In file included from /home/staff/king/local/include/cc++/file.h:45,
                     from CC.cpp:1:
    /home/staff/king/local/include/cc++/thread.h: In method `void cc_Thread::Notify(cc_Thread *)':
    /home/staff/king/local/include/cc++/thread.h:790: warning: unused parameter `class cc_Thread * th'
    /home/staff/king/local/include/cc++/thread.h: In method `void cc_Thread::OnSignal(int)':
    /home/staff/king/local/include/cc++/thread.h:852: warning: unused parameter `int signo'
    g++ -L/home/staff/king/local/lib -L/usr/local/lib -lccio  -o CC.x CC.o -Wl,-rpath=/home/staff/king/local/lib
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_Thread::cc_Thread(cc_Semaphore *, int, unsigned int)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_TimerPort::getTimer(void)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_Thread::setCancel(thread_cancel_t)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `ccxx_sleep(unsigned long)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_TimerPort::setTimer(unsigned long)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `Poller::Poller(void)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_ThreadKey::cc_ThreadKey(void)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_ThreadKey::getKey(void)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_Thread::Terminate(void)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_TimerPort::incTimer(unsigned long)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_Thread::Start(cc_Semaphore *)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `pthread_mutex_unlock'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_ThreadKey::~cc_ThreadKey(void)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `pthread_mutex_destroy'
    /home/staff/king/local/lib/libccio.so: undefined reference to `pthread_mutex_lock'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_Mutex::cc_Mutex(void)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `Poller::~Poller(void)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_TimerPort::endTimer(void)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_ThreadKey::setKey(void *)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `cc_TimerPort::cc_TimerPort(void)'
    /home/staff/king/local/lib/libccio.so: undefined reference to `Poller::getList(int)'
    gmake: *** [CC.x] Error 1
    rm CC.o

     
    • David Sugar

      David Sugar - 2000-11-06

      I just recently rebuilt Common C++ (1.2.5.1) for FreeBSD, and pre-built packages can be found at ftp://www.voxilla.org/pub/freebsd.  The only significent change recently made for FreeBSD is the use of "-pthread" as a link flag rather than implicitly linking lc_r.   This version is also in the FreeBSD ports collection and can be rebuilt from there, as well as being on the new 4.2 cdrom distribution.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.