mingw32, winsock.h and g++ - problem

Mumit Khan khan@xraylith.wisc.edu
Fri Oct 1 00:00:00 GMT 1999


In article < Pine.GSO.3.96.990831185737.14091O-100000@petunia.ce.chalmers.se >,
Robert Feldt  <feldt@ce.chalmers.se> wrote:
>
>Hi,
>
>I'm trying to compile and link a C++-program using winsock.h with the
>mingw32 headers and libs and gcc 2.95 (assembled by Mumit Khan).
>Compilation is fine but there seems to be a problem with the name mangling
>during linking:

[ Posted and copied to Robert Feldt  <feldt@ce.chalmers.se> ]

This is a known problem (sure, now I tell you ;-). Please visit 
  http://www/~khan/software/gnu-win32/gcc.html#gcc295-fixes
to see others like this.

Some of the w32api include files (all the win*.h files) are missing
the ``extern "C"'' wrapper. ie., you need to wrap winsock.h in the
following wrapper.
  
  #ifdef __cplusplus
  extern "C" {
  #endif

  /* file here. */

  #ifdef __cplusplus
  }
  #endif

Regards,
Mumit



More information about the Gcc-help mailing list