ERROR:cannot open file "nafxcwd.lib"
-
--------------------Configuration: Wyse2 - Win32 Debug-------------------- Here is the only error I get when building my app: Any ideas? I am using VC++ 6.0 Compiling resources... Compiling... stdafx.cpp Wyse160.cpp Linking... LINK : fatal error LNK1104: cannot open file "nafxcwd.lib" Error executing link.exe. Souce code: // Wyse160.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "Wyse160.h" #ifdef _DEBUG #define new DEBUG_NEW #endif #undef mc //#define mc // The one and only application object CWinApp theApp; using namespace std; int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = 0; DCB dcb; int fSuccess; DWORD dwResult; DWORD BaudRate; BYTE ByteSize; BYTE Parity; BYTE StopBits; CString csErrMsg; CString csTitle; CString csComm; char inBuffer[512]; char outBuffer[512]; int Read1COMM(char * inBuffer, DWORD nBytesToRead); int Write1COMM(char * outBuffer,DWORD nBytesToWrite); // Fill in the default com port and values for DCB: 9600 bps, 8 data bits, no parity and 2 stop bits char *pcCommPort = "COM2"; BaudRate = CBR_9600; // set the baud rate ByteSize = 8; // data size Parity = NOPARITY; // set parity StopBits = TWOSTOPBITS; // two stop bits csTitle.Format("Data Station Wyse Terminal %.2f", version); SetConsoleTitle(csTitle); m_hMainWait = CreateEvent( NULL, FALSE, FALSE, NULL); pcCommPort = "COM1"; BaudRate = CBR_9600; Parity = NOPARITY; ByteSize = 8; StopBits = ONESTOPBIT; /*Parity = EVENPARITY; Parity = ODDPARITY; Parity = NOPARITY; Parity = MARKPARITY; StopBits = ONESTOPBIT; StopBits = ONE5STOPBITS; StopBits = TWOSTOPBITS; */ csTitle.Format("Data Station Wyse Terminal %.2f %s", version, pcCommPort); SetConsoleTitle(csTitle); CommTimeouts = new _COMMTIMEOUTS; /* m_PKeybrdThread = 0; m_PScreenThread = 0;*/ m_bLine = false; // initialize MFC and print and error on failure if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)) { // TODO: change error code to suit your needs _tprintf(_T("Fatal Error: MFC initialization failed\n")); nRetCode = 1; } else { // TODO: code your application's behavior here. m_hCom = CreateFile (pcCommPort, GENERIC_READ | GENERIC_WRITE, 0, // open as exclusive access NULL, // no security OPEN_EXISTING, 0, // not overlapped I/O NULL // comm device ); if (m_hCom == INVALID_HANDLE_VALUE) {
-
--------------------Configuration: Wyse2 - Win32 Debug-------------------- Here is the only error I get when building my app: Any ideas? I am using VC++ 6.0 Compiling resources... Compiling... stdafx.cpp Wyse160.cpp Linking... LINK : fatal error LNK1104: cannot open file "nafxcwd.lib" Error executing link.exe. Souce code: // Wyse160.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "Wyse160.h" #ifdef _DEBUG #define new DEBUG_NEW #endif #undef mc //#define mc // The one and only application object CWinApp theApp; using namespace std; int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = 0; DCB dcb; int fSuccess; DWORD dwResult; DWORD BaudRate; BYTE ByteSize; BYTE Parity; BYTE StopBits; CString csErrMsg; CString csTitle; CString csComm; char inBuffer[512]; char outBuffer[512]; int Read1COMM(char * inBuffer, DWORD nBytesToRead); int Write1COMM(char * outBuffer,DWORD nBytesToWrite); // Fill in the default com port and values for DCB: 9600 bps, 8 data bits, no parity and 2 stop bits char *pcCommPort = "COM2"; BaudRate = CBR_9600; // set the baud rate ByteSize = 8; // data size Parity = NOPARITY; // set parity StopBits = TWOSTOPBITS; // two stop bits csTitle.Format("Data Station Wyse Terminal %.2f", version); SetConsoleTitle(csTitle); m_hMainWait = CreateEvent( NULL, FALSE, FALSE, NULL); pcCommPort = "COM1"; BaudRate = CBR_9600; Parity = NOPARITY; ByteSize = 8; StopBits = ONESTOPBIT; /*Parity = EVENPARITY; Parity = ODDPARITY; Parity = NOPARITY; Parity = MARKPARITY; StopBits = ONESTOPBIT; StopBits = ONE5STOPBITS; StopBits = TWOSTOPBITS; */ csTitle.Format("Data Station Wyse Terminal %.2f %s", version, pcCommPort); SetConsoleTitle(csTitle); CommTimeouts = new _COMMTIMEOUTS; /* m_PKeybrdThread = 0; m_PScreenThread = 0;*/ m_bLine = false; // initialize MFC and print and error on failure if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)) { // TODO: change error code to suit your needs _tprintf(_T("Fatal Error: MFC initialization failed\n")); nRetCode = 1; } else { // TODO: code your application's behavior here. m_hCom = CreateFile (pcCommPort, GENERIC_READ | GENERIC_WRITE, 0, // open as exclusive access NULL, // no security OPEN_EXISTING, 0, // not overlapped I/O NULL // comm device ); if (m_hCom == INVALID_HANDLE_VALUE) {
Woah, No need for the code, there is no logic error just linking error that means there is no problem with the code (from compilers view point :)) Any way, did you add the nafxcwd.lib entry in the lib in the link tab in project settings.
I have lost more blood shaving than on the battlefield - Adolf Hitler
-
--------------------Configuration: Wyse2 - Win32 Debug-------------------- Here is the only error I get when building my app: Any ideas? I am using VC++ 6.0 Compiling resources... Compiling... stdafx.cpp Wyse160.cpp Linking... LINK : fatal error LNK1104: cannot open file "nafxcwd.lib" Error executing link.exe. Souce code: // Wyse160.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "Wyse160.h" #ifdef _DEBUG #define new DEBUG_NEW #endif #undef mc //#define mc // The one and only application object CWinApp theApp; using namespace std; int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = 0; DCB dcb; int fSuccess; DWORD dwResult; DWORD BaudRate; BYTE ByteSize; BYTE Parity; BYTE StopBits; CString csErrMsg; CString csTitle; CString csComm; char inBuffer[512]; char outBuffer[512]; int Read1COMM(char * inBuffer, DWORD nBytesToRead); int Write1COMM(char * outBuffer,DWORD nBytesToWrite); // Fill in the default com port and values for DCB: 9600 bps, 8 data bits, no parity and 2 stop bits char *pcCommPort = "COM2"; BaudRate = CBR_9600; // set the baud rate ByteSize = 8; // data size Parity = NOPARITY; // set parity StopBits = TWOSTOPBITS; // two stop bits csTitle.Format("Data Station Wyse Terminal %.2f", version); SetConsoleTitle(csTitle); m_hMainWait = CreateEvent( NULL, FALSE, FALSE, NULL); pcCommPort = "COM1"; BaudRate = CBR_9600; Parity = NOPARITY; ByteSize = 8; StopBits = ONESTOPBIT; /*Parity = EVENPARITY; Parity = ODDPARITY; Parity = NOPARITY; Parity = MARKPARITY; StopBits = ONESTOPBIT; StopBits = ONE5STOPBITS; StopBits = TWOSTOPBITS; */ csTitle.Format("Data Station Wyse Terminal %.2f %s", version, pcCommPort); SetConsoleTitle(csTitle); CommTimeouts = new _COMMTIMEOUTS; /* m_PKeybrdThread = 0; m_PScreenThread = 0;*/ m_bLine = false; // initialize MFC and print and error on failure if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)) { // TODO: change error code to suit your needs _tprintf(_T("Fatal Error: MFC initialization failed\n")); nRetCode = 1; } else { // TODO: code your application's behavior here. m_hCom = CreateFile (pcCommPort, GENERIC_READ | GENERIC_WRITE, 0, // open as exclusive access NULL, // no security OPEN_EXISTING, 0, // not overlapped I/O NULL // comm device ); if (m_hCom == INVALID_HANDLE_VALUE) {
See the FAQ 2.8 Why do I get an unresolved external on nafxcw.lib or uafxcw.lib?[^] --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ #include "witty-quote.h"