PDA

View Full Version : Problem in compiling



ja_sapienza
8th July 2008, 22:50
Hi!

I have a programing in Qt 4.4.

I write all code and this code is compiling without errors. The program compiled don't show errors too in execution. The code is 2000 lines...

So, this program make a long loop (10.000 - 50.000 times), if i compile a debug version, it's works, the result is fine... But, if i compile a release version, the code don't work well and the result is wrong...

I don't know what it is, is the same code, i don't make changes...

Someone help me?

Thks...

wysota
8th July 2008, 22:56
We'd have to know more details and see at least portions of the code.

ja_sapienza
9th July 2008, 02:11
Ok, no problem...

My code is under GPL license :)

Ok, i will begin with main function in my looping. This function determine the flow of a river in vector format.

I saw a problem maybe at the beginning of this code. For example, in debug compile, this loop run 100 times. In release compile, this run 100 times too, but leaves the first return.

But in both compiles I used the EVEN CODE and EVEN INPUT.

So, this is the beginning of the main function of my loop...


bool CHydroFlow::DetermineFlow(const int indSHPObj)
{

pSHPObject pHidLine = HidLn->SHPObjs[indSHPObj];
int FlowHidLine = HidLn->Flows[indSHPObj];
int OrderStrahlerHidLine = 0;
int OrderShreveHidLine = 0;
if (HFParams.HFOptions.OrderStrahler) {
OrderStrahlerHidLine = HidLn->OrdersStrahler[indSHPObj];
};
if (HFParams.HFOptions.OrderShreve) {
OrderShreveHidLine = HidLn->OrdersShreve[indSHPObj];
};
if ((FlowHidLine != 0) && (OrderStrahlerHidLine != 0) || (!HFParams.HFOptions.OrderStrahler)
&& ((OrderShreveHidLine != 0) || (!HFParams.HFOptions.OrderShreve)))
return true; //If above is true, then nothing to do

<CONTINUE...>

wysota
9th July 2008, 04:46
You might be using some uninitialized variable somewhere that might be initialized differently in debug and release modes.

ja_sapienza
9th July 2008, 15:26
How is this possible?
Initialized differently!?

But all variables are initialized before... I will see that...

Thks

wysota
9th July 2008, 15:38
Are these initialized?
HFParams.HFOptions.OrderStrahler
HFParams.HFOptions.OrderShreve

ja_sapienza
11th July 2008, 13:25
There variables are input parameters of my class...

This code is part of a class...

Thks

wysota
11th July 2008, 15:10
And what are their values at the beginning of this code block?