Page 1 of 1

Is it possible?Linking with just link.exe without QB4.5?

Posted: Sat Dec 12, 2009 3:04 am
by Yazar
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"

Posted: Sat Dec 12, 2009 4:47 am
by Yazar
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;

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"
Qb runs but links another bas file....

Posted: Sat Dec 12, 2009 3:07 pm
by burger2227
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"

MAYBE THIS COULD HELP SOME MORE

Posted: Sat Dec 12, 2009 9:55 pm
by OPRESION