Skip to content
🎉 Free Pascal v3.2.4 is out! See Release Notes
FAQ
Windows Related

Windows Related

1 - Releasing software generated by the windows compiler

There is no special requirements for releasing software for the Windows platform, it will work directly out of the box. The following are default for the Windows platform:

  • Stack size is unlimited
  • The stack checking option is not available on this platform.
2 - Debugging

The GNU debugger v6.4 and later have been tested, and generally work as they should. Because the GNU debugger is C oriented, some pascal types might not be represented as they should. It is suggested to use the text mode IDE instead of GDB, which is available for windows targets.

3 - Dynamic libraries

Creation and use of shared libraries (also called dynamic link libraries) is fully supported by the compiler. Refer to the Programmer’s Reference Manual for more information on shared library creation and use.

4 - Profiling

Profiling is supported using gprof. It requires mingw to be installed, and that fpc.cfg points to the correct library paths.

5 - Graph and problems with keyboard, mouse and ‘dummy dos windows’
  • Problem: If you use the Graph unit under Win32, you cannot use the API mouse unit for mouse support or use the win32 Crt unit to get keyboard data. The reason for this is that the created window is a GUI window, and not a console one.

    Solution: Use units WinMouse and WinCrt instead.

  • Problem: When you follow the above advice, and you run your purely Graph based win32 program from the RUN menu in windows, a dummy dos window is opened.

    Solution: Set the application type to GUI:

    {$apptype GUI}

    and put this line before your programs InitGraph statement:

    ShowWindow(GetActiveWindow,0);

    This will hide the dos window window. Some of the demos (like fpctris) use these techniques.

6 - Cygwin binary directory in your path sometimes causes builds to fail

The mingw make tool seems to look for a sh.exe, which it finds when the cygwin binary directory is in the path. The way directories are searched changes, and the build process dies.

Solution: do not put cygwin in your global path for now, only add it when needed. Efforts are made to work around this.

Possible untested workaround: add mingw sh.exe to a directory before the cygwin binary directory in the path

7 - Using the DOS compiler under Windows 95

There is a problem with the DOS (GO32V2) compiler and Windows 95 on computers with less than 16 Megabytes of RAM.

  1. First set in the properties of the DOS box the DPMI memory size to max value.
  2. Now try to start a demo program in the DOS box, e.g. HELLO (starting may take some time).

If this works you will be able to get the compiler to work by recompiling it with a smaller heap size, perhaps 2 or 4 MB (option -Chxxxx).

8 - Using DOS generated applications under windows

Several problems have been found running DOS software under certain versions of 32-bit MS Windows (NT / 2000 / XP). These seem to be problems with the DOS emulation layers (emulated DPMI services or the Go32 extender). These problems may not occur with all software generated by FPC. Either applications should be tested on these systems before being released, or Windows versions should be generated instead.

Note that no DOS applications may be used under 64-bit versions of MS Windows - this is a general restriction due to DOS emulation not being provided for these MS Windows versions. You might be able to use these applications under DosBox emulation, but it is not officially supported / tested by the FPC team.

9 - The mouse cursor does not respond in the Windows IDE

In windowed mode, the IDE might not respond to mouse moves and clicks. Just change the properties of the console, and remove the quick edit mode option. This should solve the mouse response problems.