delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/04/00:09:58

Message-Id: <000e01bf25d1$0469d320$551f708c@csie.ntu.edu.tw>
From: =?big5?B?rdu6+y+kcKjfpGw=?= <lwku AT nlg2 DOT csie DOT ntu DOT edu DOT tw>
To: <djgpp AT delorie DOT com>
Subject: Linking problem
Date: Wed, 3 Nov 1999 15:57:03 +0800
Mime-Version: 1.0
X-Priority: 3
X-Msmail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2314.1300
X-Mimeole: Produced By Microsoft MimeOLE V5.00.2314.1300
Reply-To: djgpp AT delorie DOT com

This is a multi-part message in MIME format.

------=_NextPart_000_000B_01BF2614.12424E80
Content-Type: text/plain;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

I have a problem in linking. I use gcc -c *.c *.cc to compile my source =
code(one c file, and other c++ files).
 Then I use gxx -o test.exe *.o to link. There is a linking error:

    TDT3_I_10.o(.text+0x1195):TDT3_I_10.cc: undefined reference to =
'mytag(FILE*,FILE*)'

mytag(FILE*,FILE*)is in mytagf.c and I link mytagf.o with other .o files =
from .cc files (that is , except mytagf.c ,all other files are written =
in c++)
I use nm to see the content of my mytagf.o, then I get:

00000d00 b .bss
00000bfc d .data
00000000 t .text
000002bb t L1
00000314 t L10
000004b0 t L11
000004a8 t L12
00000324 t L13
00000418 t L14
000004a8 t L15
00000590 t L16
000004b4 t L17
000004d4 t L18
000004f8 t L19
000001ad t L2
00000518 t L20
0000054c t L21
00000688 t L23
000005d4 t L24
00000678 t L25
000005e4 t L26
000005eb t L27
00000628 t L28
00000620 t L29
00000250 t L3
0000061c t L30
00000bf4 t L31
0000070c t L32
00000714 t L33
00000860 t L34
00000857 t L35
00000728 t L36
000008a8 t L37
00000933 t L38
000008f0 t L39
000001d4 t L4
00000933 t L40
00000933 t L41
0000095e t L42
000009b8 t L43
000009b0 t L44
00000970 t L45
000009cd t L46
00000a5c t L47
00000a52 t L48
000009e0 t L49
000001d0 t L5
00000a52 t L50
00000aae t L51
00000be0 t L52
00000bd7 t L53
00000ac4 t L54
00000bd7 t L55
00000266 t L6
0000027c t L7
0000059c t L8
0000030c t L9
00000000 t LC0
00000041 t LC1
000002bd t LC10
0000068a t LC11
000006bc t LC12
000006be t LC13
000006c0 t LC14
000006c2 t LC15
000006c4 t LC16
000006c7 t LC17
000006c9 t LC18
00000047 t LC2
0000007d t LC3
00000082 t LC4
000000b0 t LC5
000000b6 t LC6
000000ee t LC7
000000f1 t LC8
000000f8 t LC9
         U ERR_FP
00000bfc d FLAG_TAGSET_TYPE
00000c00 D HTML_Base_Url
00000004 C Input_File_Name
00000d00 b Source_Words.4
00001d00 b Target_Words.5
0000e418 b WPR_Table_Ptr
0000e610 b Word_Chunk_Table
00002d00 b Word_Proc_Records
         U __dj_stderr
00000000 t __gnu_compiled_c
         U close_ckip_tables
         U fclose
         U fprintf
         U fscanf
000002e8 T mt_html_exam
000005a4 T mt_model_exam
         U mt_model_glossary_v35
000006cc T mt_snt_mt_main_exam
         U mtir_close
         U mtir_initialization
00000104 T mytag
         U open_ckip_tables
00000004 C out_fp
         U printf
         U set_char_ngram_model
         U snt_search_word
         U snt_tagging_HMM
         U snt_tagging_by_morph_tagid
         U snt_tagging_by_rule
         U snt_terminator
         U strcmp
         U strcpy
00000000 t gcc2_compiled.

It seems that there is the function mytag(FILE*,FILE*). Why can't my c++ =
obj file see the c obj file? Can I link c++ and c files into a .exe =
files?=20
What should I do?
Is there any environmental setup I haven't done?

