How to use correct Common Shared syntax?

Windows specific questions.
speedfixer
Posts: 606
Joined: Nov 28, 2012 1:27
Location: CA, USA moving to WA, USA
Contact:

Re: How to use correct Common Shared syntax?

Post by speedfixer »

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
fxm
Moderator
Posts: 12159
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: How to use correct Common Shared syntax?

Post by fxm »

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.
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.
More simply (without make a library), if you compile these 2 modules like:
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]
sero
Posts: 59
Joined: Mar 06, 2018 13:26
Location: USA

Re: How to use correct Common Shared syntax?

Post by sero »

fxm wrote:I added these commands in the example of the COMMON documentation page:
KeyPgCommon → fxm [Added compilation/execution command for the example]
Much thanks for clearing this up!
Post Reply