LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-27-2014, 02:56 AM   #1
ansonc
LQ Newbie
 
Registered: Nov 2014
Posts: 9

Rep: Reputation: Disabled
g++ in ubuntu 64bit encounter "not declared in this scope"


hi,
I want to compille a osrtspproxy_2_0 tool from source with I get it from github. But it get "not declared in this scope" error. I check the code but couldn't find any clue.
The OS is ubuntu 14.04 and 64bit. gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1).
here is the compile infomation.
Quote:
g++ -DNDEBUG -D_UNIX -D_LINUX -Wall -I/usr/local/include -I. -c -o str.o str.cpp
In file included from str.h:14:0,
from str.cpp:14:
tlist.h: In member function ‘T& TSingleList<T>::Iterator:perator*()’:
tlist.h:97:20: error: ‘m_pNode’ was not declared in this scope
return m_pNode->GetData();
^
tlist.h: In member function ‘const T& TSingleList<T>::ConstIterator:perator*() const’:
tlist.h:117:20: error: ‘m_pNode’ was not declared in this scope
return m_pNode->GetData();
^
tlist.h: In member function ‘T& TDoubleList<T>::Iterator:perator*()’:
tlist.h:285:20: error: ‘m_pNode’ was not declared in this scope
return m_pNode->GetData();
^
tlist.h: In member function ‘const T& TDoubleList<T>::ConstIterator:perator*() const’:
tlist.h:305:20: error: ‘m_pNode’ was not declared in this scope
return m_pNode->GetData();
^
make[1]: *** [str.o] Error 1
the tlist.h file is:
Code:
/****************************************************************************
 *
 *  Copyright (C) 2000-2001 RealNetworks, Inc. All rights reserved.
 *
 *  This program is free software.  It may be distributed under the terms
 *  in the file LICENSE, found in the top level of the source distribution.
 *
 */

#ifndef _TLIST_H
#define _TLIST_H

#include <assert.h>

template <class T>
class TSingleList
{
private: // Unimplemented
    TSingleList( const TSingleList& );
    TSingleList& operator=( const TSingleList& );

protected:
    class TSingleNode
    {
    public:
        TSingleNode( TSingleNode* pNext, const T& Data ) :
            m_pNext(pNext),
            m_Data(Data)
        {
            // Empty
        }
        T& GetData( void ) { return m_Data; }
        const T& GetData( void ) const { return m_Data; }

        TSingleNode* m_pNext;
        T            m_Data;
    };
    class IteratorBase
    {
        friend class TSingleList<T>;
    public:
        IteratorBase( void ) :
            m_pList(NULL),
            m_pNode(NULL)
        {
            // Empty
        }
        bool operator++( void )
        {
            assert( m_pList && m_pNode );
            m_pNode = m_pNode->m_pNext;
            return ( m_pNode != NULL );
        }
        bool operator++( int )
        {
            assert( m_pList && m_pNode );
            m_pNode = m_pNode->m_pNext;
            return ( m_pNode != NULL );
        }
        operator bool( void ) const
        {
            return ( m_pList != NULL && m_pNode != NULL );
        }
        bool operator==( const IteratorBase& itr ) const
        {
            return ( itr.m_pList == m_pList && itr.m_pNode == m_pNode );
        }
        bool operator!=( const IteratorBase& itr ) const
        {
            return ( itr.m_pList != m_pList || itr.m_pNode != m_pNode );
        }

    protected:
        IteratorBase( const TSingleList<T>* pList, TSingleNode* pNode ) :
             m_pList(pList),
             m_pNode(pNode)
        {
            // Empty
        }

    protected:
        const TSingleList<T>* m_pList;
        TSingleNode*          m_pNode;
    };
public:
    class Iterator : public IteratorBase
    {
        friend class TSingleList<T>;
    public:
        Iterator( void ) : IteratorBase()
        {
            // Empty
        }
        T& operator*( void )
        {
            assert( m_pList && m_pNode );
            return m_pNode->GetData();
        }
    protected:
        Iterator( TSingleList<T>* pList, TSingleNode* pNode ) :
            IteratorBase( pList, pNode )
        {
            // Empty
        }
    };
    class ConstIterator : public IteratorBase
    {
        friend class TSingleList<T>;
    public:
        ConstIterator( void ) : IteratorBase()
        {
            // Empty
        }
        const T& operator*( void ) const
        {
            assert( m_pList && m_pNode );
            return m_pNode->GetData();
        }
    protected:
        ConstIterator( const TSingleList<T>* pList, TSingleNode* pNode ) :
            IteratorBase( pList, pNode )
        {
            // Empty
        }
    };

