Menu

Link Errors compiling 1.3.1 on Windows

Help
Anonymous
2001-01-04
2001-01-04
  • Anonymous

    Anonymous - 2001-01-04

    Hello -
    I just downloaded CommonC++ 1.3.1 and tried to compile it using MS VC++ 6.0(on Win98 OS) using the default project file included, and received these link errors:

    enerating Code...
    Linking...
       Creating library Debug/CCXX32d.lib and object Debug/CCXX32d.exp
    Buffer.obj : error LNK2001: unresolved external symbol "enum throw_t  __cdecl getException(void)" (?getException@@YA?AW4throw_t@@XZ)
    Inaddr.obj : error LNK2001: unresolved external symbol "enum throw_t  __cdecl getException(void)" (?getException@@YA?AW4throw_t@@XZ)
    Socket.obj : error LNK2001: unresolved external symbol "enum throw_t  __cdecl getException(void)" (?getException@@YA?AW4throw_t@@XZ)
    Debug/CCXX32d.dll : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    CCXX32d.dll - 4 error(s), 0 warning(s)

    Anyone know why this doesnt work?

     
    • Anonymous

      Anonymous - 2001-01-04

      I found the problem.  The code was missing the definitions of getException(), which is defined in posix/friends.cpp.  friends.cpp is not included in the win32 directory.  I moved it over there, but then got compile errors, so I took out everything but bare bones:

      <begin friends.cpp>
      #include "config.h"
      #include "macros.h"
      #include "thread.h"
      #include <stdlib.h>
      #include <time.h>

      #ifdef    SIGTSTP
      #include <sys/file.h>
      #include <sys/ioctl.h>
      #endif

      #ifndef    _PATH_TTY
      #define    _PATH_TTY "/dev/tty"
      #endif

      void setException(throw_t mode)
      {
          Thread *thread = getThread();
          thread->_throw = mode;
      }

      throw_t getException(void)
      {
          Thread *thread = getThread();
          return thread->_throw;
      }
      <end friend.cpp>

      Now everything is compiling, dont know yet about run-time.

      Why did I have to do this?

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.