I am posting two threads because I have two different problems, but both have the same background information.
Common Background Information:
I am trying to rebuild code for a working, commercially sold application with only partial build instructions. The previous maintainer of the code (a
mixture of C and C++) is no longer with the company, but when he built the code he used MSVC++, and though I am not certain of the version he was
using, I think it was either 4.0 or 6.0. I have only a little experience building with this environment (I am otherwise a seasoned developer) so I need
help getting past a couple of issues that I have encountered. Computers (and backups of those computers) previously used for running this build are
now completely unavailable.
I have set up the build on my system using MSVC++ 6.0. The source repository contained a workspace (.dsw) file that I am using for all of the projects. I
do not have specific instructions for this product on how to adjust the references to libraries, includes, etc. for a particular machine, but I am using
instructions for this from a similar (in terms of languages and tools used) product that was written around the same time. I have gotten 43 of 53 classes
(projects) to build, but am getting primarily two errors with the remaining 10 clases (projects).
Because I know this code base was building properly (for someone else who is no longer available on a machine that is no longer available), I would
strongly prefer adjustments to the build environment over code modification to get it to work, so please focus your assistance/suggestions in this area.
Thanks !
Problem #2: Getting Winsock.h instead of Winsock2.h
Here is part of the output I am receiving when I build:
Here are lines 701 through 730 of srvsys.c:
The WSA stuff is only in Winsock2.h, but for some reason I am getting Winsock.h. I know this for two reasons: 1) the error messages (see above)
indicate it, and 2) when I right click on SOCKET (in line 704 or in line 714) and chose "Go to Definition of SOCKET" it takes me to Winsock.H (not
Winsock2.h).
So the question is, "How am I getting Winsock.h when I know the code is designed and was previously built using Winsock2.h?"
Any thoughts or suggestions from an experienced MSVC++ user would be greatly appreciated.
Common Background Information:
I am trying to rebuild code for a working, commercially sold application with only partial build instructions. The previous maintainer of the code (a
mixture of C and C++) is no longer with the company, but when he built the code he used MSVC++, and though I am not certain of the version he was
using, I think it was either 4.0 or 6.0. I have only a little experience building with this environment (I am otherwise a seasoned developer) so I need
help getting past a couple of issues that I have encountered. Computers (and backups of those computers) previously used for running this build are
now completely unavailable.
I have set up the build on my system using MSVC++ 6.0. The source repository contained a workspace (.dsw) file that I am using for all of the projects. I
do not have specific instructions for this product on how to adjust the references to libraries, includes, etc. for a particular machine, but I am using
instructions for this from a similar (in terms of languages and tools used) product that was written around the same time. I have gotten 43 of 53 classes
(projects) to build, but am getting primarily two errors with the remaining 10 clases (projects).
Because I know this code base was building properly (for someone else who is no longer available on a machine that is no longer available), I would
strongly prefer adjustments to the build environment over code modification to get it to work, so please focus your assistance/suggestions in this area.
Thanks !
Problem #2: Getting Winsock.h instead of Winsock2.h
Here is part of the output I am receiving when I build:
Compiling...
srvsys.c
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 1) : error C2065: 'WSANETWORKEVEN TS' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 1) : error C2146: syntax error : missing ';' before identifier 'netevents'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 1) : error C2065: 'netevents' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 2) : error C2275: 'DWORD' : illegal use of this type as an expression
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\win def.h(141) : see declaration of 'DWORD'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 2) : error C2146: syntax error : missing ';' before identifier 'wait_value'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 2) : error C2065: 'wait_value' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 2) : error C2065: 'wait_index' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 3) : error C2275: 'HANDLE' : illegal use of this type as an expression
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\win nt.h(342) : see declaration of 'HANDLE'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 3) : error C2146: syntax error : missing ';' before identifier 'hSocketEvent'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 3) : error C2065: 'hSocketEvent' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 4) : error C2275: 'SOCKET' : illegal use of this type as an expression
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\win sock.h(40) : see declaration of 'SOCKET'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 4) : error C2146: syntax error : missing ';' before identifier 'hIpcSocket'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 4) : error C2065: 'hIpcSocket' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 5) : error C2143: syntax error : missing ';' before 'type'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(71 6) : warning C4013: 'WSACreateEvent ' undefined; assuming extern returning
int
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(71 6) : error C2065: 'WSA_INVALID_EV ENT' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(72 2) : warning C4013: 'WSAEventSelect ' undefined; assuming extern returning
int
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(73 0) : warning C4022: 'WaitForSingleO bject' : pointer mismatch for actual parameter
1
srvsys.c
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 1) : error C2065: 'WSANETWORKEVEN TS' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 1) : error C2146: syntax error : missing ';' before identifier 'netevents'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 1) : error C2065: 'netevents' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 2) : error C2275: 'DWORD' : illegal use of this type as an expression
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\win def.h(141) : see declaration of 'DWORD'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 2) : error C2146: syntax error : missing ';' before identifier 'wait_value'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 2) : error C2065: 'wait_value' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 2) : error C2065: 'wait_index' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 3) : error C2275: 'HANDLE' : illegal use of this type as an expression
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\win nt.h(342) : see declaration of 'HANDLE'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 3) : error C2146: syntax error : missing ';' before identifier 'hSocketEvent'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 3) : error C2065: 'hSocketEvent' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 4) : error C2275: 'SOCKET' : illegal use of this type as an expression
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\win sock.h(40) : see declaration of 'SOCKET'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 4) : error C2146: syntax error : missing ';' before identifier 'hIpcSocket'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 4) : error C2065: 'hIpcSocket' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(70 5) : error C2143: syntax error : missing ';' before 'type'
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(71 6) : warning C4013: 'WSACreateEvent ' undefined; assuming extern returning
int
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(71 6) : error C2065: 'WSA_INVALID_EV ENT' : undeclared identifier
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(72 2) : warning C4013: 'WSAEventSelect ' undefined; assuming extern returning
int
D:\DEVELOP\Sour ce\FAXFX\FAXFX\ CCODE\FXAPI\SRV API\srvsys.c(73 0) : warning C4022: 'WaitForSingleO bject' : pointer mismatch for actual parameter
1
Code:
WSANETWORKEVENTS netevents;
DWORD wait_value, wait_index;
HANDLE hSocketEvent;
SOCKET hIpcSocket;
struct FXDEV_DS_MSG msg;
sprintf( tcaller, "fxcipc(%6d)", GetCurrentThreadId( ) );
trace_add_caller( 0, tcaller );
trace( 7, "Start IPCThreadProc.\n");
del_shut( );
hIpcSocket = ( SOCKET ) SocketHandle;
if ( ( hSocketEvent = WSACreateEvent( ) ) == WSA_INVALID_EVENT )
{
trace( 3, "Error: Unable to create monitor event [%d].\n", WSAGetLastError( ) );
ExitProcess( 0 );
}
if ( WSAEventSelect( hIpcSocket, hSocketEvent, FD_READ | FD_CLOSE ) == SOCKET_ERROR )
{
trace( 3, "Error: Unable to set monitor event [%d].\n", WSAGetLastError( ) );
ExitProcess( 0 );
}
while ( 1 )
{ trace( 7, "Run IPCThreadProc.\n");
wait_value = WaitForSingleObject( hSocketEvent, INFINITE );
indicate it, and 2) when I right click on SOCKET (in line 704 or in line 714) and chose "Go to Definition of SOCKET" it takes me to Winsock.H (not
Winsock2.h).
So the question is, "How am I getting Winsock.h when I know the code is designed and was previously built using Winsock2.h?"
Any thoughts or suggestions from an experienced MSVC++ user would be greatly appreciated.
Comment