I got the same error as per this post below.
error LNK2001
someone replied "ATL uses ATLTRACE at debag-compilation. atlbase.h."
What does this mean? Do I have to add atlbase.h to my dependency?
You need to add atls.lib (for release configuration) or atlsd.lib ( for debug configuration) in your linker dependencies.
Right click your project -> Properties -> Linker -> Input -> Additional Dependencies
There atls.lib (for release configuration) or atlsd.lib ( for debug configuration) needs to be listed.
Related
I have two projects in my Visual Studio solution: A (static library .lib project) and B (project that uses A). I have referenced A in B by following the steps:
right click B > properties > common properties > references > add new reference > select A from projects tab
I have set the path for .h files using additional include directories option in properties > Configuration Properties > C/C++ > General
Project A builds successfully when built separately. But on building project B, it show unresolved external symbol errors like follows:
Error 46 error LNK2001: unresolved external symbol __imp____glewActiveTexture c:\Users\student\documents\visual studio 2013\Projects\MCAProject\Narovatar\Narovatar\OGLDEV_Imported.lib(ogldev_texture.obj) Narovatar
Error 21 error LNK2001: unresolved external symbol __imp____glewAttachShader c:\Users\student\documents\visual studio 2013\Projects\MCAProject\Narovatar\Narovatar\OGLDEV_Imported.lib(technique.obj) Narovatar
Error 12 error LNK2001: unresolved external symbol __imp____glewBindBuffer c:\Users\student\documents\visual studio 2013\Projects\MCAProject\Narovatar\Narovatar\ogl_mesh.obj Narovatar
Error 13 error LNK2001: unresolved external symbol __imp____glewBufferData c:\Users\student\documents\visual studio 2013\Projects\MCAProject\Narovatar\Narovatar\ogl_mesh.obj Narovatar
What could I have left? Any thoughts?
Right click properties -> linker -> general ->additional library directories-> browse for your lib file directory.
Right click properties -> linker -> general ->input-> write your lib file name.
Do not forget to make them both MT or both MD like following:
properties -> C/C++ -> Code generation -> Runtime-library-> change them both to be the same
I have found my answer myself, of course with the help of help from all those who responded. Actually, the project A (.lib project) had all the header files and implementations in the same folder which I was referencing in the project B. So, when all the implementations were already available, I didn't have to link my the .dll output of project A in project B, but just had to refer it.
Another problem was that I had not linked (in project B) the libraries that were required for building project A. Now, its up and running...
I have been trying to get assimp working with VS2010. I have seen many questions similar to this but I just can't get it to work. Read the installation tutorials here http://assimp.sourceforge.net/lib_html/install.html and still can't get it to work.
This is what I did for VS2010 project setup:
All Configurations -> Configuration Properties -> VC++ Directories -> Library Directories ADDED
C:\assimp--3.0.1270-sdk\lib\assimp_release-dll_x64
All Configurations -> Configuration Properties -> VC++ Directories -> Include Directories ADDED
C:\assimp--3.0.1270-sdk\include
All Configurations -> Configuration Properties -> C++ -> General -> Additional Include Directories ADDED
C:\assimp--3.0.1270-sdk\include
All Configurations -> Configuration Properties -> Linker -> Input -> Additional Dependencies ADDED assimp.lib
When i write following code:
#include <assimp/Importer.hpp> // C++ importer interface
#include <assimp/scene.h> // Output data structure
#include <assimp/postprocess.h> // Post processing flags
Assimp::Importer importer;
This is the error I get:
Error 2 error LNK2019: unresolved external symbol "public: __thiscall Assimp::Importer::Importer(void)" (??0Importer#Assimp##QAE#XZ) referenced in function "void __cdecl `dynamic initializer for 'importer''(void)" (??__Eimporter##YAXXZ) C:\Users\Martin Liu\documents\visual studio 2010\Projects\MyGame\MyGame\Game.obj MyGame
Error 3 error LNK2019: unresolved external symbol "public: __thiscall Assimp::Importer::~Importer(void)" (??1Importer#Assimp##QAE#XZ) referenced in function "void __cdecl `dynamic atexit destructor for 'importer''(void)" (??__Fimporter##YAXXZ) C:\Users\Martin Liu\documents\visual studio 2010\Projects\MyGame\MyGame\Game.obj MyGame
Any help would be appreciated
Make sure your application's bitness matches your libraries' one. E.g. you can't link against x64 libraries if your project is 32 bit.
You can check this out by right-clicking in your project and choosing "properties" and then "Configuration Manager" button.
I am trying to build a project that uses Imagemagick library. I have done the following:
Added Libraries in VC++ Directories in Tools -> Options
Added "C:\ImageMagick-6.8.6-Q16\include\Magick++";"C:\ImageMagick-6.8.6-Q16" in Project Properties -> Configuration -> C/C++ -> General -> Additional Include Libraries
Added "C:\ImageMagick-6.8.6-Q16\lib";"C:\ImageMagick-6.8.6-Q16" in Project Properties -> Configuration -> Linker -> General -> Additional Library Directories
Added CORE_RL_magick_.lib CORE_RL_Magick++_.lib CORE_RL_wand_.lib X11.lib in Project Properties -> Configuration -> Linker -> Input -> Additional Dependancies
Added C:\ImageMagick-6.8.6-Q16 in Environment Variables PATH
However, when building the project, I get several LNK2019 errors, the first is:
Error 28 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Magick::Image::~Image(void)" (__imp_??1Image#Magick##UAE#XZ) referenced in function "class Imagen & __cdecl lee(char *,int)" (?lee##YAAAVImagen##PADH#Z) inout.obj
I have error in linker
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>kernel.cu.obj : error LNK2001: unresolved external symbol _cudaMalloc#8
1>kernel.cu.obj : error LNK2001: unresolved external symbol _cudaFree#4
I saw similar question added here :
Unresolved external symbols in beginners CUDA program
But it's already have added this information to linker.
So where is the problem ?
I'm using Visual Studio 2010 Premium with CUDA SDK 5.0 and Nsight 3.0 for VS
Source code here : http://pastebin.com/DfdfSfWd
(It's a example generated by Visual Studio on created new project for CUDA 5.0)
[EDIT]
Settings for Linker
Configuration Properties->Linker->General->Additional Library Directories :
$(CudaToolkitLibDir) $(CUDA_LIB_PATH) $(CUDA_PATH)\lib\$(PlatformName)
Configuration Properties->Linker->Input->Additional Dependencies
cuda.lib;cudart.lib; and the other libs..
But in properties I see that CUDA haves own Linder, "CUDA Linker" and that doesnt have set
Additional Library Directories
and
Additional Dependencies
so I set this properties but nothing that change, the linker still have problem.
[EDIT]
Ok, the error is when I change
Configuration Properties->CUDA C/C++->Device->Code Generation
from
compute_10,sm_10
to
compute_20,sm_20
and add a flag -dc for CUDA C/C++
Ok, I found how to set the project for Separate Compilation & Linking, below we have an example of project where it work :
example simpleSeparateCompilation
I compile mpg123 lib in win32.
It don't want it linked to MSVCR90.DLL
I change:
C/C++ -> "ignore all default libraries" to YES
add "additional dependencies" ==> libcmt.lib
"C/C++ -> Runtime Library "from "multi-threaded DLL" to "Multi-threaded"
But i still get this error:
Please help me.
readers.obj : error LNK2001: unresolved external symbol _read
readers.obj : error LNK2001: unresolved external symbol _lseek
Perhaps you should be linking to LIBCPMT.LIB which is the CPP standard library.