Message-Id: <000e01bf25d1$0469d320$551f708c@csie.ntu.edu.tw> From: =?big5?B?rdu6+y+kcKjfpGw=?= To: Subject: Linking problem Date: Wed, 3 Nov 1999 15:57:03 +0800 Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000B_01BF2614.12424E80" 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
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).
 Then I use gxx -o test.exe *.o to link. There = is a=20 linking error:
 
    = TDT3_I_10.o(.text+0x1195):TDT3_I_10.cc:=20 undefined reference to 'mytag(FILE*,FILE*)'
 
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++)
I use nm to see the content of my mytagf.o, then I=20 get:
 
00000d00 b .bss
00000bfc d .data
00000000 t=20 .text
000002bb t L1
00000314 t L10
000004b0 t L11
000004a8 t = L12
00000324 t L13
00000418 t L14
000004a8 t L15
00000590 t=20 L16
000004b4 t L17
000004d4 t L18
000004f8 t L19
000001ad t=20 L2
00000518 t L20
0000054c t L21
00000688 t L23
000005d4 t=20 L24
00000678 t L25
000005e4 t L26
000005eb t L27
00000628 t=20 L28
00000620 t L29
00000250 t L3
0000061c t L30
00000bf4 t=20 L31
0000070c t L32
00000714 t L33
00000860 t L34
00000857 t=20 L35
00000728 t L36
000008a8 t L37
00000933 t L38
000008f0 t=20 L39
000001d4 t L4
00000933 t L40
00000933 t L41
0000095e t=20 L42
000009b8 t L43
000009b0 t L44
00000970 t L45
000009cd t=20 L46
00000a5c t L47
00000a52 t L48
000009e0 t L49
000001d0 t=20 L5
00000a52 t L50
00000aae t L51
00000be0 t L52
00000bd7 t=20 L53
00000ac4 t L54
00000bd7 t L55
00000266 t L6
0000027c t=20 L7
0000059c t L8
0000030c t L9
00000000 t LC0
00000041 t=20 LC1
000002bd t LC10
0000068a t LC11
000006bc t LC12
000006be = t=20 LC13
000006c0 t LC14
000006c2 t LC15
000006c4 t = LC16
000006c7 t=20 LC17
000006c9 t LC18
00000047 t LC2
0000007d t LC3
00000082 = t=20 LC4
000000b0 t LC5
000000b6 t LC6
000000ee t LC7
000000f1 t=20 LC8
000000f8 t = LC9
         U=20 ERR_FP
00000bfc d FLAG_TAGSET_TYPE
00000c00 D = HTML_Base_Url
00000004 C=20 Input_File_Name
00000d00 b Source_Words.4
00001d00 b=20 Target_Words.5
0000e418 b WPR_Table_Ptr
0000e610 b=20 Word_Chunk_Table
00002d00 b=20 Word_Proc_Records
         U=20 __dj_stderr
00000000 t=20 __gnu_compiled_c
         U=20 close_ckip_tables
         U=20 fclose
         U=20 fprintf
         U = fscanf
000002e8=20 T mt_html_exam
000005a4 T=20 mt_model_exam
         U=20 mt_model_glossary_v35
000006cc T=20 mt_snt_mt_main_exam
         = U=20 mtir_close
         U=20 mtir_initialization
00000104 T=20 mytag
         U=20 open_ckip_tables
00000004 C=20 out_fp
         U=20 printf
         U=20 set_char_ngram_model
         = U=20 snt_search_word
         U=20 snt_tagging_HMM
         U=20 snt_tagging_by_morph_tagid
       &= nbsp; U=20 snt_tagging_by_rule
         = U=20 snt_terminator
         U=20 strcmp
         U = strcpy
00000000=20 t gcc2_compiled.
 
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?
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=3D= C:\DJGPP\DJGPP.ENV
PATH=3DC:\DJGPP\BIN;C:\PROGRA~1\ULTRAEDT;C:\WINDOWS= ;C:\WINDOWS\COMMAND
windir=3DC:\WINDOWS
SNDSCAPE=3DC:\WINDOWS
BL= ASTER=3DA220=20 I7 D1 T2
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

output of go32-v2 is as=20 follow:
 
go32/v2 version 2.0 built Aug 12 1996 = 22:27:23
Usage: go32=20 coff-image [args]
Rename this to go32.exe only if you need a go32 = that can=20 run v2 binaries as
 well as v1 binaries (old makefiles).  = Put ahead=20 of the old go32 in your PATH
 but do not delete your old go32 - = leave it=20 in the PATH after this one.
Set GO32_V2_DEBUG=3Dy in the environment = to get=20 verbose output.
 
DPMI memory available: 63167 Kb
DPMI swap space = available:=20 64909 Kb
I really need someone's HELP!! Please help me!! = Thank you very=20 much...  
------=_NextPart_000_000B_01BF2614.12424E80--