Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
making a lib in c++
#1
Lets say i have a C++ program with some functions and I compile it into a .obj, but I want to make a lib out of it? i searched google but got crap. can anyone help me with this? thanks.
f a fly walked, would it be called a walk?
Why dosn't someone make a word that rymes with purple or orange?
WHY AM I SO ANNOYING? Becuase I wanna!
Why am I typeing this? Cuz im bored!
Reply
#2
What compiler are you using? (And this should perhaps be in General Programming, no?)
Reply
#3
Well... it IS after all, help in qb. But I am using QB45, but I just stumbled over an ASM file that kinda showed me how to do this, but I still need more... eg how do I pass arguments! I wish I could find that one tutorial I found on this...
f a fly walked, would it be called a walk?
Why dosn't someone make a word that rymes with purple or orange?
WHY AM I SO ANNOYING? Becuase I wanna!
Why am I typeing this? Cuz im bored!
Reply
#4
Ah, you want to use a C++ library from QB?

You didn't specify what C++ compiler you're using, but I'll assume that you actually mean a C compiler (or a C++ compiler set to use regular C names instead of C++ mangling) - if not, you'll have to have some fun with assembly language. Also, I'll assume you have access to the C source code and can rebuild the library. Make sure the procedures are all UPPERCASE names because of the way QB does case-insensitive linking. Then declare the functions in QB as such:
Code:
/* C code */
int ADDNUMS(int a, int b) { return a + b };


''' QB code
DECLARE FUNCTION ADDNUM CDECL (BYVAL a AS INTEGER, BYVAL b AS INTEGER) AS INTEGER

And there you have it. Make sure you link with the C lib on the LINK command line (add it to the libraries section). You can use the LIB command to make a library out of .OBJs.
Reply
#5
ok, thanks, i will try that
f a fly walked, would it be called a walk?
Why dosn't someone make a word that rymes with purple or orange?
WHY AM I SO ANNOYING? Becuase I wanna!
Why am I typeing this? Cuz im bored!
Reply
#6
C++ is object oriented, Qbasic is not. That could cause you some headaches. Use C or ASM.
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Reply
#7
i think these URLs will be of interest for you
http://qbnz.com/dav/qbkb/Q35966.TXT
http://support.microsoft.com/search/defa...&x=12&y=13
am the last survivor of the Quickbasics world (at least at qbasicnews).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)