My environ.lst is as follow:

TMP=3DC:\WINDOWS\TEMP
TEMP=3DC:\WINDOWS\TEMP
PROMPT=3D$p$g
winbootdir=3DC:\WINDOWS
COMSPEC=3DC:\WINDOWS\COMMAND.COM
DJGPP=3DC:\DJGPP\DJGPP.ENV
PATH=3DC:\DJGPP\BIN;C:\PROGRA~1\ULTRAEDT;C:\WINDOWS;C:\WINDOWS\COMMAND
windir=3DC:\WINDOWS
SNDSCAPE=3DC:\WINDOWS
BLASTER=3DA220 I7 D1 T2=20
CMDLINE=3Dgxx -o TDT.exe mytagf.o TDT3_I_10.o GetF_I.o Topic.o hash.o =
feature.o stoplist.o tools.o m-mtlib.a

output of go32-v2 is as follow:

go32/v2 version 2.0 built Aug 12 1996 22:27:23
Usage: go32 coff-image [args]
Rename this to go32.exe only if you need a go32 that can run v2 binaries =
as
 well as v1 binaries (old makefiles).  Put ahead of the old go32 in your =
PATH
 but do not delete your old go32 - leave it in the PATH after this one.
Set GO32_V2_DEBUG=3Dy in the environment to get verbose output.

DPMI memory available: 63167 Kb
DPMI swap space available: 64909 Kb

I really need someone's HELP!! Please help me!! Thank you very much... =20

------=_NextPart_000_000B_01BF2614.12424E80
Content-Type: text/html;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dbig5" http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>I have a problem in linking. I use gcc -c *.c *.cc =
to compile=20
my source code(one c file, and other c++ files).</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;Then I use gxx -o test.exe *.o to link. There =
is a=20
linking error:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp; =
TDT3_I_10.o(.text+0x1195):TDT3_I_10.cc:=20
undefined reference to 'mytag(FILE*,FILE*)'</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>mytag(FILE*,FILE*)is in mytagf.c and I link mytagf.o =
with=20
other .o files from .cc files (that is , except mytagf.c ,all other =
files are=20
written in c++)</FONT></DIV>
<DIV><FONT size=3D2>I use nm to see the content of my mytagf.o, then I=20
get:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>00000d00 b .bss<BR>00000bfc d .data<BR>00000000 t=20
.text<BR>000002bb t L1<BR>00000314 t L10<BR>000004b0 t L11<BR>000004a8 t =

