Compile mutiple modules

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Compile mutiple modules

Post by Seb McClouth »

Can someone please explain one more time how to compile multiple modules, from the dos-prompt?
Seems to go wrong with my stuff. Some clean stuff might be refreshing.


thx
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

'$include.

Whenever I need to compile multiple modules I include them. When the compiler stumbles upon an include in foo.bas, it stops compiling foo.bas and begins compiling foo.bi. When it is done with foo.bi, it goes back to compiling foo.bas.

I am 90% sure that is how they do it in QB, as they do it in FB too. As far as the command line goes, I honestly have no idea :?
Image
RyanKelly
Coder
Posts: 48
Joined: Sun Jan 22, 2006 6:40 pm
Contact:

Re: Compile mutiple modules

Post by RyanKelly »

Seb McClouth wrote:Can someone please explain one more time how to compile multiple modules, from the dos-prompt?
Seems to go wrong with my stuff. Some clean stuff might be refreshing.


thx
If you can compile a single module then compiling multiple modules shouldn't be much trouble. Compile each source to generate and OBJ file, then link them all with the appropriate run time library.

What is it that goes "wrong"?

The most common difficulty with multiple modules is the use of global variables (look up "common").
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post by Seb McClouth »

I was just wondering if someone could show me a 'good way'.
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

I just remembered that Na_th_an wrote a tutorial about something like this a while back in QB:XP. You could go look at that.
Image
Post Reply