How to speed up compilation?

General FreeBASIC programming questions.
Osmdesat
Posts: 1
Joined: Apr 07, 2018 16:52

How to speed up compilation?

Postby Osmdesat » Apr 07, 2018 17:11

Is there some method how to speed up compiling of FB executable? Normally I include window.bi, which seems to be big burden for compiler.
Even if I make only one-line Message box application, with window.bi include takes compiling almost 3 secs. on my PC. Without this include it takes fractions of second.
I have tried to make and use precompiled header from this include, but it doesn't seem to work.
I used standard gcc method: fbc -g -c precompiled.bas -o precompiled.bi.gch
.gch file was created, but only several hundreds bytes in size. And I don't believe that linker then loads this .gch.
Does anybody please know, how to make work either this precompiled header thing, or any other method, how to speed up compilation?
TeeEmCee
Posts: 262
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: How to speed up compilation?

Postby TeeEmCee » Apr 15, 2018 7:33

FB does not have anything like precompiled headers. That commandline just creates a normal object file but with .gch extension.

You don't need to include all of windows.bi. For most basics only including the following two headers will be enough:

Code: Select all

#include once "win/windef.bi"
#include once "win/winbase.bi"

If you get any errors about missing declarations search the Windows headers to figure out which additional headers you need to include.
bcohio2001
Posts: 548
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: How to speed up compilation?

Postby bcohio2001 » Apr 15, 2018 23:51

TeeEmCee wrote:You don't need to include all of windows.bi. For most basics only including the following two headers will be enough:

Code: Select all

#include once "win/windef.bi"
#include once "win/winbase.bi"

If you get any errors about missing declarations search the Windows headers to figure out which additional headers you need to include.


Very useful info there! Thank you!

Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests