Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 22-09-2009
Member
 
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.
Reply With Quote
  #2  
Old 22-09-2009
Member
 
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.
Reply With Quote
  #3  
Old 22-09-2009
Member
 
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.
Reply With Quote
  #4  
Old 22-09-2009
Member
 
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;
   }
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "unresolved external symbol- Development environment change error"
Thread Thread Starter Forum Replies Last Post
How to set development environment with Sandy Flash 3D IzzaT NaHi Software Development 4 23-02-2011 08:00 PM
How to build development environment in J2ME Efigenio Software Development 4 25-02-2010 03:35 AM
How To install Android development environment in Ubuntu Aashirya Operating Systems 4 17-02-2010 05:13 AM
Best c/c++ Integrated Development Environment for damn small linux Solomon Polls & Voting 5 21-08-2009 06:23 PM
Which is your development environment (IDE) ? Francesca Polls & Voting 2 07-05-2009 08:25 PM


All times are GMT +5.5. The time now is 10:08 PM.