How to compile a .MBX file instead of a .MBO file in MapBasic

Products affected: MapInfo Pro™
Open the *.mb file in MapBasic, check that the lines 'Declare Sub main' and 'Sub main' are included at the beginning of the script. If the Sub main is not declared, then a *.mbo file will be created instead of a .mbx file.

Additionally, a *.mbo file will be created if there are any subroutines or call made to a method or function in another *.mb.  From there, all the *.mbo files would need to be "linked" and then compiled into the *.mbx.

In the example script below, the word 'separate' was used instead of 'main'. Substitute "separate" for the word "main" then save the .mb file and compile it in MapBasic. This should produce a .mbx file.

User-added image

UPDATED:  December 17, 2018