SCIP and Visual Studio: error LNK2001 - c++

I am trying to make the SCIP work with C++ in Windows 10.
I want to solve the VRP problem using SCIP (version 3.2.1) in Visual Studio 2010.
I have downloaded Source files and then precompiled dlls from the http://scip.zib.de and included the .hpp and cpp files in my VS project.
there was a .dll, a .exe and a .lib file in the archive.
In the project properties I did the following:
C/C++ -> General -> Additional Include Directories:
C:\scipoptsuite-3.2.1\scip-3.2.1\src\
C/C++ -> Linker -> Input-> Additional Dependencies: C:\Users\Mahla\Desktop\src\scip-3.2.1.win.x86_64.msvc.opt.spx.ld.lib;
C/C++ -> General -> Input-> Additional Library Dependencies:
C:\Users\Mahla\Desktop\src\scip-3.2.1.win.x86_64.msvc.opt.spx.ld.lib;
VC++ Directories-> Include Directories:
C:\Users\Mahla\Desktop\src;
VC++ Directories-> Library Directories:
C:\Users\Mahla\Desktop\src;
src folder is a copy of src down in the scip root directory.
I copied .dll, .lib and .exe in the Debug folder at the same level as the solution .sln file in Visual Studio.
When building, I get many errors like :
main_vrp.obj : error LNK2001: unresolved external symbol _SCIPcreateConsLinear
Can anyone tell me what is the problem or how to set up an example in VS.
Thank you very much.

I am using a x64 version of SCIP. So my "Platform" should be x64, not Win32, or it will give LNK errors.
I simply changed the platform in configuration manager to x64 and everything was okay then.

Related

Visual Studio static library : NuGet package not found when using in another project

I'm building a static library using Visual Studio, which involves installing nupengl and glm. Then I linked it to a test project via this method :
Project Properties -> VC++ Directories -> Additional include library (I entered the directory which contains my header files from the library)
Project Properties -> Linker -> Input (I entered the directory which contains the .lib file for the library)
I added the header files in the library to my test project
But when I run the test program, it produces things like :
GLFW/glfw3 not found
How can I use the installed NuGet package for the library when calling the library from another project ? Any help would be highly appreciated

Linker Issues VS2015. LNK2019 and LNK2001 unresolved external symbol

I am trying to extend my knowledge of constrain programming and I want to build a simple example using google's or-tools in VS2015.
However I am constantly nagged by those linker errors. LNK2019 and LNK2001. Why is linking in VS so darn hard.
Google's or-tools comes in a perfect folder, with an include subfolder and lib subfolder with one single .lib file.
I have added Additional Library Dependencies.
Configuration Properties -> Linker -> General Additional Library Dependencies : C:\PATH\or-tools.VisualStudio2013-64b\lib
Set the Input under the Linker properties section.
Configuration Properties -> Linker -> Input Additional Dependencies : ortools.lib
Infomed VC++ where the include directory is.
Configuration Properties -> VC++ Directories : C:\PATH\or-tools.VisualStudio2013-64b
However it is still throwing link errors when building the solution. What am I missing here.
Thanks in advance.
edit:
spelling
Since the VS2013 and VS2015 compiler versions are incompatible, you have to build the lib from source. Though beware that this might entail a bit more work when linking with VS2015. Specifically I've had to manually resolve the following issues:
Change protobuf-3.0.0-beta-1 to protobuf-3.0.0-beta-2(bonus. not really necessary)
gflags 2.1.2 failed to compile due to a conflict of names around snprintf. To resolve this download the latest gflags version from GitHub and overwrite the one in %OR_TOOLS%\dependencies
Look up all VS solution files (.sln) in dependencies\sources\cbc-2.9.7 and convert to VS2015 format by simply double clicking them and following the instructions.
Add the following code to makefiles\Makefile.port
ifeq ("$(VisualStudioVersion)", "14.0")
VISUAL_STUDIO=2015
VS_RELEASE=v140
VS_COMTOOLS=140
else
...
endif
Replace Visual Studio 12 2013 with Visual Studio 14 2015
Rerun make third_party after each step.
Or you can just download the end result, linked on Windows 10 x64 VS2015 update 1. I've included the whole folder after running make third_party && make cc.

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.

C++: How to add a library in Netbeans (DarkGDK + DirectX SDK)

I'm trying to learn how to make games with DarkGDK. But I have to write in Visual Studio.
I don't like Visual Studio. Its suggestions (Ctrl-Space for Completion) are bad (in my opinion) and the compiler is broken (See my previous questions).
So I want to migrate to Netbeans, with MSys and MinGW. But I'm not able to use the DarkGDK
library in Netbeans. I added two include folders:
C:\Program Files\The Game Creators\Dark GDK\Include
C:\Program Files\Microsoft DirectX SDK (August 2007)\Include
After adding this include directories, I can #include <DarkGDK.h>.
But he shows a warning: "There are unresolved includes inside <DarkGDK.h>"
And when I try to compile: main.cpp:9:21: warning: DarkGDK.h: No such file or directory
In Visual Studio are Include files and Library files. And in Netbeans, there is only Include Directories when I go to Tools -> Options -> C/C++ -> Code Assistance.
So, my question is: "How can I add the Library files in Netbeans"?
Or does any-one did this yet and knows how to do this.
Personally I found the include directories in Tools -> Options don't work. You need to right click on your project and go to properties -> C++ Compiler and add your include directories. Then from properties -> Linker to add your library directories and libraries.