Qbasicnews.com

Full Version: Using some C functions in QBasic
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I found a useful C source on the web and now I'd like to use it as library in QuickBASIC 4.5. I compiled the source successfully using TurboC 2.01. I get a OBJ and a EXE file. Further I can create a LIB file (*.lib) using TLIB.EXE or QB's LIB.EXE. But when I try to link the lib file into a qlb file I always get lots of errors like this one:
Code:
Error L2029 : '_fopen' : unsolved external symbol
The error message is translated from my German version. I don't know if the translation is equivalent to the original English message.

Could someone give me a step by step instruction how to build a QLB file from a C source? Smile

The function in the C source is this:
Code:
int myfunction ( int commands )

Thanks!
Sebastian
You'll also need to link the C runtime library from your C compiler (Turbo C). fopen() is part of this library.

This might cause some problems since QB's runtime library has names that could potentially overlap with those in the C library.
Thanks, but now I LINK gives this strange message:
Code:
Fatal Error L1049: Too many segments Pos: BEE2 Record Typ: 98
Sad
The default segment limit is rather low; you can change this with the /segments linker option (/seg for PDS/VBDOS). Something like /segments:800 should be plenty.