| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Libraries |
G'Day Keith,
-=> Quoting Keith Fowler to All <=-
KF> Hello.. I have just bought Turbo C/C++ Version 3.0 for DOS, and i
KF> was wondering how i use a library?? (not one of the ones include)..
KF> The Library is some comm routines.. Now, i know you can link it with
KF> your program using ther command line (TLINK? ).. But if so, when ya
KF> write ya code in the IDE, when ya run it, ya wouldn't be able to
KF> test... So, if ya can use a library beside the command line, could you
KF> please post a detailed set of instruction (as long as they get the job
KF> done really :-), so that i can use this library.. Thanks, Bye
Easy enough, you have to put the library into a project.
I assume things haven't changed much in the IDE since V2.
You may have a .lib or a .c or .cpp library, but they all work the same
way.
1. Start a new project and add your source code to it. If you don't have
the source yet, you can just type in a filename and open it later.
You will need that source there, as libraries will not compile alone,
because they don't (actually better not) have a main() function in them.
2. Add the library module to the project also.
3. The lib file came with at least one header, so declare the header in
your source #include "hislib.h", but do not add it to the project
window.
Btw, headers that are not in the normal include paths are included with
double quotes #include "path\myheader.h" instead of #include
.
Finally add a main() function to your code.
Should compile now, and the functions will be available from the library..
Mind you, i don't like libraries which come as .lib files only.They can
not be changed,or viewed, you can not trace into them and you're stuck
with the authors naming convention, which sometimes can drive you nuts.
L8r Frank (fadam{at}ozemail.com.au).
___ Blue Wave/DOS v2.21
--- Maximus 3.01
* Origin: The Software Parlour (3:635/544)SEEN-BY: 50/99 620/243 623/630 632/349 635/503 544 727 711/401 409 410 413 SEEN-BY: 711/430 808 809 932 934 712/515 713/888 714/906 800/1 @PATH: 635/544 50/99 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.