Archived

This forum has been archived. Please start a new discussion on GitHub.

Visual C++ linking problems...issues with Cygwin?

Hi all, downloaded Ice-3.1.1-VC60 and tried to make the Printer program in section 3.3 of the manual.

At first I had to mask Cygwin's link.exe to get VC++'s link.exe to work properlly (which took much head scratching). Now, I run into the following errors:

C:\Program files\Ice-3.1.1-VC60\include\Ice\Config.h(29): Could not find the file unistd.h.
C:\Program files\Ice-3.1.1-VC60\include\stlport\pthread.h(24): Could not find the file /usr/include/pthread.h.
C:\Program files\Ice-3.1.1-VC60\include\IceUtil\Time.h(16): Could not find the file sys/time.h.

...

Printer.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall IceInternal::GCRecMutexInit::GCRecMutexInit(void)" (__imp_??0GCRecMutexInit@IceInternal@@QAE@XZ)
Server.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall IceInternal::GCRecMutexInit::GCRecMutexInit(void)" (__imp_??0GCRecMutexInit@IceInternal@@QAE@XZ)
Printer.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall IceInternal::GCRecMutexInit::~GCRecMutexInit(void)" (__imp_??1GCRecMutexInit@IceInternal@@QAE@XZ)

I modeled the compiler parameters on those in the demo directory (e.g. got /MDd in there) but I suspect it has something to do with the library definitions. Would appreciate it if people would share their hacks around Cygwin/VC++ incompatability.

Comments

  • marc
    marc Florida
    It appears you are not compiling with Visual C++. Visual C++ doesn't have pthreads or the other include files that are missing. Perhaps you are using gcc with cygwin? If so, this is not a supported compiler/platform combination.
  • Reply

    I took all cygwin references out of my batch file to start VC++ to no avail...where else could Cygwin be creeping up? Is there anyway of seeing what compiler, linker, etc. is being called?
  • marc
    marc Florida
    I'm afraid I can't help you with that, all I know is that this is not Visual C++. Have a look at include/Ice/Config.h. There you'll find:
    #if defined(_WIN32)
    #   include <process.h>
    #else
    #   include <sys/types.h>
    #   include <unistd.h>
    #endif
    

    Visual C++ defines _WIN32, so no unistd.h would be included if you would use the correct compiler.