LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-01-2004, 03:24 AM   #1
vipinsharma
LQ Newbie
 
Registered: May 2004
Posts: 9

Rep: Reputation: 0
Unhappy Compilation Errors !


Hi

I am getting the compile time errors while running a Project. The project is being ported from Windows Platform to Linux.


//Contents of File - persistentvector.h
------------------------------------------------------
#include "allocator.h"


template <class _Tp, class _Alloc = AllocatorInterface<_Tp> > class persistentvector
: public CPersists,public vector<_Tp ,_Alloc>

{

typedef persistentvector< _Tp, _Alloc > _Mypersistent;

public :
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef size_t size_type;
typedef pointer _Tptr;
typedef __gnu_cxx:: __normal_iterator< pointer,_Mypersistent > iterator;
typedef __gnu_cxx:: __normal_iterator< const_pointer,_Mypersistent > const_iterator;
typedef iterator _It;

Also thr are some of the functions like insert defined in this file.....


//Contents of File - typedefs.h
------------------------------------------------------
#include "persistentvector.h"

typedef persistentlist<CCktElem*,allocator<CCktElem*> >::iterator LIST_ITERATOR;

typedef persistentvector<CCktElem*, allocator<CCktElem*> >::iterator VECTOR_ITERATOR;

typedef persistentvector <CCktElem*,allocator<CCktElem*> > CKTELEM_DARRAY;

typedef persistentlist<CCktElem*, allocator<CCktElem*> > CKTELEM_LIST;

typedef persistentlist<CCktElem*,allocator<CCktElem*> >* PTR_CKTELEM_LIST;

typedef persistentvector<CCktElem*,allocator<CCktElem*> >* PTR_CKTELEM_DARRAY;
--------------------------------------------------------------------------



//Contents of File - ClogicElem.h
-------------------------------------------
#include "typedefs.h"

#include<CCktElem.h>


class CLogicElem : public CCktElem{
protected:

CLogicElem(unsigned int id): CCktElem(id)
{
#ifdef _DEBUG
m_pDBGCktElemName = NULL;
m_pDBGSourceList = NULL;
m_pDBGSinkList = NULL;
m_bDBGVisitedFlg = false;
#endif
}


LIST_ITERATOR Begin(PTR_CKTELEM_LIST pListPtr);

LIST_ITERATOR End(PTR_CKTELEM_LIST pListPtr);

VECTOR_ITERATOR Begin(PTR_CKTELEM_DARRAY pVectorPtr);

VECTOR_ITERATOR End(PTR_CKTELEM_DARRAY pVectorPtr);


};

inline LIST_ITERATOR CLogicElem::Begin(PTR_CKTELEM_LIST pListPtr)
{
return pListPtr->begin();
}

inline LIST_ITERATOR CLogicElem::End(PTR_CKTELEM_LIST pListPtr)
{
return pListPtr->end();
}

inline VECTOR_ITERATOR CLogicElem::Begin(PTR_CKTELEM_DARRAY pVectorPtr)
{
return pVectorPtr->begin();
}

inline VECTOR_ITERATOR CLogicElem::End(PTR_CKTELEM_DARRAY pVectorPtr)
{
return pVectorPtr->end();
}

The errors are obtained in the above function having return type VECTOR_ITERATOR. These begin and end functions are giving following compile time errors:


Errors:
conversion from `_gnu_cxx::__normal_iterator<CCktElem**, std::vector<CCktElem*,
std::allocator<CCktElem*> > >' to non-scalar type `
__gnu_cxx::__normal_iterator<CCktElem**, persistentvector<CCktElem*,
std::allocator<CCktElem*> > >' requested

In member function 'VECTOR_ITERATOR CLogicElem::End(persistentvector<CCktElem*,
std::allocator<CCktElem*> >*)':

conversion from `__gnu_cxx::__normal_iterator<CCktElem**, std::vector<CCktElem*,
std::allocator<CCktElem*> > >' to non-scalar type `VECTOR_ITERATOR'
requested


Though the similar functions having the return type LIST_ITERATOR are working fine.

Its just very difficult to track the exact problem.

Can any one give a push !

-vipinsharma
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
pango compilation errors slylos SUSE / openSUSE 4 12-04-2005 03:21 PM
lm sensor 2.9.0 compilation errors hippo159 Linux - Newbie 1 03-14-2005 06:47 AM
C++ compilation errors ??? glevine Programming 1 07-16-2004 04:15 PM
Gimp2.0 compilation errors!?! dhbiker Linux - Software 5 02-20-2004 07:12 AM
gaim compilation errors felixnine Linux - Software 1 07-23-2003 02:54 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:22 PM.

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