Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!hcx1!ldh From: ldh@hcx1.SSD.HARRIS.COM Newsgroups: comp.lang.c Subject: TLINK errors (cc/lint were clean) Message-ID: <44100021@hcx1> Date: 1 Feb 89 16:30:00 GMT Lines: 56 Nf-ID: #N:hcx1:44100021:000:1194 Nf-From: hcx1.SSD.HARRIS.COM!ldh Feb 1 11:30:00 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 #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@hdw.harris.com