If you compile some modules to either a dynamic loadable or a static module, then the result is a separate obj source module, not FB code.
If the only include statements are INCLUDE, and those contain only FB source code, these will be imported and folded with the 'main' source, then the total will be compiled.
If an include statement is INCLIB, then you are asking that a .dll, .so, or .a (depends on OS and more) be reference or added to the result of compiling.
Look at keywords INCLIB and compile commandline options -dll, -dylib and more.
david
How to use correct Common Shared syntax?
-
- Posts: 606
- Joined: Nov 28, 2012 1:27
- Location: CA, USA moving to WA, USA
- Contact:
Re: How to use correct Common Shared syntax?
badidea wrote:I see your point, the example on this page (https://freebasic.net/wiki/wikka.php?wakka=KeyPgCommon) is unclear. Not sure myself how it should work.
More simply (without make a library), if you compile these 2 modules like:sero wrote:I can't get the common examples from the FreeBasic help document to compile. I get an error trying to compile it and I also noticed there is no #include to link the example *.bas files in the help document.
fbc common1.bas common2.bas
(since common1.bas was listed first, it will be the main entry point into the executable, and also provide its name)
then run common1, this works.
I added these commands in the example of the COMMON documentation page:
KeyPgCommon → fxm [Added compilation/execution command for the example]
Re: How to use correct Common Shared syntax?
Much thanks for clearing this up!fxm wrote:I added these commands in the example of the COMMON documentation page:
KeyPgCommon → fxm [Added compilation/execution command for the example]