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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-27-2014, 02:56 AM
|
#1
|
LQ Newbie
Registered: Nov 2014
Posts: 9
Rep:
|
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.
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.
|
|
|
11-27-2014, 04:09 AM
|
#2
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,692
|
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.
|
|
|
11-27-2014, 04:27 AM
|
#3
|
LQ Newbie
Registered: Nov 2014
Posts: 9
Original Poster
Rep:
|
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?
|
|
|
11-27-2014, 07:12 AM
|
#4
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
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
-
|
|
|
11-27-2014, 10:46 PM
|
#5
|
LQ Newbie
Registered: Nov 2014
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by knudfl
|
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.
|
|
|
11-28-2014, 02:28 AM
|
#6
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
← #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.
|
12-01-2014, 08:59 PM
|
#7
|
Member
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 10:46 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|