Date: Thu, 23 Aug 2001 12:05:54 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: kvogt AT UVic DOT CA Message-Id: <8011-Thu23Aug2001120553+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: (kvogt AT UVic DOT CA) Subject: Re: gcc 'undefined reference' error References: <3405-Thu23Aug2001084102+0300-eliz AT is DOT elta DOT co DOT il> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: > Newsgroups: comp.os.msdos.djgpp > Date: Thu, 23 Aug 2001 00:17:21 -0700 > > I am trying to use > a program called PCTimer, which uses the following functions that my > linker has trouble with. Some of these are declared in pc.h; I should have > used one of them, rather than ScreenMode(), in my example. > > __dpmi_simulate_real_mode_interrupt > __dpmi_simulate_real_mode_procedure_iret > _go32_dpmi_allocate_real_mode_callback_iret > > [more functions omitted] This is a sign of an installation problem, since all these functions are in DJGPP's libc.a. > I also posted my verbose gcc output at the same location. I named it > 'gcc.txt'. And this was the key to unlock the problem: you have RSXNTDJ installed, and thus the compiler was using RSXNT libraries, not DJGPP libraries. I'm guessing that you have C_INCLUDE_PATH and LIBRARY_PATH variables set in the environment which point to the RSXNTDJ directories. These variables force the compiler and linker to use RSXNT headers and libraries, and that's why you have unresolved references. Here's the relevant line from the output produced by "gcc -v": > c:/djgpp/bin/ld.exe -o test.exe c:/djgpp/lib/crt0w32.o -Lc:/djgpp/lib/st -Lc:/djgpp/lib -Lc:/djgpp/lib/gcc-lib/djgpp/2.953 -Lc:/djgpp/bin -Lc:/djgpp/lib/st -Lc:/djgpp/lib c:/djgpp/tmp\ccezkpvS.o c:/djgpp/tmp\ccYLEN9l.o -lpc -lalias -lgcc -lc -lmain -lc_app -lc -lgcc -lemx -lkrn32 -lusr32 -lgdi32 -lemx2 -Trsxnt.djl Note the telltale "-Trsxnt.djl" at the end of this line, as well as libraries such as -lgdi32 and -lkrn32 -- these are Windows libraries. Solution: remove the above-mentioned environment variables, and DJGPP should start working again. > I just installed DJGPP today, using the following zip files: > alleg312.zip > bnu2112b.zip > djdev203.zip > em2005b.zip > em2005li.zip > faq230b.zip > fil40s.zip > gcc2953b.zip > gpp2953b.zip > grx243s.zip > mak3791b.zip > rh1478b.zip > rsxdj151.zip > txi40b.zip These are all okay. The Allegro library is a bit old, though; you might wish to look for a newer version if you intend to work seriously with Allegro. But Allegro has nothing to do with your current inability to link programs such as PCTimer.