Mail Archives: djgpp/2000/01/23/10:10:45
Message-ID: | <388B06EA.D02633F@connection.com>
|
Date: | Sun, 23 Jan 2000 08:49:31 -0500
|
From: | sam <samirw AT connection DOT com>
|
X-Mailer: | Mozilla 4.6 [en] (Win95; I)
|
X-Accept-Language: | en
|
MIME-Version: | 1.0
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | creating libraries how?
|
NNTP-Posting-Host: | 216.13.30.64
|
X-Trace: | 23 Jan 2000 08:47:34 -0500, 216.13.30.64
|
Lines: | 96
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Ok, boys anyone that knows what I am doing? I don't.
I have the following source file TLFUNC.CC
-------------------------------------------------
#include "stdio.h"
#include "gppconio.h"
#include "fcntl.h"
#include "unistd.h"
#include "sys\stat.h"
#include "io.h"
#include "stdlib.h"
#include "string.h"
#include "pc.h" /*djgpp ScreenGetCursor() */
#include "libtl.h"
#include "key_def.h"
extern unsigned char ScreenAttrib;
void color_text( int row, int col, int forg, int bakg, char *string )
{
int orig_attr;
orig_attr = ScreenAttrib;
ScreenAttrib = (bakg<<4) + forg;
if ( !( (row == -1 ) || ( col == -1 ) ) )
gotoxy( col, row );
cputs( string );
textattr( orig_attr );
}
-------------------------------------
I have compiled it with:
d:\djgpp\applib\>gcc -c tlfunc.cc
Now I create library with:
d:\djgpp\applib\>ar -rs libtl.a tlfunc.cc
verify that the index is there by doing list: (with -t not -s
or -nm
as the first page of info ar suggests.)
d:\djgpp\applib\>ar -t libtl.a
(get tlfunc.o)
So, I try to build the following file: (maintest.cc)
------------------------------------------------------------------
#define COMPILE_GLOBALS
#include "dos.h"
#include "gppconio.h"
#include "libtl.h"
extern unsigned char ScreenAttrib;
int main( int argc, char *argv[] )
{
struct text_info tx_info;
_setcursortype( _NOCURSOR );
window(1, 1, 34, 25 );
gettextinfo( &tx_info );
color_text( 3, 20, 10, 2, "This it it." );
gettextinfo( &tx_info );
delay(1000);
color_text( 4, 21, 12, 2, "This it it.\r\nand here too." );
delay(1000);
_setcursortype( _NORMALCURSOR );
}
----------------------------------------------
With:
8:36:04.79
D:\DJGPP\mytests>gpp maintest.cc -I..\applib -L..\applib\tl -o
maintest.exe
d:/djgpp/tmp\ccM794sS.o(.text+0x6b):maintest.cc: undefined reference to
`color_t
ext(int, int, int, int, char *)'
d:/djgpp/tmp\ccM794sS.o(.text+0xa2):maintest.cc: undefined reference to
`color_t
ext(int, int, int, int, char *)'
collect2: ld returned 1 exit status
8:36:32.25
D:\DJGPP\mytests>
GCC is the same think.
BTW: which is the one that will pick language according to the extension
GCC | GPP.
Any suggestions greatly appreciated.
- Raw text -