OpenCV via NuGet packages with Visual Studio 2015, how to configure? - c++

I'm trying to use OpenCV via NuGet packages with Visual Studio 2015 and I can't seem to get everything configured. I'm not sure if I'm making a mistake somewhere or what I'm trying is not supported.
A little background, I made this tutorial a while back:
https://www.youtube.com/watch?v=7SM5OD2pZKY
https://github.com/MicrocontrollersAndMore/OpenCV_3_Windows_10_Installation_Tutorial
And I'd like to update this to use NuGets if possible. I use NuGets on the job every day so I'm familiar with the concept, but I've only previously used NuGets with .Net (Visual Basic or C#) applications.
I'm trying to make this work with plane jane C++ OpenCV, not within a .NET or UWP app.
For the record, in a separate .Net test project, I tried the EmguCV NuGet package:
With Visual Studio 2015 and everything worked as expected (for those not familiar, Emgu CV is probably the oldest/best known/most stable .Net wrapper for OpenCV)
Here are the steps I tried to get regular C++ OpenCV to work within Visual Studio 2015 using NuGets:
Start Visual Studio 2015, make an Empty Project:
Bring up the NuGet package manager:
I choose OpenCV.Win.ImgProc as that seemed to be the only OpenCV 3.x NuGet available, this also auto imported Core as expected:
Then I added a .cpp file and copied/pasted in known-good OpenCV code, the OpenCV libraries are not recognized:
I tried Build -> Clean, Build -> Build, same concern. I also tried "Solution Configurations" and "Solution Platforms" set to Debug / Release / x86 / x64, same concern.
Am I missing a step here? Do NuGets only work within a managed environment such as .Net or UWP, or can they work with regular C++ as well? I did notice the mention in the Description about UWP:
But I'm not using VideoIO, so I'm not sure that should matter.
Has anybody had any success with this? I can always go back to the "old school" way of directly referencing libraries in Project -> (project name) Properties as shown in my tutorial linked to above, but I'd like to use NuGets if possible.
----------- Edit ---------------
I had to place my response to Leo-MSFT here to allow for enough characters and screenshots. Thanks for the suggestion Leo-MSFT, but two problems with that. For one, that package is OpenCV 2.4.10, very outdated by now:
2nd, if I use that package the red underlines are gone, but I get the following linker errors when I try to build and run:
1>------ Build started: Project: Test2, Configuration: Debug x64 ------
1> test.cpp
1>test.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree#cv##YAXPEAX#Z) referenced in function "public: __cdecl cv::Mat::~Mat(void)" (??1Mat#cv##QEAA#XZ)
1>test.obj : error LNK2019: unresolved external symbol "public: __cdecl cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray#cv##QEAA#AEBVMat#1##Z) referenced in function main
1>test.obj : error LNK2019: unresolved external symbol "public: __cdecl cv::_OutputArray::_OutputArray(class cv::Mat &)" (??0_OutputArray#cv##QEAA#AEAVMat#1##Z) referenced in function main
1>test.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::Mat::deallocate(void)" (?deallocate#Mat#cv##QEAAXXZ) referenced in function "public: void __cdecl cv::Mat::release(void)" (?release#Mat#cv##QEAAXXZ)
1>test.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::Mat::copySize(class cv::Mat const &)" (?copySize#Mat#cv##QEAAXAEBV12##Z) referenced in function "public: class cv::Mat & __cdecl cv::Mat::operator=(class cv::Mat const &)" (??4Mat#cv##QEAAAEAV01#AEBV01##Z)
1>test.obj : error LNK2019: unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd#cv##YAHPEAHH#Z) referenced in function "public: class cv::Mat & __cdecl cv::Mat::operator=(class cv::Mat const &)" (??4Mat#cv##QEAAAEAV01#AEBV01##Z)
1>test.obj : error LNK2019: unresolved external symbol "void __cdecl cv::namedWindow(class std::basic_string,class std::allocator > const &,int)" (?namedWindow#cv##YAXAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) referenced in function main
1>test.obj : error LNK2019: unresolved external symbol "int __cdecl cv::waitKey(int)" (?waitKey#cv##YAHH#Z) referenced in function main
1>test.obj : error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string,class std::allocator > const &,class cv::_InputArray const &)" (?imshow#cv##YAXAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##AEBV_InputArray#1##Z) referenced in function main
1>test.obj : error LNK2019: unresolved external symbol "class cv::Mat __cdecl cv::imread(class std::basic_string,class std::allocator > const &,int)" (?imread#cv##YA?AVMat#1#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) referenced in function main
1>test.obj : error LNK2019: unresolved external symbol "void __cdecl cv::GaussianBlur(class cv::_InputArray const &,class cv::OutputArray const &,class cv::Size,double,double,int)" (?GaussianBlur#cv##YAXAEBV_InputArray#1#AEBV_OutputArray#1#V?$Size_#H#1#NNH#Z) referenced in function main
1>test.obj : error LNK2019: unresolved external symbol "void __cdecl cv::Canny(class cv::_InputArray const &,class cv::_OutputArray const &,double,double,int,bool)" (?Canny#cv##YAXAEBV_InputArray#1#AEBV_OutputArray#1#NNH_N#Z) referenced in function main
1>test.obj : error LNK2019: unresolved external symbol "void __cdecl cv::cvtColor(class cv::_InputArray const &,class cv::_OutputArray const &,int,int)" (?cvtColor#cv##YAXAEBV_InputArray#1#AEBV_OutputArray#1#HH#Z) referenced in function main
1>C:\Users\cdahms\Documents\Test2\x64\Debug\Test2.exe : fatal error LNK1120: 13 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
After trying various options, I've settled on this package:
Which seems to work, although it's not very confidence inspiring that it is clearly labeled "not an official package" and also that it's slightly out of date (not many changes from OpenCV 3.1.0 to 3.2.0 however). I suppose I'll use this until a proper updated package is released.

The OpenCV libraries package is OpenCV3.1 rather than OpenCV.Win.ImgProc for your test OpenCV code.
Below is my test result, so you just need to install the OpenCV3.1 NuGet package instead of OpenCV.Win.ImgProc for that OpenCV code.
Note that: OpenCV3.1 is not an official package.

Related

Convert VS 32 bit project to 64

There is an abandoned project, that builds correctly in 32bit version, but I need 64bit version of it. I tried to change project setting to x64 in visual studio, but when I click build I get lots of errors. Here are the visual studio files. And here is more info about the project. I have no experience with VS and c++.
This is a DLL, that makes connection between MT5 platform and MySQL, using libmysql.dll. I would like to read and write data to/from MySQL using MT5.
I would appreciate if you could help me to convert this to 64 bits, the 32 bit version can not be loaded to MT5.
Here are the first 5 error:
1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_num_rows referenced in function "int __cdecl cMySqlCursorRows(int)" (?cMySqlCursorRows##YAHH#Z)
1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_num_fields referenced in function "wchar_t * __cdecl cMySqlGetRowField(int,unsigned int)" (?cMySqlGetRowField##YAPEA_WHI#Z)
1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_errno referenced in function "bool __cdecl MySqlExecute(int,wchar_t *)" (?MySqlExecute##YA_NHPEA_W#Z)
1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_error referenced in function "bool __cdecl MySqlExecute(int,wchar_t *)" (?MySqlExecute##YA_NHPEA_W#Z)
1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_init referenced in function "int __cdecl cMySqlConnect(wchar_t *,wchar_t *,wchar_t *,wchar_t *,int,wchar_t *,int)" (?cMySqlConnect##YAHPEA_W000H0H#Z)
1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_real_connect referenced in function "int __cdecl cMySqlConnect(wchar_t *,wchar_t *,wchar_t *,wchar_t *,int,wchar_t *,int)" (?cMySqlConnect##YAHPEA_W000H0H#Z)
From the first 5 errors you've had, it looks like a linker issue. Most compiled languages compile the source (c++) code into object files and then link them with existing libraries. If the source compiles, but you can't link to the external libraries (for example they aren't installed) then you'll get errors like you've described.
Is there an external library that you need to reference, or are all of your source files organized in such a way that they can reference each other?

SFML no longer working

Following a complete reformat and an upgrade from Visual Studio 2012 to 2015, my program will not compile and spits linker errors at me. I have looked at the paths, linker and whatnot, and it looks just as it should for it to work, I have looked at my code as well in the referenced classes, but they are all set up with proper includes and namespaces too.
All files, including the SFML libraries and my own source code, was kept on my dropbox before i reformatted, so no files have changed folders, which i have double-checked as well.
Entire project is written in C++
1>------ Build started: Project: Starfall, Configuration: Debug x64 ------
1>AnimatedSprite.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::RectangleShape & __cdeclsf::RectangleShape::operator=(class sf::RectangleShape &&)" (__imp_??4RectangleShape#sf##QEAAAEAV01#$$QEAV01##Z) referenced in function "public: __cdecl AnimatedSprite::AnimatedSprite(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct HandlerContainer *)" (??0AnimatedSprite##QEAA#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PEAUHandlerContainer###Z)
1>DynamicSprite.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class sf::RectangleShape & __cdecl sf::RectangleShape::operator=(class sf::RectangleShape &&)" (__imp_??4RectangleShape#sf##QEAAAEAV01#$$QEAV01##Z)
1>CuboidDrawable.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::ConvexShape & __cdecl sf::ConvexShape::operator=(class sf::ConvexShape &&)" (__imp_??4ConvexShape#sf##QEAAAEAV01#$$QEAV01##Z) referenced in function "public: __cdecl CuboidDrawable::CuboidDrawable(class CuboidShape,struct HandlerContainer *)" (??0CuboidDrawable##QEAA#VCuboidShape##PEAUHandlerContainer###Z)
1>C:\Users\Riilu\Dropbox\Starfall\Code and shit\Starfall\x64\Debug\Starfall.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Did you also upgrade SFML libraries to VS2015? Read here - "You must download the package that matches your version of Visual C++. ... If there's no SFML package compiled for your version of Visual C++, you will have to build SFML yourself"

CATCH Unit Testing Suite with Visual Studio 2010

As far as I understand it, I can simply place catch.hpp into my project directory, add it to the project, and then start writing tests. I'm running into a few, or 11 to be exact, linker errors once I try using some of the macros outlined in the tutorial.
#include "catch.hpp"
unsigned int Factorial( unsigned int number ) {
return number <= 1 ? number : Factorial(number-1)*number;
}
TEST_CASE( "Factorials are computed", "[factorial]" ) {
REQUIRE( Factorial(1) == 1 );
REQUIRE( Factorial(2) == 2 );
REQUIRE( Factorial(3) == 6 );
REQUIRE( Factorial(10) == 3628800 );
}
I'm able to create a single file out of the first example and compile it with g++, but when I just paste the same code into my VS2010 project and then try to run it, I run into the linker errors. Unfortunately I'm not familiar enough with C++ at this point to decode the errors myself, and after taking a look at the single file here, I was unable to discern the issue.
Error 1 error LNK2019: unresolved external symbol "public: __thiscall Catch::AutoReg::AutoReg(void (__cdecl*)(void),struct Catch::SourceLineInfo const &,struct Catch::NameAndDesc const &)" (??0AutoReg#Catch##QAE#P6AXXZABUSourceLineInfo#1#ABUNameAndDesc#1##Z) referenced in function "void __cdecl `anonymous namespace'::`dynamic initializer for 'autoRegistrar27''(void)" (??__EautoRegistrar27#?A0x3911e331##YAXXZ) C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\FirstCPPApplication\FirstCPPApplication.obj 1 1 FirstCPPApplication
Error 2 error LNK2019: unresolved external symbol "public: __thiscall Catch::ExpressionResultBuilder::ExpressionResultBuilder(enum Catch::ResultWas::OfType)" (??0ExpressionResultBuilder#Catch##QAE#W4OfType#ResultWas#1##Z) referenced in function __catch$?____C_A_T_C_H____T_E_S_T____27##YAXXZ$0 C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\FirstCPPApplication\FirstCPPApplication.obj 1 1 FirstCPPApplication
Error 3 error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Catch::translateActiveException(void)" (?translateActiveException#Catch##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ) referenced in function __catch$?____C_A_T_C_H____T_E_S_T____27##YAXXZ$0 C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\FirstCPPApplication\FirstCPPApplication.obj 1 1 FirstCPPApplication
Error 4 error LNK2019: unresolved external symbol "public: class Catch::ExpressionResultBuilder & __thiscall Catch::ExpressionResultBuilder::endExpression(enum Catch::ResultDisposition::Flags)" (?endExpression#ExpressionResultBuilder#Catch##QAEAAV12#W4Flags#ResultDisposition#2##Z) referenced in function "void __cdecl ____C_A_T_C_H____T_E_S_T____27(void)" (?____C_A_T_C_H____T_E_S_T____27##YAXXZ) C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\FirstCPPApplication\FirstCPPApplication.obj 1 1 FirstCPPApplication
Error 5 error LNK2019: unresolved external symbol "public: __thiscall Catch::AssertionInfo::AssertionInfo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct Catch::SourceLineInfo const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum Catch::ResultDisposition::Flags)" (??0AssertionInfo#Catch##QAE#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABUSourceLineInfo#1#0W4Flags#ResultDisposition#1##Z) referenced in function "void __cdecl ____C_A_T_C_H____T_E_S_T____27(void)" (?____C_A_T_C_H____T_E_S_T____27##YAXXZ) C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\FirstCPPApplication\FirstCPPApplication.obj 1 1 FirstCPPApplication
Error 6 error LNK2019: unresolved external symbol "struct Catch::IContext & __cdecl Catch::getCurrentContext(void)" (?getCurrentContext#Catch##YAAAUIContext#1#XZ) referenced in function "struct Catch::IResultCapture & __cdecl Catch::getResultCapture(void)" (?getResultCapture#Catch##YAAAUIResultCapture#1#XZ) C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\FirstCPPApplication\FirstCPPApplication.obj 1 1 FirstCPPApplication
Error 7 error LNK2019: unresolved external symbol "public: class Catch::ExpressionResultBuilder & __thiscall Catch::ExpressionResultBuilder::setOp(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?setOp#ExpressionResultBuilder#Catch##QAEAAV12#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) referenced in function "private: class Catch::ExpressionResultBuilder & __thiscall Catch::ExpressionLhs<int const &>::captureExpression<0,int>(int const &)" (??$captureExpression#$0A#H#?$ExpressionLhs#ABH#Catch##AAEAAVExpressionResultBuilder#1#ABH#Z) C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\FirstCPPApplication\FirstCPPApplication.obj 1 1 FirstCPPApplication
Error 8 error LNK2019: unresolved external symbol "public: class Catch::ExpressionResultBuilder & __thiscall Catch::ExpressionResultBuilder::setRhs(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?setRhs#ExpressionResultBuilder#Catch##QAEAAV12#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) referenced in function "private: class Catch::ExpressionResultBuilder & __thiscall Catch::ExpressionLhs<int const &>::captureExpression<0,int>(int const &)" (??$captureExpression#$0A#H#?$ExpressionLhs#ABH#Catch##AAEAAVExpressionResultBuilder#1#ABH#Z) C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\FirstCPPApplication\FirstCPPApplication.obj 1 1 FirstCPPApplication
Error 9 error LNK2019: unresolved external symbol "public: class Catch::ExpressionResultBuilder & __thiscall Catch::ExpressionResultBuilder::setLhs(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?setLhs#ExpressionResultBuilder#Catch##QAEAAV12#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) referenced in function "private: class Catch::ExpressionResultBuilder & __thiscall Catch::ExpressionLhs<int const &>::captureExpression<0,int>(int const &)" (??$captureExpression#$0A#H#?$ExpressionLhs#ABH#Catch##AAEAAVExpressionResultBuilder#1#ABH#Z) C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\FirstCPPApplication\FirstCPPApplication.obj 1 1 FirstCPPApplication
Error 10 error LNK2019: unresolved external symbol "public: class Catch::ExpressionResultBuilder & __thiscall Catch::ExpressionResultBuilder::setResultType(bool)" (?setResultType#ExpressionResultBuilder#Catch##QAEAAV12#_N#Z) referenced in function "private: class Catch::ExpressionResultBuilder & __thiscall Catch::ExpressionLhs<int const &>::captureExpression<0,int>(int const &)" (??$captureExpression#$0A#H#?$ExpressionLhs#ABH#Catch##AAEAAVExpressionResultBuilder#1#ABH#Z) C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\FirstCPPApplication\FirstCPPApplication.obj 1 1 FirstCPPApplication
Error 11 error LNK2019: unresolved external symbol "public: __thiscall Catch::AutoReg::~AutoReg(void)" (??1AutoReg#Catch##QAE#XZ) referenced in function "void __cdecl `anonymous namespace'::`dynamic atexit destructor for 'autoRegistrar27''(void)" (??__FautoRegistrar27#?A0x3911e331##YAXXZ) C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\FirstCPPApplication\FirstCPPApplication.obj 1 1 FirstCPPApplication
Error 12 error LNK1120: 11 unresolved externals C:\Users\Mark\documents\visual studio 2010\Projects\FirstCPPApplication\Debug\FirstCPPApplication.exe FirstCPPApplication
long story short: split your single project solution into 3, use a .lib of the old exe, add the projects to the appropriate paths, update the linker, and you're good to go.
AE Drew's answer helped solve my problem, but I want to put a more full
solution to the question's title, in case anyone's coming from Google,
especially if they are looking for a simple breakdown from a beginner's
perspective.
If you only had one project in your solution that built a .exe for you, CATCH
wouldn't work: your solution needs 3 projects (as far as I know) to be able to
test your code.
Source_project, The main codebase project (in which the source code for
your application resides)
Test_project, The test suites project (in which the REQUIRES tests appear
as outlined in the above question)
Main_project, The project where you actually call and run the code from the
source codebase.
In order to convert your original single-project solution into something that
you can use in both tests and to properly run, you'll need to build a .lib or
a .dll so that other projects (including other people's projects) can use the
same code. Altering this answer, all it takes is to
right-click on your project in the Solution Explorer, and select >
Properties.... Under Configuration Properties -> General there's an > option
called Configuration Type. If you change it to [Static Library > (.lib)], your
project will generate a [.lib] when it is built.
And then in the 3rd project, main_project, where you have a barebones setup
from a Win32 Console Application that only contains a file that looks something
like:
#include "stdafx.h"
#include "HEADER_FROM_FIRST_PROJECT.h"
int _tmain(int argc, _TCHAR* argv[])
{
METHOD_FROM_FIRST_PROJECT();
return 0;
}
where you import a header file from Source_project, the first project that we
created (the one that used to be an exe, but is now building to a lib). But
that's not going to run yet, you need to add the Source_project's directory to
this projects additional directories, by right clicking the project in the
Solution Explorer, under Properties > Configuration Properties > C/C++ > General >
Additional Include Directories, add the source_project's folder to the list. This'll
allow the #include lines to automatically search that directory for the appropriate
files, saving you from having to write ../source_project/HEADER_FROM_FIRST_PROJECT.h.
Finally, the last step is to make sure that the linker will be able to actually
find the objects that you are trying to include. And since we're building a
.lib, we're able to do this rather simply. In the same settings dialog box as
before, the Projects Properties dialog, we'll navigate instead to Configuration
Properties > Linker > Input > Additional Dependencies and add the relative path to the
source_project.lib file, which would look something like ../Debug/source_project.lib.
Note that if you have any .dlls that are in the old exe project, it'll
need to be moved into the new main_project.
Also note that this is all very new to me and some of the terms and information are bound to be incorrect.
Just scanning through the links you provide, I think you may need to add this line at the top of your file.
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
It looks like the functions you are trying to link are within #if defined CATCH_CONFIG_MAIN .... #endif preprocessor directives.

cppcms lots of unresolved external symbols

I am having errors as follows trying to build cppcms.
Error 184 error LNK2019: unresolved external symbol __imp_pcre_compile referenced in function "public: void __cdecl booster::regex::assign(class std::basic_string,class std::allocator > const &,int)" (?assign#regex#booster##QEAAXAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) C:\Stuff\Development\CPP\cppcms-1.0.2\build\booster\pcre_regex.obj
Error 185 error LNK2019: unresolved external symbol __imp_pcre_exec referenced in function "public: bool __cdecl booster::regex::match(char const *,char const *,class std::vector,class std::allocator > > &,int)const " (?match#regex#booster##QEBA_NPEBD0AEAV?$vector#U?$pair#HH#std##V?$allocator#U?$pair#HH#std###2##std##H#Z) C:\Stuff\Development\CPP\cppcms-1.0.2\build\booster\pcre_regex.obj
Error 186 error LNK2019: unresolved external symbol __imp_pcre_fullinfo referenced in function "public: void __cdecl booster::regex::assign(class std::basic_string,class std::allocator > const &,int)" (?assign#regex#booster##QEAAXAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) C:\Stuff\Development\CPP\cppcms-1.0.2\build\booster\pcre_regex.obj
Error 187 error LNK2019: unresolved external symbol __imp_pcre_malloc referenced in function "public: __cdecl booster::regex::data::data(struct booster::regex::data const &)" (??0data#regex#booster##QEAA#AEBU012##Z) C:\Stuff\Development\CPP\cppcms-1.0.2\build\booster\pcre_regex.obj
Error 188 error LNK2019: unresolved external symbol __imp_pcre_free referenced in function __catch$??0data#regex#booster##QEAA#AEBU012##Z$0 C:\Stuff\Development\CPP\cppcms-1.0.2\build\booster\pcre_regex.obj
Error 189 error LNK2019: unresolved external symbol __imp_htons referenced in function "public: __cdecl booster::aio::endpoint::endpoint(class std::basic_string,class std::allocator > const &,int)" (??0endpoint#aio#booster##QEAA#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) C:\Stuff\Development\CPP\cppcms-1.0.2\build\booster\endpoint.obj
My environment is Windows 7 64 bit, using Visual Studio 2012 Professional, and CMake 2.8.9.
For everything I compile, I configure CMake to generate solutions for VS2012 to use the 64 bit compiler. When I do compile the libraries, I compile the release versions.
First I compile Zlib 1.2.7 without a problem.
Second I compile pcre-8.31 without a problem.
Then when it gets time to compile cppcms-1.0.2 I get a bunch or errors as I pointed out before. When configuring cppcms in CMake, I have my PYTHON 2.7 set, I use C:/Stuff/Development/CPP/Zlib/zlib-1.2.7/build for my ZLIB_INCLUDE_DIR, and just append a /Release/zlibstatic.lib at the end of that and you have the ZLIB library I am using, but I am not sure if I have my PCRE set up correctly.
Being that PCRE has an include and include2 in CMake, I wasn't sure what to put in them so I just did the pcre-8.31 root directory, and the pcre-8.31 build directory. For PCRE_LIB I use pcre-8.31/build/Release/pcre.lib.
I have deleted all of the build directories for the libraries and started over again even, but I still have these issues and I am not sure what could be causing them. Later I realized the booster inside of the cppcms build directory also has a solution, so I built that first, which had 3 failed projects, but most succeeded, however it didn't make a difference for cppcms building.
If you have any more questions about what I was doing, please ask and I will edit them in.
The best place to ask questions about cppcms is in the cppcms mailing list. Sign up here:
https://lists.sourceforge.net/lists/listinfo/cppcms-users
Artyom is providing an excellent support service there. Although he is also a S.O. member, not all cppcms developers are, and many of them also provide help on the mailing list. Overall, you'll get better answers there, especially since the people who are able to answer will more quickly notice your question.

Linking error while using Visual Studio 2005(VC8)

I am getting a bunch of linking errors while trying to link the release version of an executable(debug version does not have the same issue). Comparing the command line for the link does not reveal any issues.
there are broadly 2 types of errors neither of which I can get a handle on.
The first kind complains about a unresolved external symbol _declspec(dllimport)
As an example:
error LNK2019: unresolved external symbol
"_declspec(dllimport)
public: __thiscall
stlpd_std::basic_string,class stlpd_std::allocator >::basic_string,class stlpd_std::allocator >(class stlpd_std::basic_string,class stlpd_std::allocator > const &)" (_imp??0?$basic_string#DV?$char_traits#D#stlpd_std##V?$allocator#D#2##stlpd_std##QAE#ABV01##Z) referenced in function "public: __thiscall Springfield::generic::runtime_error::runtime_error(class stlpd_std::basic_string,class stlpd_std::allocator > const &)" (??0runtime_error#generic#Springfield##QAE#ABV?$basic_string#DV?$char_traits#D#stlpd_std##V?$allocator#D#2##stlpd_std###Z)
for a more human readable version(replacing all the strings):
error LNK2019: unresolved external symbol
"__declspec(dllimport)
public: __thiscall
string::basic_string,class stlpd_std::allocator >(class string const &)" (_imp??0?$basic_string#DV?$char_traits#D#stlpd_std##V?$allocator#D#2##stlpd_std##QAE#ABV01##Z) referenced in function "public: __thiscall Springfield::generic::runtime_error::runtime_error(class string const &)" (??0runtime_error#generic#Springfield##QAE#ABV?$basic_string#DV?$char_traits#D#stlpd_std##V?$allocator#D#2##stlpd_std###Z
The sceond class of errors complains about
unresolved external symbol __CrtDbgReportW
I hope I can get some kind of insight in dealing with this.
From the errors it looks like you are not including the CRT as one of your linked libraries. Here is a link to the different CRT lib's offered in Visual Studio 2005. Choose the one which is most appropriate and make sure it's in the list of lib's to link against
http://msdn.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx
It looks like you're either including a file that's been built using the debug settings or you're mixing runtime libraries (DLL and static).