    TSingleList( void ) : m_pHead(NULL), m_pTail(NULL), m_nCount(0) {}
    ~TSingleList( void )
    {
        while( ! IsEmpty() )
        {
            RemoveHead();
        }
    }

    bool IsEmpty( void ) const { return m_pHead == NULL; }
    unsigned int GetCount( void ) const { return m_nCount; }
    void InsertHead( const T& Data )
    {
        TSingleNode* pNode = new TSingleNode( m_pHead, Data );
        assert( pNode );
        m_pHead = pNode;
        if( ! m_pTail )
        {
            m_pTail = pNode;
        }
        m_nCount++;
    }
    void InsertTail( const T& Data )
    {
        TSingleNode* pNode = new TSingleNode( NULL, Data );
        assert( pNode );
        if( m_pTail )
        {
            m_pTail->m_pNext = pNode;
        }
        m_pTail = pNode;
        if( ! m_pHead )
        {
            m_pHead = pNode;
        }
        m_nCount++;
    }
    T RemoveHead( void )
    {
        TSingleNode* pNode = m_pHead;
        m_pHead = pNode->m_pNext;
        if( ! m_pHead )
        {
            m_pTail = NULL;
        }
        T Data = pNode->GetData();
        delete pNode;
        m_nCount--;
        return Data;
    }

    Iterator      Begin( void )       { return Iterator( this, m_pHead ); }
    ConstIterator Begin( void ) const { return ConstIterator( this, m_pHead ); }
    Iterator      End( void )       { return Iterator( this, NULL ); }
    ConstIterator End( void ) const { return ConstIterator( this, NULL ); }

protected:
    TSingleNode* m_pHead;
    TSingleNode* m_pTail;
    unsigned int m_nCount;
};

template <class T>
class TDoubleList
{
private: // Unimplemented
    TDoubleList( const TDoubleList& );
    TDoubleList& operator=( const TDoubleList& );

protected:
    class TDoubleNode
    {
    public:
         TDoubleNode( TDoubleNode* pPrev, TDoubleNode* pNext, const T& Data ) :
            m_pPrev(pPrev),
            m_pNext(pNext),
            m_Data(Data)
        {
            // Empty
        }
        T& GetData( void ) { return m_Data; }
        const T& GetData( void ) const { return m_Data; }

        TDoubleNode* m_pPrev;
        TDoubleNode* m_pNext;
        T            m_Data;
    };
    class IteratorBase
    {
        friend class TDoubleList<T>;
    public:
        IteratorBase( void ) :
            m_pList(NULL),
            m_pNode(NULL)
        {
            // Empty
        }
        bool operator++( void )
        {
            assert( m_pList && m_pNode );
            m_pNode = m_pNode->m_pNext;
            return ( m_pNode != NULL );
        }
        bool operator++( int )
        {
            assert( m_pList && m_pNode );
            m_pNode = m_pNode->m_pNext;
            return ( m_pNode != NULL );
        }
        bool operator--( void )
        {
            assert( m_pList && m_pNode );
            m_pNode = m_pNode->m_pPrev;
            return ( m_pNode != NULL );
        }
        bool operator--( int )
        {
            assert( m_pList && m_pNode );
            m_pNode = m_pNode->m_pNext;
            return ( m_pNode != NULL );
        }
        operator bool( void ) const
        {
            return ( m_pList != NULL && m_pNode != NULL );
        }
        bool operator==( const IteratorBase& itr ) const
        {
            return ( itr.m_pList == m_pList && itr.m_pNode == m_pNode );
        }
        bool operator!=( const IteratorBase& itr ) const
        {
            return ( itr.m_pList != m_pList || itr.m_pNode != m_pNode );
        }

    protected:
        IteratorBase( const TDoubleList<T>* pList, TDoubleNode* pNode ) :
             m_pList(pList),
             m_pNode(pNode)
        {
            // Empty
        }

    protected:
        const TDoubleList<T>* m_pList;
        TDoubleNode*          m_pNode;
    };
public:
    class Iterator : public IteratorBase
    {
        friend class TDoubleList<T>;
    public:
        Iterator( void ) : IteratorBase()
        {
            // Empty
        }
        T& operator*( void )
        {
            assert( m_pList && m_pNode );
            return m_pNode->GetData();
        }
    protected:
        Iterator( const TDoubleList<T>* pList, TDoubleNode* pNode ) :
            IteratorBase( pList, pNode )
        {
            // Empty
        }
    };
    class ConstIterator : public IteratorBase
    {
        friend class TDoubleList<T>;
    public:
        ConstIterator( void ) : IteratorBase()
        {
            // Empty
        }
        const T& operator*( void ) const
        {
            assert( m_pList && m_pNode );
            return m_pNode->GetData();
        }
    protected:
        ConstIterator( const TDoubleList<T>* pList, TDoubleNode* pNode ) :
            IteratorBase( pList, pNode )
        {
            // Empty
        }
    };

