Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ERROR:cannot open file "nafxcwd.lib"

ERROR:cannot open file "nafxcwd.lib"

Scheduled Pinned Locked Moved C / C++ / MFC
c++comsecuritydebugginghelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JoeMass
    wrote on last edited by
    #1

    --------------------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) {

    P M 2 Replies Last reply
    0
    • J JoeMass

      --------------------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) {

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • J JoeMass

        --------------------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) {

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        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"

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups