PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: How To Streamline FreeBasic Executables  (Read 132 times)

Jim Dunn

  • Junior Member
  • **
  • Posts: 136
  • Jim Dunn
How To Streamline FreeBasic Executables
« on: May 12, 2022, 03:21:52 AM »

Hey all, remember when Bob Zale came out with that fancy "only compile into your EXE the parts of the include files that are needed" and it would ignore the rest?

I'm trying to figure out how to do that with FreeBasic.

I created a library (.a) but all my EXE files were the same size, no matter if I called a function or not.

Everything appears to be a static compile, putting everything into the EXE.

Any ideas ???
Logged
3.14159265358979323846264338327950
"Ok, yes... I like pie... um, I meant, pi."

Josť Roca

  • Guru Member
  • *****
  • Posts: 3341
Re: How To Streamline FreeBasic Executables
« Reply #1 on: May 12, 2022, 03:33:11 PM »

Take a look to my include files in the Afx framework and my use of PRIVATE in each procedure. Be warned that only works using source code.

Johan Klassen

  • Junior Member
  • **
  • Posts: 123
  • FF3 User
Re: How To Streamline FreeBasic Executables
« Reply #2 on: May 12, 2022, 08:22:19 PM »

also, if you split your library into separate files one function per file and compile each as an object and create the library from them the linker should then only link-in the used functions
Logged

Jim Dunn

  • Junior Member
  • **
  • Posts: 136
  • Jim Dunn
Re: How To Streamline FreeBasic Executables
« Reply #3 on: May 15, 2022, 06:33:31 AM »

Thank you both -- I see that my "knowledge of PRIVATE" was NULL...

So, while I "AM STUDYING ABOUT PRIVATE"... I went ahead and separated all my functions out into separate files and learned how to create a libjLib.a file.

Thx again!!
Logged
3.14159265358979323846264338327950
"Ok, yes... I like pie... um, I meant, pi."