TLINK errors (cc/lint were clean)

ldh at hcx1.SSD.HARRIS.COM ldh at hcx1.SSD.HARRIS.COM
Thu Feb 2 02:30:00 AEST 1989


Here's one for the UNIX gurus who also know something about TurboC ...

Have a modularized program lint/cc do not object to the various modules ... TC2
on the other hand does.

basically:

header.h:
#include <stdio.h>
#include <       >  		(a bunch of includes)

int a,b,c,d,e,f,g,h;
float i,j,k,l,m,n,o,p;
char q,r,s,t,u,v;
struct 				(a few)

#define ABC	abc 		(a few)

main.c:
#include "header.h"
main()
{
/* some program */
}

module_a.c:
#include "header.h"
function abc()
{
}

module_b.c
#include "header.h"
function def()
{
}

When invoked as follows, the TurboC 2.0 linker has a 2 major objections:
    tlink \tc2\lib\c0m main module_a module_b,prog,prog,,\tc2\lib\cm


1) variables defined in header.h get linker error messages as follows:
Error: _A defined in module MAIN.C is duplicated in module MODULE_A.C
Error: _A defined in module MAIN.C is duplicated in module MODULE_B.C

2) Certain basic stuff ends up being "undefined"
Undefined symbol '_FOPEN' in module MAIN.C
Undefined symbol '_PRINTF' in module MAIN.C

What is going on?!  This is the first time I have tried anything modularized on
TC2 ... 

Any assistance would be greatly appreciated

Leo Hinds		ldh at hdw.harris.com



More information about the Comp.lang.c mailing list