freebasic / fbc

FreeBASIC is a completely free, open-source, multi-platform BASIC compiler, with syntax similar to MS-QuickBASIC, that adds new features such as pointers, object orientation, unsigned data types, inline assembly, and many others.
https://www.freebasic.net
877 stars 137 forks source link

Could fbc achieve the same effect as making a share section in dll #406

Open elfsimulate opened 1 year ago

elfsimulate commented 1 year ago

In some scenarios,we need to share variables in a DLL on windows platform. with msvc compiler,we usually use the '#pragma data_seg("Shared")' option to create a share section in a dll. how could fbc achieve the same effect or is there a option or funciton in fbc ?

verholom commented 1 year ago

As I know some linker keys need to be used. In the MSVC compiler, it looks like this (if memory serves):

link /section:.mydata,erw

I had a FreeBASIC project that was translated into an assembler listing and assembled by a linker from MSVC. True for a long time. But the experience is interesting.