delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/02/03/08:03:10

From: Paul Harness <gapa83 AT udcf DOT gla DOT ac DOT uk>
Subject: ftime() problem with C++
To: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Date: Thu, 3 Feb 1994 12:50:59 +0000 (GMT)

Hello there,

I'm sure I must be doing something stupid here but I can't figure out
what. The following program (a libcref example):-

#include <sys/timeb.h>

main()
{
	struct timeb t;
	ftime(&t);

	return 0;
}

compiles fine as a C program. I want to use ftime() in my C++ programs
though and this causes a problem. When the above is compiled as C++, I
get

C:\MATCLASS>gcc -Wall test.cc -lgpp -lm
test.cc(.text+10): undefined reference to `ftime(timeb *)'

ar shows me that ftime.o is in libc.a. I've tried linking with -lc
explicitly but this doesn't seem to work either. Have I missed something
obvious? I'm newish to C++.

Many thanks in advance.

-- 
Paul Harness,                        |  Internet: gapa83 AT udcf DOT gla DOT ac DOT uk
Department of Physics and Astronomy, |
University of Glasgow,               |  Tel +44-41-339-8855 ext 8359
Glasgow, G12 8QQ, SCOTLAND.          |  Fax +44-41-334-9029

- Raw text -


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