How to link to a library - c++

Visual Studio 2010.
My library is in a folder called "lib" which is in the project folder.
I had added the library to Properties>Linker>Input>Additional Directories, and have tried various things in Properties>Linker>General>Additional Library Directories but none work (have tried ../lib, $(SolutionDir)../lib, lib, and same with an additional slash at the end).
I also tried just having it in the project folder which didn't work either. (With $(SolutionDir) in Additional Library Directories or blank)
I always get this linker error: LINK : fatal error LNK1104: cannot open file 'cyclone_d.lib' or LINK : fatal error LNK1104: cannot open file 'cyclone.lib' if trying to build a release version.
If anybody has any ideas about what I need to do that would be fantastic.

Related

LINK : fatal error LNK1104: cannot open file 'boost_date_time-vc141-mt-1_65_1.lib'

I am trying to compile boost in visual studio 2017.
boost version is 1.65.1
I have included the boost libraries include path in the additional Include directories and
lib path in Additional lib dir.
In the preprocessor I have added the following tags - BOOST_ALL_NO_LIB;BOOST_ALL_DYN_LINK;
any assistance will be helpful in resolving the issue.
Just to correct my question : the error that i am getting is :
LINK : fatal error LNK1104: cannot open file 'libboost_date_time-vc120-mt-1_55.lib'
I have installed the 64 bit version.
I am trying to compile boost in visual studio 2017.
boost version is 1.65.1
I have included the boost libraries include path in the additional Include directories and lib path in Additional lib dir.
In the preprocessor I have added the following tags:
BOOST_ALL_NO_LIB;
BOOST_ALL_DYN_LINK;
any assistance will be helpful in resolving the issue.

cannot open file 'libboost_log-vc120-mt-1_58.lib' in VS 2013 C++ project

I am attempting to compile a project in visual studio 2013 that is using boost 1.58.
I am receiving this error:
Error 3 error LNK1104: cannot open file 'libboost_log-vc120-mt-1_58.lib'
This entry is in my VC++/General/Library Directories
$(BOOSTDIR)\lib\x64
the value of my BOOSTDIR directory is
C:\Projects\boost_1_58_0
I have verified that the path C:\Projects\boost_1_58_0\lib\x64 has the "libboost_log-vc120-mt-1_58.lib" file.
What could I be missing?
I resolved the issue by rebuilding boost and then adding the new lib location as follows:
Add $(BOOSTDIR)\libs;$(BOOSTDIR)\stage\lib; to Additional Libraries
Add $(BOOSTDIR) to Additional Include Directories
I'm guessing there was a compiler mis-match between my project and whatever boost was built with (even though my coworker told me it was built using the same compiler). Or it could have been the path was wrong or missing.

Using pthread in c++ on Visual Studio 2013

I am trying to use the pthread library on windows. I downloaded a zip with a Pre-built.2 folder in it and followed the instruction.
What I have done so far:
all .h files from POSIX\Pre-built.2\includeinto MS VS2013\VC\include folder
all .dll files from \dll\x86dll\x86 into VC\bin
all .lib files from lib\x86 into VC\lib
In Property->Config->Linker->Input->Additional Dependencies, pthreadVC2.lib;pthreadVCE2.lib;pthreadVSE2.lib;%(AdditionalDependencies) // pthread.lib already in Inherited values
I included pthread.h inside my program and when trying to build solution, the following error appears:
Error 1 error LNK1104: cannot open file 'pthread.lib'
Can anyone help me out? Thanks.
EDIT:
The Include Directories and Library Directories are
A:\Program Files %28x86%29\Microsoft Visual Studio 12.0\VC\include;$(IncludePath)
and
A:\Program Files %28x86%29\Microsoft Visual Studio 12.0\VC\lib;$(LibraryPath)
respectively now. But I still get the same error message.
Add the folder containing the LIBs to Configuration Properties -> VC++ Directories -> Library Directories.

C++ Boost libraries on Visual Studio 2008 64-bit, compiler cannot open .obj file

I've been working on my C++ application on Microsoft Visual Studio 2008, on a 64-bit pc. The program includes and uses Boost libraries, and I've been having some troubles with them.
My current working mode on VS2008 is "Debug x64".
I put my Boost libraries into C:\Boost directory, and included Boost path into solution properties (configuration properties, additional include directories), but I've an error in compiling phase.
Error 30 fatal error LNK1104: cannot open file 'C:\Boost\boost_1_44_0\.obj'
What does this error mean?
How to solve it?
Just to make the comments above more concise, I had the same issue.
By deleting my boost directories from
Configuration Properties > Linker > Input > Additional Dependencies
and deleting any boost directories from
Configuration Properties > Linker > General > Additional Libraries.
I'm no longer getting my Error 30 fatal error LNK1104: cannot open file 'C:\boost.obj' error.

Linker library error in visual studio

Running visual studio 2010 writing an openGL program in C++
I'm getting this error, and can't for the life of me figure out why
fatal error LNK1104: cannot open file 'Image_Loading/nvImage.lib'
The file is in the correct place, and nvImage.lib is present in the additional dependencies of the linker, any ideas??
The folder "Image_Loading" is probably not in your library search path. Include files has a different search path, so even if its find the includes, the folder might be missing from the libary search path.
you should either add the folder to the LIB enviromental variable, or add /LIBPATH:folder to the command line of the linker.