Compile during runtime
- SebMcClouth
- Veteran
- Posts: 240
- Joined: Fri Apr 29, 2005 2:20 am
- Location: Inside the Matrix
Compile during runtime
Heheheh... yes I need to perform this action...
I'll draw the scene for ya:
I'm running my code which could be installing another program...
Now I want my program to able to compile a program (.bas) as well as a library. How can I achieve this if I have the needed qb-files along with it?
BTW You could intreprete this also as the following question: How can I achieve a commandline compile??
grtz
Seb
I'll draw the scene for ya:
I'm running my code which could be installing another program...
Now I want my program to able to compile a program (.bas) as well as a library. How can I achieve this if I have the needed qb-files along with it?
BTW You could intreprete this also as the following question: How can I achieve a commandline compile??
grtz
Seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
Code: Select all
bc myfile.bas,,;
link myfile.obj,,,path_to_bcom45.lib;
You have a complete description of QB's command line at
http://qbcm.hybd.net/issues/1-9/#btau
- SebMcClouth
- Veteran
- Posts: 240
- Joined: Fri Apr 29, 2005 2:20 am
- Location: Inside the Matrix
Let me correct it..
Yes, that's all for a simple source, not using ON ERROR or "ON anything",and not using external libraries.
At the end you will have to delete a myfile.obj, myfile.map, and myfile.lst.
Code: Select all
bc /o myfile.bas,,;
link myfile.obj,,,path_to_bcom45.lib;
At the end you will have to delete a myfile.obj, myfile.map, and myfile.lst.
- SebMcClouth
- Veteran
- Posts: 240
- Joined: Fri Apr 29, 2005 2:20 am
- Location: Inside the Matrix
What if I have to compile a file that needs a library... for example:
grtz?
Code: Select all
'$include:'sumfin.bi'
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
Does it mean you have a sumfin.lib to link?
in that case it wuld be:
in that case it wuld be:
Code: Select all
bc /o myfile.bas,,;
link myfile.obj,,,path_to_bcom45.lib sumfin.lib ;
- SebMcClouth
- Veteran
- Posts: 240
- Joined: Fri Apr 29, 2005 2:20 am
- Location: Inside the Matrix
Ah okay thx...
Can I compile it like this:
Grtz
Seb
Can I compile it like this:
Code: Select all
shell "bc /o myfile.bas,,;"
shell "link myfile.obj,,,path_to_bcom45.lib sumfin.lib ;"
Seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
having never tried it...
i figured it was at least that simple...
i don't understand though, what difference would On Error make, and what would you do then? erm, whats the most complicated command you would need to compile a single module with a single included library?
i don't understand though, what difference would On Error make, and what would you do then? erm, whats the most complicated command you would need to compile a single module with a single included library?
Code: Select all
::bc program [/options] [, object] [, listfile] [;]
:: /a include asm in the list file
:: /ah huge arrays
:: /c### comms receive buffer size
:: /d debug check ctrl_brk + int overflow + array bound + check gosub/return
:: /e on error`+ resume number
:: /mbf
:: /o standalone
:: /r arrays last index first
:: /s fast strings
:: /t terse
:: /v check emulated events ON... on every statement
:: /w check emulated events ON... on every numbered line
:: /x RESUME, RESUME NEXT, RESUME 0
:: /zd add line info for use with Symbdeb
:: /zi add line info for use with codeview
:: ; don't ask for missing params
Code: Select all
::link [/options] objfile [objfile] [libfile.lib], [exefile], [mapfile], [libfile] [libfile] [;]
:: /BATCH /BINARY
:: /CODEVIEW /CPARMAXALLOC
:: /DOSSEG /DSALLOCATE
:: /EXEPACK /FARCALLTRANSLATION
:: /HELP /HIGH
:: /INFORMATION /LINENUMBERS
:: /MAP /NODEFAULTLIBRARYSEARCH
:: /NOEXTDICTIONARY /NOFARCALLTRANSLATION
:: /NOGROUPASSOCIATION /NOIGNORECASE
:: /NOPACKCODE /OVERLAYINTERRUPT
:: /PACKCODE /PACKDATA
:: /PAUSE /QUICKLIBRARY
:: /SEGMENTS /STACK
The link in my previous post details every option (and some more that a pplies to PDS)
holy crap!
if it weren't for the ide, you might as well be compiling c code! who knew it was so complex!?
- SebMcClouth
- Veteran
- Posts: 240
- Joined: Fri Apr 29, 2005 2:20 am
- Location: Inside the Matrix
I see no point in "compiling like the ide" as far as the method you have works.
The ide does a lot of things in the background:
-It preprocesses the sources: you can have it to compile things with '$include:' files in places specified in the "Options>Directories" menu. If you compile from command line you must edit the source and specify the include dir there, you can't do it in the command line.
-It parses the source to find if the switches /e, /x, /v or /w apply and sets them automatically. It's not smart enough to specify /ah or /l, you must specify those when calling the IDE.
-The linker uses the /batch option and have every other parameter set in a command file file that's erased at the end of linking. If you break somehow a linkage you will be able to check it it.
The ide does a lot of things in the background:
-It preprocesses the sources: you can have it to compile things with '$include:' files in places specified in the "Options>Directories" menu. If you compile from command line you must edit the source and specify the include dir there, you can't do it in the command line.
-It parses the source to find if the switches /e, /x, /v or /w apply and sets them automatically. It's not smart enough to specify /ah or /l, you must specify those when calling the IDE.
-The linker uses the /batch option and have every other parameter set in a command file file that's erased at the end of linking. If you break somehow a linkage you will be able to check it it.