    TDoubleList( void ) : m_pHead(NULL), m_pTail(NULL), m_nCount(0) {}
    ~TDoubleList( void )
    {
        while( ! IsEmpty() )
        {
            RemoveHead();
        }
    }

    bool IsEmpty( void ) const { return m_pHead == NULL; }
    unsigned int GetCount( void ) const { return m_nCount; }
    void InsertHead( const T& Data )
    {
        TDoubleNode* pNode = new TDoubleNode( NULL, m_pHead, Data );
        assert( pNode );
        if( m_pHead )
        {
            m_pHead->m_pPrev = pNode;
        }
        m_pHead = pNode;
        if( ! m_pTail )
        {
            m_pTail = pNode;
        }
        m_nCount++;
    }
    void InsertTail( const T& Data )
    {
        TDoubleNode* pNode = new TDoubleNode( m_pTail, NULL, Data );
        assert( pNode );
        if( m_pTail )
        {
            m_pTail->m_pNext = pNode;
        }
        m_pTail = pNode;
        if( ! m_pHead )
        {
            m_pHead = pNode;
        }
        m_nCount++;
    }
    void InsertBefore( const Iterator& itr, const T& Data )
    {
        assert( this == itr.m_pList && NULL != itr.m_pNode );
        assert( m_pHead && m_pTail && m_nCount );
        TDoubleNode* pNode = new TDoubleNode( NULL, itr.m_pNode, Data );
        assert( pNode );
        if( itr.m_pNode->m_pPrev )
        {
            itr.m_pNode->m_pPrev->m_pNext = pNode;
            pNode->m_pPrev = itr.m_pNode->m_pPrev;
        }
        else
        {
            assert( m_pHead == itr.m_pNode );
            m_pHead = pNode;
        }
        itr.m_pNode->m_pPrev = pNode;
        m_nCount++;
    }
    void InsertAfter( const Iterator& itr, const T& Data )
    {
        assert( this == itr.m_pList && NULL != itr.m_pNode );
        assert( m_pHead && m_pTail && m_nCount );
        TDoubleNode* pNode = new TDoubleNode( itr.m_pNode, NULL, Data );
        assert( pNode );
        if( itr.m_pNode->m_pNext )
        {
            itr.m_pNode->m_pNext->m_pPrev = pNode;
            pNode->m_pNext = itr.m_pNode->m_pNext;
        }
        else
        {
            assert( m_pTail == itr.m_pNode );
            m_pTail = pNode;
        }
        itr.m_pNode->m_pNext = pNode;
        m_nCount++;
    }
    T Remove( Iterator& itr )
    {
        assert( this == itr.m_pList && NULL != itr.m_pNode );
        assert( m_pHead && m_pTail && m_nCount );
        TDoubleNode* pNode = itr.m_pNode;
        itr.m_pNode = NULL;
        if( pNode->m_pPrev )
        {
            pNode->m_pPrev->m_pNext = pNode->m_pNext;
        }
        else
        {
            assert( m_pHead == pNode );
            m_pHead = pNode->m_pNext;
        }
        if( pNode->m_pNext )
        {
            pNode->m_pNext->m_pPrev = pNode->m_pPrev;
        }
        else
        {
            assert( m_pTail == pNode );
            m_pTail = pNode->m_pPrev;
        }
        T Data = pNode->GetData();
        delete pNode;
        m_nCount--;
        return Data;
    }
    T RemoveHead( void )
    {
        assert( m_pHead && m_pTail && m_nCount );
        TDoubleNode* pNode = m_pHead;
        m_pHead = pNode->m_pNext;
        if( ! m_pHead )
        {
            m_pTail = NULL;
        }
        T Data = pNode->GetData();
        delete pNode;
        m_nCount--;
        return Data;
    }
    T RemoveTail( void )
    {
        assert( m_pHead && m_pTail && m_nCount );
        TDoubleNode* pNode = m_pTail;
        m_pTail = pNode->m_pPrev;
        if( ! m_pTail )
        {
            m_pHead = NULL;
        }
        T Data = pNode->GetData();
        delete pNode;
        m_nCount--;
        return Data;
    }

    Iterator      Begin( void )       { return Iterator( this, m_pHead ); }
    ConstIterator Begin( void ) const { return ConstIterator( this, m_pHead ); }
    Iterator      End( void )       { return Iterator( this, NULL ); }
    ConstIterator End( void ) const { return ConstIterator( this, NULL ); }

    protected:
        TDoubleNode* m_pHead;
        TDoubleNode* m_pTail;
        unsigned int m_nCount;
};