L12<BR>00000324 t L13<BR>00000418 t L14<BR>000004a8 t L15<BR>00000590 t=20
L16<BR>000004b4 t L17<BR>000004d4 t L18<BR>000004f8 t L19<BR>000001ad t=20
L2<BR>00000518 t L20<BR>0000054c t L21<BR>00000688 t L23<BR>000005d4 t=20
L24<BR>00000678 t L25<BR>000005e4 t L26<BR>000005eb t L27<BR>00000628 t=20
L28<BR>00000620 t L29<BR>00000250 t L3<BR>0000061c t L30<BR>00000bf4 t=20
L31<BR>0000070c t L32<BR>00000714 t L33<BR>00000860 t L34<BR>00000857 t=20
L35<BR>00000728 t L36<BR>000008a8 t L37<BR>00000933 t L38<BR>000008f0 t=20
L39<BR>000001d4 t L4<BR>00000933 t L40<BR>00000933 t L41<BR>0000095e t=20
L42<BR>000009b8 t L43<BR>000009b0 t L44<BR>00000970 t L45<BR>000009cd t=20
L46<BR>00000a5c t L47<BR>00000a52 t L48<BR>000009e0 t L49<BR>000001d0 t=20
L5<BR>00000a52 t L50<BR>00000aae t L51<BR>00000be0 t L52<BR>00000bd7 t=20
L53<BR>00000ac4 t L54<BR>00000bd7 t L55<BR>00000266 t L6<BR>0000027c t=20
L7<BR>0000059c t L8<BR>0000030c t L9<BR>00000000 t LC0<BR>00000041 t=20
LC1<BR>000002bd t LC10<BR>0000068a t LC11<BR>000006bc t LC12<BR>000006be =
t=20
LC13<BR>000006c0 t LC14<BR>000006c2 t LC15<BR>000006c4 t =
LC16<BR>000006c7 t=20
LC17<BR>000006c9 t LC18<BR>00000047 t LC2<BR>0000007d t LC3<BR>00000082 =
t=20
LC4<BR>000000b0 t LC5<BR>000000b6 t LC6<BR>000000ee t LC7<BR>000000f1 t=20
LC8<BR>000000f8 t =
LC9<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
ERR_FP<BR>00000bfc d FLAG_TAGSET_TYPE<BR>00000c00 D =
HTML_Base_Url<BR>00000004 C=20
Input_File_Name<BR>00000d00 b Source_Words.4<BR>00001d00 b=20
Target_Words.5<BR>0000e418 b WPR_Table_Ptr<BR>0000e610 b=20
Word_Chunk_Table<BR>00002d00 b=20
Word_Proc_Records<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
__dj_stderr<BR>00000000 t=20
__gnu_compiled_c<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
close_ckip_tables<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
fclose<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
fprintf<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U =
fscanf<BR>000002e8=20
T mt_html_exam<BR>000005a4 T=20
mt_model_exam<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
mt_model_glossary_v35<BR>000006cc T=20
mt_snt_mt_main_exam<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
U=20
mtir_close<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
mtir_initialization<BR>00000104 T=20
mytag<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
open_ckip_tables<BR>00000004 C=20
out_fp<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
printf<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
set_char_ngram_model<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
U=20
snt_search_word<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
snt_tagging_HMM<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
snt_tagging_by_morph_tagid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp; U=20
snt_tagging_by_rule<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
U=20
snt_terminator<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U=20
strcmp<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U =
strcpy<BR>00000000=20
t gcc2_compiled.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>It seems that there is the function =
mytag(FILE*,FILE*). Why=20
can't my c++ obj file see the c obj file? Can I link c++ and c files =
into a .exe=20
files? </FONT></DIV>
<DIV><FONT size=3D2>What should I do?</FONT></DIV>
<DIV><FONT size=3D2>Is there any environmental setup I haven't =
done?</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>My environ.lst is as follow:</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT=20
size=3D2>TMP=3DC:\WINDOWS\TEMP<BR>TEMP=3DC:\WINDOWS\TEMP<BR>PROMPT=3D$p$g=
<BR>winbootdir=3DC:\WINDOWS<BR>COMSPEC=3DC:\WINDOWS\COMMAND.COM<BR>DJGPP=3D=
C:\DJGPP\DJGPP.ENV<BR>PATH=3DC:\DJGPP\BIN;C:\PROGRA~1\ULTRAEDT;C:\WINDOWS=
;C:\WINDOWS\COMMAND<BR>windir=3DC:\WINDOWS<BR>SNDSCAPE=3DC:\WINDOWS<BR>BL=
ASTER=3DA220=20
I7 D1 T2 <BR>CMDLINE=3Dgxx -o TDT.exe mytagf.o TDT3_I_10.o GetF_I.o =
Topic.o hash.o=20
feature.o stoplist.o tools.o m-mtlib.a</FONT></DIV>
<DIV><FONT size=3D2><BR></FONT><FONT size=3D2>output of go32-v2 is as=20
follow:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>go32/v2 version 2.0 built Aug 12 1996 =
22:27:23<BR>Usage: go32=20
coff-image [args]<BR>Rename this to go32.exe only if you need a go32 =
that can=20
run v2 binaries as<BR>&nbsp;well as v1 binaries (old makefiles).&nbsp; =
Put ahead=20
of the old go32 in your PATH<BR>&nbsp;but do not delete your old go32 - =
leave it=20
in the PATH after this one.<BR>Set GO32_V2_DEBUG=3Dy in the environment =
to get=20
verbose output.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>DPMI memory available: 63167 Kb<BR>DPMI swap space =
available:=20
64909 Kb<BR></FONT></DIV>
<DIV><FONT size=3D2>I really need someone's HELP!! Please help me!! =
Thank you very=20
much... </FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_000B_01BF2614.12424E80--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019