This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

undefined reference to `_ctype_'


I am trying to use gcc-2.95.2 instead of Borland5 on a Win2K box to
produce an M$Windows program (which does compile and link without any
warnings under Borland5).

I get complaints about _ctype_ not being defined. I have searched the
include files in the source tree and indeed it doesn't appear to be
defined. The only declarations I have found are in
/cygnus/cygwin-b20/h-i586-cygwin32/i586-cygwin32/include/ctype.h where
it is declared extern. 

So I guess the compiler is right to complain about it. But still, I
percieve this as a bug: my stuff doesn't link under cygwin32. Maybe I
have to send this to a libstdc++ mailing list or so, but I have not
found such a list.

Here's the Makefile and the transcript of the compiler commands and its
output (I have used option -v with the final link pass only):

<Compilation Transcript>

cd c:/myProg/
make
g++ -Wall -W source1.cpp -c -o about.o
g++ -Wall -W manage.cpp -c -o manage.o
g++ -Wall -W files.cpp -c -o files.o
g++ -Wall -W boxes.cpp -c -o boxes.o
g++ -Wall -W help.cpp -c -o help.o
g++ -Wall -W curriculum.cpp -c -o curriculum.o
g++ -Wall -W prof.cpp -c -o prof.o
g++ -Wall -W registry.cpp -c -o registry.o
g++ -Wall -W roster.cpp -c -o roster.o
g++ -Wall -W year.cpp -c -o year.o
g++ -Wall -W course.cpp -c -o course.o
g++ -Wall -W winmain.cpp -c -o winmain.o
windres myProg.rc -O coff -o myProg.res
g++ -v -Wall -W -mwindows -e _mainCRTStartup about.o manage.o files.o
boxes.o help.o curriculum.o prof.o registry.o roster.o year.o course.o
winmain.o myProg.res -o myProg.exe
Reading specs from
/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2/specs
gcc version 2.95.2 19991024 (release)

/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2/collect2.exe
--subsystem windows -o myProg.exe -e _mainCRTStartup
/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2/../../../../i586-cygwin32/lib/crt0.o
-L/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2
-L/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib
-L/Cygnus/cygwin-b20/H-i586-cygwin32/lib/gcc-lib/i586-cygwin32/2.95.2
-L/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2/../../../../i586-cygwin32/lib
-L/Cygnus/cygwin-b20/H-i586-cygwin32/lib/gcc-lib/i586-cygwin32/2.95.2/../../../../i586-cygwin32/lib
-L/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2/../../..
-L/Cygnus/cygwin-b20/H-i586-cygwin32/lib/gcc-lib/i586-cygwin32/2.95.2/../../..
about.o manage.o files.o boxes.o help.o curriculum.o prof.o registry.o
roster.o year.o course.o winmain.o myProg.res -lstdc++ -lm -lgcc
-lcygwin -lgdi32 -lcomdlg32 -luser32 -lkernel32 -ladvapi32 -lshell32
-lgcc
/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2/libstdc++.a(iostream.o)(.text+0x145):
undefined reference to `_ctype_'
/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2/libstdc++.a(iostream.o)(.text+0x512):
undefined reference to `_ctype_'
/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2/libstdc++.a(iovfscanf.o)(.text+0x61):
undefined reference to `_ctype_'
/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2/libstdc++.a(iovfscanf.o)(.text+0x8e):
undefined reference to `_ctype_'
/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2/libstdc++.a(iovfscanf.o)(.text+0x516):
undefined reference to `_ctype_'
/cygnus/CYGWIN~1/H-I586~1/bin/../lib/gcc-lib/i586-cygwin32/2.95.2/libstdc++.a(iovfscanf.o)(.text+0x580):
more undefined references to `_ctype_' follow
collect2: ld returned 1 exit status
make: *** [myProg.exe] Error 1

Compilation exited abnormally with code 2 at Sun Jan 23 23:24:10

</Compilation Transcript>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]