LNK 2019:Unresolved External Symbol Error in VS 2010 - visual-studio-2010

I am receiving the LNK 2019 error in VS2010 while trying to build the project.I have included the header files from other project using external dependencies.Each time at build time the LNK 2019 rises for the function defined in those header files.Any idea how to fix it?

This error is caused by the linker which cannot find call address of an external function. So it "doesn't know" where is located the implementation of the function declared in your external header file.
To fix this apart from specifying external header files you should also specify the paths to the binary files (".dll" in your case) built from your external project sources. In order to do this use context menu of your project in Visual Studio - {Properties -> Configuration Properties -> Linker -> General}, then add to the "Additional Library Directories" field paths to the directory where your extenal libraries located. After that use {Properties -> Configuration Properties -> Linker -> Input} and add to the "Additional Dependencies" field names of your external libraries ".lib" files.
This should help.

Related

Making local project items accessible from the shared projects in VS C++ 2017

I have deb_sets.h in the main project to set debugging options for the whole project.
Shared projects include this file too. However, it will be different in different main projects.
I get a compilation error fatal error: deb_sets.h: No such file or directory in every shared project file which include this file.
Is my idea possible to achieve?
You need to add the #include "deb_sets.h" in all source files that use this header, but if this header file is in another directory, you need to change "Additional Include Directories" (C++\General section) in the project options to set the header file path.

Visual Studio 2010 Configuration to run PCL Project

I have a problem when trying to debug a simple PCL (Point-Cloud-Library Application) application in MS Visual C++ 2010 that has to visualize a point cloud. (This example: http://pointclouds.org/documentation/tutorials/pcl_visualizer.php)
I setup the C++ project with all the include and library folders needed for PCL.
I add to the linker input the following dependencies:
openNI.lib
libboost_system-vc100-mt-gd-1_49.lib
libboost_filesystem-vc100-mt-gd-1_49.lib
libboost_thread-vc100-mt-gd-1_49.lib
libboost_date_time-vc100-mt-gd-1_49.lib
libboost_iostreams-vc100-mt-gd-1_49.lib
pcl_common_debug.lib pcl_apps_debug.lib
pcl_features_debug.lib
pcl_filters_debug.lib
pcl_io_debug.lib
pcl_io_ply_debug.lib
pcl_kdtree_debug.lib
pcl_keypoints_debug.lib
pcl_octree_debug.lib
pcl_registration_debug.lib
pcl_sample_consensus_debug.lib
pcl_search_debug.lib
pcl_segmentation_debug.lib
pcl_surface_debug.lib
pcl_tracking_debug.lib
pcl_visualization_debug.lib
vtkRendering-gd.lib
QVTK-gd.lib
vtkalglib-gd.lib
vtkCharts-gd.lib
vtkCommon-gd.lib
vtkDICOMParser-gd.lib
vtkexoIIc-gd.lib
vtkexpat-gd.lib
vtkFiltering-gd.lib
vtkfreetype-gd.lib
vtkftgl-gd.lib
vtkGenericFiltering-gd.lib
vtkGeovis-gd.lib
vtkGraphics-gd.lib
vtkhdf5-gd.lib
vtkHybrid-gd.lib
vtkImaging-gd.lib
vtkInfovis-gd.lib
vtkIO-gd.lib
vtkjpeg-gd.lib
vtklibxml2-gd.lib
vtkmetaio-gd.lib
vtkNetCDF_cxx-gd.lib
vtkNetCDF-gd.lib
vtkpng-gd.lib
vtkproj4-gd.lib
vtksqlite-gd.lib
vtksys-gd.lib
vtktiff-gd.lib
vtkverdict-gd.lib
vtkViews-gd.lib
vtkVolumeRendering-gd.lib
vtkWidgets-gd.lib
vtkzlib-gd.lib
OpenGL32.Lib
When i start debugging the IDE ends up with the following link error:
LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc100-mt-sgd-1_49.lib'
The library "libboost_thread-vc100-mt-sgd-1_49.lib" is not contained in the set of boost library of the 3party folder of PCL. What am I doing wrong? Is there another path for VS2010 configuration for PCL programs?
Additional information:
I downloaded last version 1.6 of PCL, choosing the MSVC2010 version all-in-one.
I set up the code generation with /MTd (Multi-threaded debug)
I'm running the project with debug mode.
You already got libboost_thread-vc100-mt-gd-1_49.lib so enable your project to use dynamic linking in "configuration properties".
Another option is to download Boost and build it using static linking to generate the libboost_thread-vc100-mt-sgd-1_49.lib file. Don't forget to set the folder of "Linker" -> "Additional Library directories" to the location of the file.

Removing all symbols from EXE file with Visual Studio

I'm linking an executable file with several static libraries (projects in my solution), and want to remove all internal function names from the final .exe file.
Which settings do I have to use for that, and do I have to do that in the library or executable project settings?
Simply building in Release mode doesn't strip the names out of the binary.
Go to Project -> Properties -> Configuration properties -> Linker and in the Debugging section set Generate Debug Info to "No".
Remove them using hex editor, they aren't used inside a code

Missing header files for VTK

I installed Visual Studio 2010, Qt and Cmake. I configured them. Then I wanted to test by an example code. However, the program cannot find the header files. I searched on the internet and found that there might be a problem with the PATH.
Then, I followed this way that results in failure:
I wrote each folder name separately by putting semicolon between them to
Project > Properties > C/C++ > General > Additional Include Directories.
In this way, program found the header files but it gave me an error LNK1104. I think it happened because the Path for file name expands to more than 260 characters. I learned that from this site.
I tried to find one folder that I can write to PATH. I think it's lib file. But I could not find it.
what should I do to fix this problem?
Setting two values in visual studio will remove this error.
Go to Properties of the project -> C/C++ -> All Options -> Set the correct value for "Additional Options".
Go to Properties of the project -> Linker -> Input -> Set correct the value for "Additional Dependencies".
If you create the project using CMake, then these values will be setup automatically.

How to edit Build system paths in Visual Studio 2005

I want to change the build system path for building my VC++ project in VS2005.
When I try to build the project, I'm getting an error that a specified header file cannot be opened. I have that header file in "Microsoft SDKs\Windows\v7.0\Include".
But the path present in 'Build system path' is "Microsoft SDKs\Windows\v7.0\Include" which i found in the Error dialog box when i tried to open that header file through the code.
So I want to change the path in build system path to "Microsoft SDKs\Windows\v7.0\Include".
How can i do this.? How to open Build system paths in VS2005.?
You can add include directives rather than change the build system path. Right click the project in Solution Explorer | properties
C/C++ | General
Select 'Additional include directives'
Here browse to the location of where you include files are.

Resources