Error while compiling.


  • I got this two errors while compiling my whole project :

    1.error LNK2019: unresolved external symbol _sleep referenced in function _Error
    2. fatal error LNK1120: 1 unresolved externals

    Can some one please help, thanx

    Sunday, October 2, 2005 5:28 AM


All replies

  • Hi,

    can you provide some more detailed information, like source code 3rd party dll's you use etc. ?

    Sunday, October 2, 2005 12:25 PM
  • I don't really have enough context to be 100% certain as to what the problem is but my first thought would be that if your program is calling the following method

    void sleep(unsigned int);

    from stdlib.h then your program needs to link against libcmt.lib
    Sunday, October 2, 2005 1:15 PM
  • Thanks to both of you for your replies,

    I actually sorted out the problem this afternoon, the previous error is result of duplicated main( ).
    The second one i guess you guys were correct on sleep( ), i tried with sleep( ) and Sleep( ) but it did not work.
    Actually i am a java programmer, but i need to use this 3rd party code which is written in C and integrate to my java project. As the result facing problem in C.

    Now i face a new problem: the include file sys/times.h. MS 2003 and other window-base compiler does not have this file. But some said that put the header file is not enough but i need to have the .lib and linker for that as well. So i am stuck

    Any suggestion would be very much appreciated

    Sunday, October 2, 2005 3:22 PM
  • Sunday, October 2, 2005 8:36 PM
  • What method(s) do you need for sys\times.h? Visual C++ 2005 ships with a sys\utime.h and a sys\timeb.h. The chances are that the function(s) you need is/are in these header files.
    Sunday, October 2, 2005 8:36 PM