LNK2019 unresolved external symbol error

Hello,

I have some problems with a source code I want to compile. I get the following error message:

dna.obj : error LNK2019: unresolved external symbol "_time@4" in function "_ins_pend_conn@28"

I have not much experience with C++ especially with Visual Studio (2010) and all the configuration parameters you have to set there. But as far as I got from my internet search the error indicates that a variable declaration could not be found. I am pretty sure I have all the files, so I guess I have to do more then just press "Build" :)

To make things a bit easier I can provide you with the source code I am talking about. I downloaded it from (windows version):

http://dim.web.cern.ch/dim/

and then went to /Visual and opened dimStd.vcproj.

I also tried to set a lot of these configuration paramaters (included additional search paths for libraries etc.) but without any success.

It would be realy great if an expert would find some time to help me with that.

Thanks and Greetings
Dennis
You should include time.h, rather than define time() yourself.
1
2
3
4
5
6
7
static int ins_pend_conn( char *node, char *task, int port, SRC_TYPES src_type, int type, time_t last_used )
{
	register PENDING_OPEN *pending_connp;
	register int i, size;
	time_t oldest;
	int oldesti = 0;
	extern time_t time();

Thanks a lot. It worked.

I am just a bit puzzled why a change in the source code was necessary since I thought that the original source code was already tested and compiled. But who cares:)

Greetings Dennis
MSVC supports a 32bit and 64bit time_t. So there's all this stuff around deciding which one you're actually using, and that complicates the definition.
Topic archived. No new replies allowed.