Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using some C functions in QBasic
#1
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
[Image: f.jpg]
Reply
#2
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.
Reply
#3
Thanks, but now I LINK gives this strange message:
Code:
Fatal Error L1049: Too many segments Pos: BEE2 Record Typ: 98
Sad
[Image: f.jpg]
Reply
#4
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)