Pelles C forum
Pelles C => General discussions => Topic started 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
-
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.
-
Use OutputDebugString() with debugger.
-
Thanks a lot.... I will try the OutputDebugString() and report to Wine.
Greetings,
Ran
-
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)).
-
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
-
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?
-
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?
-
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
-
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
-
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
-
Does this by any chance have anything to do with simply adding something like...
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...
...
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();
}
...
}
-
...
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.
-
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
-
And thank you too, of course migf1....