views:

84

answers:

1

This is a really strange issue. One day my project started to do a rebuild every time I launched it in the debugger, even if I hadn't changed the code. ie. I would go Build->Build Solution, then Debug->Start Debugging, it would rebuild when I tried to start debugging. The specific file that it recompiles is shown (left out source code, just function definitions):

The Header:

#ifdef IPC_USE_DLL
    #ifdef IPC_EXPORTS
    #define IPC_API __declspec(dllexport)
    #else
    #define IPC_API __declspec(dllimport)
    #endif
#else
    #define IPC_API
#endif

#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <iphlpapi.h>
#include <stdio.h>

#include <string>

namespace Ipc {

    /** Class provides basic network functionality, connecting, etc.
    */
    class IPC_API NetworkUtilities
    {
    public:
     //! Attempts to connect to the specified port/address.
     static int connectToServer( const std::string& port, const std::string& address, SOCKET& serverConnection );
     //! Attempts to initiate a server on the specified port.
     static int initiateServer( const std::string& port, SOCKET& serverSocket );
     //! Assuming the passed socket is a valid socket, the function waits the specified amount of time for a connection.
     /** Returns: NTWK_SUCCESS, NTWK_WSA_ERROR, NTWK_TIMEOUT, NTWK_INVALID_PEER_ADDRESS, NTWK_INVALID_SOCKET.
     */
     static int waitForClient( SOCKET& serverSocket, SOCKET& clientSocket, const std::string address, unsigned timeOut = 0 );
    };

    //! Various error codes
    IPC_API enum {

    };
}

The CPP:

#include "StdAfx.h"
#include "NetworkUtilities.h"

namespace Ipc {

// Implementation of functions from header
// ...

}

This is a DLL. Can anyone tell me why this constantly needs to rebuild? It is quite irritating while debugging.

Thanks

+3  A: 

One possibility is a time stamp issue. Can you check the time on the files and see if their modified date is at some point in the future?

JaredPar
Thank you sir! I think the issue is I've been developing on two computers and maybe the time is wrong on one, because that is definitely the issue.
DeusAduro