You are here:

Qbasic, Quickbasic/how to compile a file with a library loaded


i have been using qb4.5 for quite some time now but have just started using interrupts.
i use call interrupt for my mouse routines which require qb.qlb to be loaded with qb on startup and also the file to be included in the main module.
my question is when i compile the program as an standalone application it compiles smoothly i.e. no errors ,no warnings etc.But when i run it a dos window pops up and immediately closes.
what am i doing wrong and is the quick library compiled as part of the file or does it need access to the library even after compilation and is the file included in the compiled file??
please provide a suitable solution for my above stated problems.
thank you for your time whilst reading this post.
sample program to show the mouse cursor(it compiles but does not run)
dim regs as regtype
screen 12
call interrupt(&h33,regs,regs)

Hi Mohammad,

This is a limitation in how Windows emulates DOS; your executable needs to be running from the directory that you have the libraries, but when you just try and run the executable by double clicking on it in Windows, it doesn't have that information.  To fix this, open up command prompt and navigate to the directory with your executable and run it from the command prompt.

There may be some sort of batch script work around for this, too, but I don't know any off hand.

Let me know if you still run into problems, and I can look into it some more for you if needed.

Take care,

Qbasic, Quickbasic

All Answers

Ask Experts


Alex Barry


I have been a qbasic programmer since 2000, creating games, minor libraries and various small programs. I have experience using interrupts, graphics, file input/output, the mouse cursor, and using libraries. I have also learned FreeBASIC, QB64, c/c++, python, lua, php and html.
I do not claim to be an absolute authority in any language, but I don't mind looking things up and learning with you.


I have been programming in *Basic dialects since 2000, as mentioned in my expertise. After a year of QBasic, I learned C and C++, and dabbled a little in ASM (I don't program in ASM - I literally just played around to see how things work). When QB64 and FreeBASIC were released, I played with those languages. At the time, FreeBASIC offered more functionality and I sided with that language for a while. During that time, while I was learning new languages, that I would see what scripting languages are available, where I took up python and lua. I started to notice a staleness to QB64's development (which I kept tabs on from time to time), and am now trying to be active in it's community and maybe in it's development in the future. Currently, I am only active on the forums, but I appear on occasion on's forums as well.

Highschool - 2007

©2016 All rights reserved.