Pelles C forum

Pelles C => General discussions => Topic started by: Ran on April 27, 2013, 06:20:52 PM

Title: variable value detection under Wine
Post by: Ran on April 27, 2013, 06:20:52 PM
Hello,

I use Pelle's C (ver 7) in Ubuntu under Wine, but when i want to see
the value of a variable with the fprint.... then I end the program and
everything closes down and I can't see the results of the variables.
Help anyone ???

Greetings,
Ran 
Title: Re: variable value detection under Wine
Post by: Stefan Pendl on April 29, 2013, 08:22:33 AM
Since this is working on pure Windows you will have to report the issue to the WINE development.

Anything that works on regular Windows and not under WINE is a WINE issue.
Title: Re: variable value detection under Wine
Post by: TimoVJL on April 29, 2013, 02:15:05 PM
Use OutputDebugString() with debugger.
Title: Re: variable value detection under Wine
Post by: Ran on April 30, 2013, 08:24:52 AM
Thanks a lot.... I will try the OutputDebugString() and report to Wine.

Greetings,

Ran
Title: Re: variable value detection under Wine
Post by: czerny on May 07, 2013, 08:14:58 PM
Use OutputDebugString() with debugger.
I have tried to collect some infos to OutputDebugString.
Theres is a little helper function on this site: http://unixwiz.net/techtips/outputdebugstring.html (http://unixwiz.net/techtips/outputdebugstring.html)
May be anyone can tell me why the crlf in this function is usefull.
I have attached a little test project.

If one would like to use that in release mode, use DebugView (http://technet.microsoft.com/en-us/sysinternals/bb896647 (http://technet.microsoft.com/en-us/sysinternals/bb896647)).
Title: Re: variable value detection under Wine
Post by: Ran on May 09, 2013, 05:13:37 PM
czerny,

Thanks, but I did find that i can see the variables with Pelle's C in this way:

When I run the Ide and there is a "fprint...." inside the code then Pelle's Ide closes and
shows me nothing.
So I use the Ide to program and execute.....
Then I go to the exe file of the program that Pelle's ide has produced and run the program
from there. Well when the program closes here it shows the black window for a second
so that I can read the variables.

I also did use (years ago) Visual C 6.0 with the Vs6sp6 pack and it works fine too !!!!
But for C I use Pelle's C because I got big problems with the runtime dll's from VC.
When people got a Visual Basic program on their PC, my runtime dll didn't work
anymore because the Microsoft dll's are not compatible with each-other.
So then I moved (had to) to Pelle's C.

Greetings,
Ran 
Title: Re: variable value detection under Wine
Post by: czerny on May 09, 2013, 08:07:38 PM
Thanks, but I did find that i can see the variables with Pelle's C in this way:
Sorry, I don't understand.
Does it work or does it not work for you?
Title: Re: variable value detection under Wine
Post by: czerny on May 09, 2013, 08:09:50 PM
When I run the Ide and there is a "fprint...." inside the code then Pelle's Ide closes and
shows me nothing.
What do you use? fprintf or printf?

Can you provide a little example?
Title: Re: variable value detection under Wine
Post by: Ran on May 11, 2013, 08:35:18 AM
Czerny,
Yes I works, but not running the execute from the Ide,
only from the stand alone exe that is made by the Ide.
example:
printf ("Decimals yl : %d\n", yl);

And in main I have:
#include <stdio.h>
#include <io.h>

Greetings,
Fred
Title: Re: variable value detection under Wine
Post by: Ran on May 11, 2013, 08:40:13 AM
Czerny,

i program under Wine (ubuntu) with SDL and Opengl.
It works fine.
And is workable.
But when I want to distribute a program I go to
Win 7 (second OS on laptop) and do a Rebuid and make a exe.

Greetings,
Fred
Title: Re: variable value detection under Wine
Post by: Ran on May 11, 2013, 09:29:38 AM
Thanks timovjl,

But with SDL and Opengl I work under a console window and not windows.
But yes I could use it and include windows.h.

Greetings and thanks,
Ran
Title: Re: variable value detection under Wine
Post by: migf1 on May 16, 2013, 11:10:04 AM
Does this by any chance have anything to do with simply adding something like...

Code: [Select]
system("pause");
just before you exit your program?

That will only work on Windows platforms and it's rather heavy, but you can easily code a simple cross-platform alternative (macro or function) behaving somewhat similarly...

Code: [Select]
...
void pressENTER( void )
{
    int c;

    printf( "press ENTER... ");
    fflush( stdout );
    while ( '\n' != (c=getchar()) && EOF != c )
        ;    /* void */
}
...
int main( void )
{
    ...
    if ( error ) {
        puts( "*** error" );
        pressENTER();
    }
    ...
}

Title: Re: variable value detection under Wine
Post by: TimoVJL on May 16, 2013, 05:31:15 PM
...
Then I go to the exe file of the program that Pelle's ide has produced and run the program
from there. Well when the program closes here it shows the black window for a second
so that I can read the variables.
...
With mouse right click in wine console select options not to close window after program ends.
Title: Re: variable value detection under Wine
Post by: Ran on May 19, 2013, 08:00:20 AM
Yes, timovjl that was the one I was looking for......
Thanks a lot, it works fine.....
Now I have the time to read every variable....

Greetings,
Ran
Title: Re: variable value detection under Wine
Post by: Ran on May 19, 2013, 08:18:17 AM
And thank you too, of course migf1....