Forum > Beginners

CRT not found when trying to compile for wince

(1/2) > >>

helpwithfpc:
If I use fpc on windows 7, with the 'uses crt;' option, the program will compile and I can successfully write to the screen (opens DOS window and writes the text from the writeln statement in the program.

When I use lazarus on windows 7 and compile the program for wince, 'arm' cpu and 'arm4' processor, I get the following message;

testit.pas(3,29)Fatal: Cannot find crt used by testit of the Project Inspector.

I have looked everywhere and as near as I can tell, the crt unit does not work for wince to write to the screen. is there any other option available to write to the screen on wince?

I'm new to free pascal and even newer to lazarus - any help would be appreciated.

Leledumbo:
Ask yourself first: do you really need crt unit? writing to stdout does not require any unit other than system unit.

Thaddy:

--- Quote from: Leledumbo on May 31, 2016, 09:17:22 am ---Ask yourself first: do you really need crt unit? writing to stdout does not require any unit other than system unit.

--- End quote ---

Yup, but note that under windows you have to define {$APPTYPE CONSOLE} for writeln/readln to work.
Otherwise you run into an error 105..

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program testconsole;{$APPTYPE CONSOLE}begin  writeln('console output');  readln;end. 

Leledumbo:

--- Quote from: Thaddy on May 31, 2016, 11:09:27 am ---Yup, but note that under windows you have to define {$APPTYPE CONSOLE} for writeln/readln to work.
Otherwise you run into an error 105..

--- End quote ---
I think the OP uses pure FPC without Lazarus, which has no -WG set by default. Hence {$APPTYPE CONSOLE} is already the default.

Thaddy:
@Leledumbo: Nope. You have to specify it explicitly. Maybe Lazarus defines it for a console app, but normally for Windows and just FPC you actually need to specify {$APPTYPE CONSOLE} otherwise the stdin/out won't get linked in and you'll end up with runerror 105.

Navigation

[0] Message Index

[#] Next page

Go to full version