hymanho at [EMAIL PROTECTED] wrote:
> In my C++ project, function "NetUReadN()" has been called, I have include
> the "NetSock.lib", but when I make that project, one error was show as follow:
>
> "Link error :example.cpp : 'NetUReadN(short, unsigned char*,unsigned
> long)' reference from 'Main()' is undefined".
>
>
>
> who can tell me what will I do to solve this problem? Thanks!
I haven't used NetSock.lib myself, but here's a guess.
The routines in NetSock.lib are C routines, not C++ routines. The NetSock
header file needs to be careful if it is loaded by a C++ compiler to ensure
that the library entry points are defined as C routines and not C++
routines.
Most header files do it like this:
#ifdef __cplusplus
extern "C" {
#endif
// Function declarations go here
#ifdef __cplusplus
}
#endif
If the header file that you're using doesn't do this, you either need to
edit it yourself or change your include to be like this:
extern "C" {
#include "NetSock.h"
}
Like I said, this is just a guess.
Best of luck,
--Stuart A. Malone
Llamagraphics, Inc.
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/