Partimage 0.7.2 Compile Error on Knopix 3.6 (gcc 3.3)

Everything about the installation and compilation

Moderator: feffer

Post Reply
Guest

Partimage 0.7.2 Compile Error on Knopix 3.6 (gcc 3.3)

Post by Guest » Thu Sep 30, 2004 1:54 pm

I have only ONE error left:

>>>> gui.cpp:77: error: cannot convert `__gnu_cxx::__normal_iterator<SPartInfo*,
std::vector<SPartInfo, std::allocator<SPartInfo> > >' to `SPartInfo*' in return

from gui.cpp
SPartInfo *CGui::getPartInfo(int nDisk, int nPart)
{
vector<SPartInfo>::iterator it2;
vector<SDrives>::iterator it = m_Drives->begin();
it2 = (it+nDisk)->piInfo.begin();
------> return (it2+nPart);
#warning fix that function !!!
// return 0;


Fix of other errors:
#include <iostream.h> in both gui.cpp and interface_newt.cpp
as first include file


if i write simply return 0 the make and make install goes o.k. and i can start piguicnewt. I am a c++ newbie and i dont understand in the moment to fix that error

Has someone a idea to fix that last bug ?

btw there are lots of deprecated warnings. somenone should replace lots of header files from <string.h> to <string> and so on

marekjs
Posts: 1
Joined: Sun Apr 03, 2005 10:44 am

gui.cpp:76: error: cannot convert `__gnu_cxx::__normal.....

Post by marekjs » Sun Apr 03, 2005 10:47 am

Hi.
I have this problem too:
gui.cpp: In member function `SPartInfo* CGui::getPartInfo(int, int)':
gui.cpp:76: error: cannot convert `__gnu_cxx::__normal_iterator<SPartInfo*,
std::vector<SPartInfo, std::allocator<SPartInfo> > >' to `SPartInfo*' in
return

Any help from Gurus?

PS. Slack 10.1 gcc 3.3.5
----------------------------------
marekjs

Guest

Post by Guest » Tue Apr 12, 2005 4:14 pm

one possible way to fix this is replace
return (it2+nPart);
with
return &(*(it2+nPart));
in gui.cpp as mentioned above
(method SPartInfo *CGui::getPartInfo(int nDisk, int nPart) )

(first dereference the iterator and than get the address of the object itself)
PJ

Post Reply