P
Prasanna
Hi,
I have been developing some libraries using VC++ 6.0. My work is
complete now and the code works just fine. It has been tested under
many circumstances and i have not encountered any problems. Now, I
would like to port it to gcc. Initially compiling it with gcc produced
a few errors, asking for some 'const' declarations in places where
VC++ would not bother to. But then, i was able to compile it and
create an executable. The problem is the executable crashes when i run
it.
I tried it with cygwin latest version and g++ in suse 8.1. When i
tried to debug it with DDD in suse, the program halts when i am
returning a reference. I checked for possible memory problems, like
returning a reference for a local variable or chaning the address of
an allocated memory. But there are none like that.
For example, the place where my program halts is this:
vector<unsigned>& GF:
rimitive()
{
return ir;
}
where 'ir' is a protected data member of class GF, as shown.
class GF{
....
protected:
vector<unsigned> ir;
};
If i try to step through return, it goes inside vector class and i get
lost.
I have no idea why this happens. Can someone elighten me on this.
Regards,
Prasanna.
I have been developing some libraries using VC++ 6.0. My work is
complete now and the code works just fine. It has been tested under
many circumstances and i have not encountered any problems. Now, I
would like to port it to gcc. Initially compiling it with gcc produced
a few errors, asking for some 'const' declarations in places where
VC++ would not bother to. But then, i was able to compile it and
create an executable. The problem is the executable crashes when i run
it.
I tried it with cygwin latest version and g++ in suse 8.1. When i
tried to debug it with DDD in suse, the program halts when i am
returning a reference. I checked for possible memory problems, like
returning a reference for a local variable or chaning the address of
an allocated memory. But there are none like that.
For example, the place where my program halts is this:
vector<unsigned>& GF:
{
return ir;
}
where 'ir' is a protected data member of class GF, as shown.
class GF{
....
protected:
vector<unsigned> ir;
};
If i try to step through return, it goes inside vector class and i get
lost.
I have no idea why this happens. Can someone elighten me on this.
Regards,
Prasanna.