Hello,
I'm trying to compile (and run) the test program found in "minrtl304.zip" of the following thread
https://forum.lazarus.freepascal.org/index.php/topic,41722.msg290584.html#msg290584I've left everything exactly the way it was, with two exceptions. I changed the command found in a.bat as shown below:
Original command line (found in a.bat)
fpc.exe -va -Xs -XX -Os1 .\test.pas
changed to compile for 64bit to
fpc.exe -va -Xs -XX -Os1 -TWin64 -Px86_64 .\test.pas
The other "change" is that I copied ppcrossx64.exe into the directory where test.pas is (thereby matching the 32bit setup/configuration.)
When compiling for 32bit, everything works great. When compiling for 64bit, I get the following:
lots and lots of information above...
[0.266] Reading object system.o
[0.269] Number of unresolved externals in objects 3
[0.270] Number of unresolved externals after static libraries 3
[0.271] Number of unresolved externals after defining symbols provided by link script 3
[0.274] Number of unresolved externals after defining COMMON symbols 3
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
[0.276] test.pas(3,1) Error: Entrypoint _mainCRTStartup not defined
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[0.277] Number of unresolved externals after DLL imports 0
[0.278] test.pas(3,1) Fatal: There were 1 errors compiling module, stopping
[0.280] Fatal: Compilation aborted
Error: Z:\Training\freepascal - minrtl304\minrtl304\ppcrossx64.exe returned an error exitcode
When compiling for 32bit, the compiler (and linker) seems to find
_mainCRTStartup just fine.
When compiling for 64bit, the compiler/linker complains about not finding
_mainCRTStartup even though it is defined in sysinitpas.pas.
My question is: what do I have to do to make the linker find
_mainCRTStartup so, the linker and I can both be happy ;-)
Thank you for your help.