#endif  // _TLIST_H
please take a look and see if any thing occured to you.
thanks.

Last edited by ansonc; 11-27-2014 at 04:15 AM.
 
Old 11-27-2014, 04:09 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,918

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
You ought to use [code]your code[/code] instead of [quote].. Please try to edit your original post and fix this issue!
I would say the error message is misleading, I think this file is ok, probably the file str.cpp contains something strange, but we cannot see that.
 
Old 11-27-2014, 04:27 AM   #3
ansonc
LQ Newbie
 
Registered: Nov 2014
Posts: 9

Original Poster
Rep: Reputation: Disabled
thanks, pan64.
No clue in the cpp file either.
It's a opensource kit tool. It should have been compiled before.
Any chance it's the g++ problems?
 
Old 11-27-2014, 07:12 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
osrtspproxy_2_0 tool from source .... from github
Unknown version, but version "2_0" or 2.0 has been around for 10 years?
( There is an example "2.0" package for Redhat EL3.)

Some hints : The year 2010 version from
. http://code.google.com/p/mmqos/sourc...srtspproxy_2_0
. http://code.google.com/p/mmqos/source/checkout
$ svn checkout http://mmqos.googlecode.com/svn/trunk/ mmqos-read-only
.. will compile the two first libraries OK with g++-4.4 ,
but fails with rtspproxy/*

Using gcc-4.4 / g++-4.4 : Edit the three Makefile´s in
{ libapp/, librtsp/, rtspproxy/ } from
CC=gcc
CXX=g++

to :

CC=gcc-4.4
CXX=g++-4.4

-
 
Old 11-27-2014, 10:46 PM   #5
ansonc
LQ Newbie
 
Registered: Nov 2014
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Unknown version, but version "2_0" or 2.0 has been around for 10 years?
( There is an example "2.0" package for Redhat EL3.)

Some hints : The year 2010 version from
. http://code.google.com/p/mmqos/sourc...srtspproxy_2_0
. http://code.google.com/p/mmqos/source/checkout
$ svn checkout http://mmqos.googlecode.com/svn/trunk/ mmqos-read-only
.. will compile the two first libraries OK with g++-4.4 ,
but fails with rtspproxy/*

Using gcc-4.4 / g++-4.4 : Edit the three Makefile´s in
{ libapp/, librtsp/, rtspproxy/ } from
CC=gcc
CXX=g++

to :

CC=gcc-4.4
CXX=g++-4.4

-
hi,knudfl
thanks for your quick reply. And I can see some difference exist on the version on code.google and the one I used.
I want to check that out. But my headache is I can not get any access to the code.google trunk for the firewall blocking.
Would you please spare some time to help me with it. Many thanks.
 
Old 11-28-2014, 02:28 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← #5 .

OK, I got a new download with ...
$ svn checkout http://mmqos.googlecode.com/svn/trunk/ mmqos-read-only
And packed it up :
$ tar -cf mmqos-osrtspproxy_2_0_svn.r43.tar mmqos-read-only/

Uploaded as mmqos-osrtspproxy_2_0_svn.r43.tar.gz ( 2.1 MB ).
Download link https://drive.google.com/file/d/0B7S...ew?usp=sharing

-
 
1 members found this post helpful.
Old 12-01-2014, 08:59 PM   #7
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Rep: Reputation: 18
Hi -

I don't know if you solved this but I posted this on my site. This is how I got the not in scope error to go away. If it tells you what line for that error, please check it out.

Swig complained today at random:

void myfunc1 (arg1);
void myfunc2(arg2);

It is puzzling to me that in my headers, I had spaces or no spaces throughout between function name and parameters, and why at random did swig/g++ decide to give the error :

sqlFB_wrap.cxx: In function ‘int _wrap_FooFunct(ClientData, Tcl_Interp*, int, Tcl_Obj* const*)’:
sqlFB_wrap.cxx:2134:16: error: ‘FooFunct’ was not declared in this scope
FooFunct(arg1);

thanks,
mtdew3q
 
  


Reply

Tags
g++ error



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
g++ in ubuntu 64bit encounter "not declared in this scope" ansonc Linux - Software 1 11-27-2014 04:13 AM
Removing "Scope:Link" after inet6 addr (CentOS 5.5) BernardLinux Linux - Networking 2 09-04-2011 09:41 PM
g++ & "error: 'error' was not declared in this scope" WetFroggy Programming 4 09-27-2009 02:08 AM
Errors while compiling Faust: "PATH_MAX was not declared in this scope" prasadbrg Linux - Software 6 12-15-2008 01:04 AM
c++ - "index" is a global scope variable in <string>???? BrianK Programming 2 03-18-2008 08:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration