Results 1 to 4 of 4

Thread: unresolved external symbol- Development environment change error

  1. #1
    Join Date
    Apr 2008
    Posts
    242

    unresolved external symbol- Development environment change error

    I have recently switched my development environment from Visual C++ 6.0 to Visual Studio 2005. This is because I had taken another file from the other to use an external DLL which is compiled and linked with Visual C++ 6.0. The code I’ve written compiled perfectly in other debugger tools, but it has been failed to link with the required lib. The message is something as follows view source print?

    error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall BufferReader::BufferReader(wchar_t const *)" …)
    deviceQueryDrv.obj : error LNK2019: unresolved external symbol _cuDeviceGetAttribute@12 referenced in function _main
    deviceQueryDrv.obj : error LNK2019: unresolved external symbol _cuDeviceTotalMem@8 referenced in function _main
    deviceQueryDrv.obj : error LNK2019: unresolved external symbol _cuDriverGetVersion@4 referenced in function _main

    Please help.

  2. #2
    Join Date
    Dec 2008
    Posts
    202

    Re: unresolved external symbol- Development environment change error

    Link with the latest lib you’ve created. Examine the requirements of your header files and verify that you have specified all necessary source and libraries to your translator (compiler). You can recreate the library with the latest version of Visual Studio only if your project situation allows. The problem is that your linker cannot find the defintions of those functions. Most likely you have forgotten to add the module where those function are defined to the project. Also you might have some constraints of recreating the library.

  3. #3
    Join Date
    Jan 2006
    Posts
    6,878

    Re: unresolved external symbol- Development environment change error

    I can’t understand what really happened with the code. I’ve used some libraries which are developed in Visual C++ 6.0 with Visual Studio 2005 and 2008 without having any problems. But this was something strange. It's the header that contains the definitions of the classes. The actual implementation is most likely in a ".lib" file.

  4. #4
    Join Date
    Jan 2009
    Posts
    96

    Re: unresolved external symbol- Development environment change error

    I had found out the solution on it, the issue was with the function parameter. From Visual C++ 8.0 (Visual Studio 2005) onwards, wchar_t is a native data type. You need to read the documentation for your library and pay attention to what you need to do with the .lib file, along with adding the header to your source.Earlier it was defined as unsigned short (16-bit) data. Hence at the time of linking when the linker searches for a function definition with parameter of type wchar_t*.

    Code:
    // test.cpp
       // compile with: cl /GZ test.cpp /link /nod
       void f() {}
       int main ()
       {
          f();
          return 0;
       }

Similar Threads

  1. How to set development environment with Sandy Flash 3D
    By IzzaT NaHi in forum Software Development
    Replies: 4
    Last Post: 23-02-2011, 08:00 PM
  2. How to build development environment in J2ME
    By Efigenio in forum Software Development
    Replies: 4
    Last Post: 25-02-2010, 03:35 AM
  3. How To install Android development environment in Ubuntu
    By Aashirya in forum Operating Systems
    Replies: 4
    Last Post: 17-02-2010, 05:13 AM
  4. Replies: 5
    Last Post: 21-08-2009, 06:23 PM
  5. Which is your development environment (IDE) ?
    By Francesca in forum Polls & Voting
    Replies: 2
    Last Post: 07-05-2009, 08:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,583,920.24128 seconds with 16 queries