Hi there. Can we make an exe file from a bas file just using the linker not the Qb4.5 itself ?
For example like that;
LINK.EXE "SCODE.BAS", "SCODE.EXE", "SCODE.LIB"
The problem is to create the obj file from the bas file. If I could create the obj file from the bas file, the
rest is very easy;
LINK.EXE "SCODE.OBJ", "SCODE.EXE", "SCODE.LIB"
Is it possible?Linking with just link.exe without QB4.5?
Sorry for that question. Long time, no coding in Qb, so I couldn't resolve this simple problem. I found the solution and decided to delete the topic but, what about sharing?
So this code does what I want;
Qb runs but links another bas file....
So this code does what I want;
Code: Select all
INPUT "File Name"; file$
k% = INSTR(1, file$, ".")
IF NOT k% THEN file$ = file$ + ".bas"
k% = INSTR(1, file$, ".")
newfile$ = MID$(file$, 1, k% - 1)
objname$ = newfile$ + ".obj"
listname$ = newfile$ + ".lst"
exename$ = newfile$ + ".exe"
mapname$ = newfile$ + ".exe"
SHELL "bc " + file$ + "," + objname$ + "," + newfile$ + ".lst"
SHELL "link " + objname$ + ", " + exename$ + ", " + mapname$ + ", qb.lib"
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Compile them each with BC command from the QB dir:
Code: Select all
SHELL "BC MODULE1.BAS /O/S/E/X;"
SHELL "BC MODULE2.BAS /O/S/E/X;"
Then, link them both together as one program name like "MYPROG.EXE".
SHELL "LINK /E MODULE1+MODULE2,MYPROG.EXE,,BCOM45.LIB+QB.LIB"
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
MAYBE THIS COULD HELP SOME MORE
MY PAGE: http://Qbasic.phatcode.net" target="_blank
(I ONLY USE WINDOWS 98SE YET, BELIEVE IT OR NOT)
(I ONLY USE WINDOWS 98SE YET, BELIEVE IT OR NOT)