Forum > Windows (32/64)

Execution stopped - but why?

<< < (2/2)

Bart:
Back to basics then.
Create a simple HelloWord application.
Create the file hello.pas.

--- 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";}};} ---begin  writeln('Hello World');end.
Compile it from the commandline:

--- Code: ---fpc hello.pas
--- End code ---

If that goes OK then and there exists a hello.exe file:

--- Code: ---hello
--- End code ---

If it does not output "Hello World" and you get no relevant output/error, try running it in the debugger:

--- Code: ---gdb hello.exe
run
--- End code ---

Bart

Martin_fr:

--- Quote from: stephanos on December 18, 2021, 03:58:43 pm ---I tried to make an executable. Clicked  Run > Build (Shift + F9).  I closed Lazarus and browsed to the executable.  I double clicked it, however, the pop up message was:
   "The application was able to start correctly
    (0x00000007b) Click OK to close the application"

--- End quote ---

Well and that is easy to translate, Microsoft provides a list of error codes.
https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-

--- Quote ---ERROR_INVALID_NAME

    123 (0x7B)

    The filename, directory name, or volume label syntax is incorrect.
--- End quote ---

So some file that your exe requires is not there. Or a folder.
This could be a dll.

Also it seems your PC had a 32 bit FPC.
Your laptop has a 64 bit fpc.

So if you relay on a dll, and that dll is 32bit... Well that could be it.

stephanos:
Dear All

Problem solved.  The clues were in the feedback.  Thanks

1)  I wrote a simple GUI on the laptop and was able to run it and make an exe and run it.  So new programmes on the laptop do work.

2)  My PC has 32bit FPC installed.  For reasons I do not understand it is this fpc.exe that is being referred to in Tools Options > Environment > Compiler Executable: "fpc.exe".  I took a gamble and renamed:
   C:\FPC\3.2.2\bin\i386-win32
to:
   C:\OldFPC\3.2.2\bin\i386-win32
and ran the programme again.  It gave me the error.

3)  Next I downloaded and installed Free Pascal Compiler (Free 32/64/16-bit multi-platform Pascal and Object Pascal compiler) onto the laptop.  There was no separate 64 bit version.  I made the path of the Compiler Executable:
   C:\FPC\3.2.2\bin\i386-win32\fpc.exe
 
Everything now works OK, all the existing programmes work

Now I do not fully understand the implications of this.  Have I written a 32 or 64 bit application?

If I want to continue developing my programme as a 64 bit application, do I have to rewrite it?

Thanks to everyone, wait to hear

Bart:
In Lazarus you can select for which target to compile in Compiler Options.
Just select Win64 and X86_64.
Then compile.

As long as you have the win32 to win64 crosscompile installed (Iand I guess you have), it will build for 64-bit.
You can do the same on the commandline:

--- Code: ---fpc -Px86_64 hello.pas
--- End code ---

Bart

Navigation

[0] Message Index

[*] Previous page

Go to full version