QGIS: Error LNK2019 using QApplication - c++

I'm trying to create a project using the QGIS class "QApplication" but it seems to fail due to an error I canĀ“t understand.
I'm using this build version of QGIS made for QT5.7, VS2015, W10 x64 and my main.cpp just containts the following lines:
#define CORE_EXPORT __declspec(dllexport)
#include "QGisTest.h"
#include <QtWidgets/QApplication>
#include <qgsapplication.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGisTest w;
w.show();
return a.exec();
}
And when I try to build it, these errors show up:
1>------ Build started: Project: QGisTest, Configuration: Release x64 ------
1> moc_qgsapplication.cpp
1> Creating library C:\Users\GRODRIGUEZ\Documents\Visual Studio 2015\Projects\QGisTest\x64\Release\QGisTest.lib and object C:\Users\GRODRIGUEZ\Documents\Visual Studio 2015\Projects\QGisTest\x64\Release\QGisTest.exp
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static class QMap<class QString,class QString> QgsApplication::mSystemEnvVars21800" (?mSystemEnvVars21800#QgsApplication##0V?$QMap#VQString##V1###A) referenced in function "public: static class QMap<class QString,class QString> __cdecl QgsApplication::systemEnvVars(void)" (?systemEnvVars#QgsApplication##SA?AV?$QMap#VQString##V1###XZ)
1>main.obj : error LNK2001: unresolved external symbol "private: static class QMap<class QString,class QString> QgsApplication::mSystemEnvVars21800" (?mSystemEnvVars21800#QgsApplication##0V?$QMap#VQString##V1###A)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static bool QgsApplication::mRunningFromBuildDir21800" (?mRunningFromBuildDir21800#QgsApplication##0_NA) referenced in function "public: static bool __cdecl QgsApplication::isRunningFromBuildDir(void)" (?isRunningFromBuildDir#QgsApplication##SA_NXZ)
1>main.obj : error LNK2001: unresolved external symbol "private: static bool QgsApplication::mRunningFromBuildDir21800" (?mRunningFromBuildDir21800#QgsApplication##0_NA)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static class QString QgsApplication::mBuildSourcePath21800" (?mBuildSourcePath21800#QgsApplication##0VQString##A) referenced in function "public: static class QString __cdecl QgsApplication::buildSourcePath(void)" (?buildSourcePath#QgsApplication##SA?AVQString##XZ)
1>main.obj : error LNK2001: unresolved external symbol "private: static class QString QgsApplication::mBuildSourcePath21800" (?mBuildSourcePath21800#QgsApplication##0VQString##A)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static class QString QgsApplication::mCfgIntDir21800" (?mCfgIntDir21800#QgsApplication##0VQString##A) referenced in function "public: static class QString __cdecl QgsApplication::cfgIntDir(void)" (?cfgIntDir#QgsApplication##SA?AVQString##XZ)
1>main.obj : error LNK2001: unresolved external symbol "private: static class QString QgsApplication::mCfgIntDir21800" (?mCfgIntDir21800#QgsApplication##0VQString##A)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static class QString QgsApplication::mBuildOutputPath21800" (?mBuildOutputPath21800#QgsApplication##0VQString##A) referenced in function "public: static class QString __cdecl QgsApplication::buildOutputPath(void)" (?buildOutputPath#QgsApplication##SA?AVQString##XZ)
1>main.obj : error LNK2001: unresolved external symbol "private: static class QString QgsApplication::mBuildOutputPath21800" (?mBuildOutputPath21800#QgsApplication##0VQString##A)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static class QStringList QgsApplication::mGdalSkipList21800" (?mGdalSkipList21800#QgsApplication##0VQStringList##A) referenced in function "public: static class QStringList __cdecl QgsApplication::skippedGdalDrivers(void)" (?skippedGdalDrivers#QgsApplication##SA?AVQStringList##XZ)
1>main.obj : error LNK2001: unresolved external symbol "private: static class QStringList QgsApplication::mGdalSkipList21800" (?mGdalSkipList21800#QgsApplication##0VQStringList##A)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static int QgsApplication::mMaxThreads21800" (?mMaxThreads21800#QgsApplication##0HA) referenced in function "public: static int __cdecl QgsApplication::maxThreads(void)" (?maxThreads#QgsApplication##SAHXZ)
1>main.obj : error LNK2001: unresolved external symbol "private: static int QgsApplication::mMaxThreads21800" (?mMaxThreads21800#QgsApplication##0HA)
1>C:\Users\GRODRIGUEZ\Documents\Visual Studio 2015\Projects\QGisTest\x64\Release\\QGisTest.exe : fatal error LNK1120: 7 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I also added to the project this "moc_qgsapplication.cpp" and wrote the line:
#define CORE_EXPORT __declspec(dllexport)
to avoid other compilation problems and linked to the project the QGIS and QT 5.7 libs.
Any idea how to fix it?
EDIT:
I have changed the two lines of main.cpp as suggested and now contains the following code:
#define CORE_EXPORT __declspec(dllimport)
#include "QGisTest.h"
#include <QApplication>
#include <qgsapplication.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGisTest w;
w.show();
return a.exec();
}
but when I try to build it, these erros still show up:
1>------ Build started: Project: QGisTest, Configuration: Release x64 ------
1> moc_qgsapplication.cpp
1> main.cpp
1> Generating Code...
1> Creating library C:\Users\GRODRIGUEZ\Documents\Visual Studio 2015\Projects\QGisTest\x64\Release\QGisTest.lib and object C:\Users\GRODRIGUEZ\Documents\Visual Studio 2015\Projects\QGisTest\x64\Release\QGisTest.exp
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static class QMap<class QString,class QString> QgsApplication::mSystemEnvVars21800" (?mSystemEnvVars21800#QgsApplication##0V?$QMap#VQString##V1###A) referenced in function "public: static class QMap<class QString,class QString> __cdecl QgsApplication::systemEnvVars(void)" (?systemEnvVars#QgsApplication##SA?AV?$QMap#VQString##V1###XZ)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static bool QgsApplication::mRunningFromBuildDir21800" (?mRunningFromBuildDir21800#QgsApplication##0_NA) referenced in function "public: static bool __cdecl QgsApplication::isRunningFromBuildDir(void)" (?isRunningFromBuildDir#QgsApplication##SA_NXZ)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static class QString QgsApplication::mBuildSourcePath21800" (?mBuildSourcePath21800#QgsApplication##0VQString##A) referenced in function "public: static class QString __cdecl QgsApplication::buildSourcePath(void)" (?buildSourcePath#QgsApplication##SA?AVQString##XZ)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static class QString QgsApplication::mCfgIntDir21800" (?mCfgIntDir21800#QgsApplication##0VQString##A) referenced in function "public: static class QString __cdecl QgsApplication::cfgIntDir(void)" (?cfgIntDir#QgsApplication##SA?AVQString##XZ)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static class QString QgsApplication::mBuildOutputPath21800" (?mBuildOutputPath21800#QgsApplication##0VQString##A) referenced in function "public: static class QString __cdecl QgsApplication::buildOutputPath(void)" (?buildOutputPath#QgsApplication##SA?AVQString##XZ)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static class QStringList QgsApplication::mGdalSkipList21800" (?mGdalSkipList21800#QgsApplication##0VQStringList##A) referenced in function "public: static class QStringList __cdecl QgsApplication::skippedGdalDrivers(void)" (?skippedGdalDrivers#QgsApplication##SA?AVQStringList##XZ)
1>moc_qgsapplication.obj : error LNK2019: unresolved external symbol "private: static int QgsApplication::mMaxThreads21800" (?mMaxThreads21800#QgsApplication##0HA) referenced in function "public: static int __cdecl QgsApplication::maxThreads(void)" (?maxThreads#QgsApplication##SAHXZ)
1>C:\Users\GRODRIGUEZ\Documents\Visual Studio 2015\Projects\QGisTest\x64\Release\\QGisTest.exe : fatal error LNK1120: 7 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Related

Building Boost 1.70.0 with icu 64.2

I have built icu 64.2 (debug and release for both x86 and x64). My build passes all the tests, so I know icu is not the issue.
I have also built a 64-bit version of boost 1.70.0 using the following b2 build command:
b2 address-model=64 -sICU_PATH=C:\icu-release-64-2\icu4c threading=multi --build-type=complete --toolset=msvc-14.1 -j 6
b2 is detecting my icu build and is showing:
- has_icu builds : yes
When I try to build my project with this boost/regex/icu code:
bool is_valid_password(const icu::UnicodeString& password, const icu::UnicodeString& requirements)
{
return boost::u32regex_match(password, boost::make_u32regex(requirements));
}
I get the following error:
1>------ Build started: Project: URLParser, Configuration: Debug x64 ------
1>URLParser.obj : error LNK2019: unresolved external symbol u_tolower_64 referenced in function "public: int __cdecl boost::icu_regex_traits::translate_nocase(int)const " (?translate_nocase#icu_regex_traits#boost##QEBAHH#Z)
1>libboost_regex-vc141-mt-gd-x64-1_70.lib(icu.obj) : error LNK2001: unresolved external symbol u_tolower_64
1>URLParser.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl icu_64::UnicodeString::length(void)const " (__imp_?length#UnicodeString#icu_64##QEBAHXZ) referenced in function "class boost::basic_regex<int,class boost::icu_regex_traits> __cdecl boost::make_u32regex(class icu_64::UnicodeString const &,unsigned int)" (?make_u32regex#boost##YA?AV?$basic_regex#HVicu_regex_traits#boost###1#AEBVUnicodeString#icu_64##I#Z)
1>URLParser.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: char16_t const * __cdecl icu_64::UnicodeString::getBuffer(void)const " (__imp_?getBuffer#UnicodeString#icu_64##QEBAPEB_SXZ) referenced in function "class boost::basic_regex<int,class boost::icu_regex_traits> __cdecl boost::make_u32regex(class icu_64::UnicodeString const &,unsigned int)" (?make_u32regex#boost##YA?AV?$basic_regex#HVicu_regex_traits#boost###1#AEBVUnicodeString#icu_64##I#Z)
1>libboost_regex-vc141-mt-gd-x64-1_70.lib(icu.obj) : error LNK2019: unresolved external symbol u_isblank_64 referenced in function "public: bool __cdecl boost::icu_regex_traits::isctype(int,unsigned __int64)const " (?isctype#icu_regex_traits#boost##QEBA_NH_K#Z)
1>libboost_regex-vc141-mt-gd-x64-1_70.lib(icu.obj) : error LNK2019: unresolved external symbol u_isspace_64 referenced in function "public: unsigned __int64 __cdecl boost::icu_regex_traits::lookup_classname(int const *,int const *)const " (?lookup_classname#icu_regex_traits#boost##QEBA_KPEBH0#Z)
1>libboost_regex-vc141-mt-gd-x64-1_70.lib(icu.obj) : error LNK2019: unresolved external symbol u_charType_64 referenced in function "public: bool __cdecl boost::icu_regex_traits::isctype(int,unsigned __int64)const " (?isctype#icu_regex_traits#boost##QEBA_NH_K#Z)
1>libboost_regex-vc141-mt-gd-x64-1_70.lib(icu.obj) : error LNK2019: unresolved external symbol u_charFromName_64 referenced in function "public: class std::vector<int,class std::allocator<int> > __cdecl boost::icu_regex_traits::lookup_collatename(int const *,int const *)const " (?lookup_collatename#icu_regex_traits#boost##QEBA?AV?$vector#HV?$allocator#H#std###std##PEBH0#Z)
1>libboost_regex-vc141-mt-gd-x64-1_70.lib(icu.obj) : error LNK2019: unresolved external symbol u_digit_64 referenced in function "public: bool __cdecl boost::icu_regex_traits::isctype(int,unsigned __int64)const " (?isctype#icu_regex_traits#boost##QEBA_NH_K#Z)
1>libboost_regex-vc141-mt-gd-x64-1_70.lib(icu.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl icu_64::Locale::Locale(void)" (__imp_??0Locale#icu_64##QEAA#XZ) referenced in function "public: __cdecl boost::icu_regex_traits::icu_regex_traits(void)" (??0icu_regex_traits#boost##QEAA#XZ)
1>libboost_regex-vc141-mt-gd-x64-1_70.lib(icu.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl icu_64::Locale::Locale(class icu_64::Locale const &)" (__imp_??0Locale#icu_64##QEAA#AEBV01##Z) referenced in function "public: __cdecl boost::re_detail_107000::icu_regex_traits_implementation::icu_regex_traits_implementation(class icu_64::Locale const &)" (??0icu_regex_traits_implementation#re_detail_107000#boost##QEAA#AEBVLocale#icu_64###Z)
1>libboost_regex-vc141-mt-gd-x64-1_70.lib(icu.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl icu_64::Locale::Locale(class icu_64::Locale &&)" (__imp_??0Locale#icu_64##QEAA#$$QEAV01##Z) referenced in function "public: class icu_64::Locale __cdecl boost::basic_regex<int,class boost::icu_regex_traits>::getloc(void)const " (?getloc#?$basic_regex#HVicu_regex_traits#boost###boost##QEBA?AVLocale#icu_64##XZ)
1>libboost_regex-vc141-mt-gd-x64-1_70.lib(icu.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl icu_64::Locale::~Locale(void)" (__imp_??1Locale#icu_64##UEAA#XZ) referenced in function "public: __cdecl boost::icu_regex_traits::icu_regex_traits(void)" (??0icu_regex_traits#boost##QEAA#XZ)
1>libboost_regex-vc141-mt-gd-x64-1_70.lib(icu.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class icu_64::Collator * __cdecl icu_64::Collator::createInstance(class icu_64::Locale const &,enum UErrorCode &)" (__imp_?createInstance#Collator#icu_64##SAPEAV12#AEBVLocale#2#AEAW4UErrorCode###Z) referenced in function "public: __cdecl boost::re_detail_107000::icu_regex_traits_implementation::icu_regex_traits_implementation(class icu_64::Locale const &)" (??0icu_regex_traits_implementation#re_detail_107000#boost##QEAA#AEBVLocale#icu_64###Z)
1>C:\Users\nicho\source\repos\URLParser\x64\Debug\URLParser.exe : fatal error LNK1120: 13 unresolved externals
1>Done building project "URLParser.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I should also note that I built icu and boost with the same compiler and MSVC toolset. Any ideas why boost wouldn't be linking to icu?

Perforce C++ p4api - build fails in Visual Studio

I am trying to build a C++ application which connects to Perforce Server but build fails because it cannot find the p4api libraries.
I am new to C++, Visual Studio and p4api so I probably did something wrong.
I am using Windows 8 and Visual Studio 2013 Professional.
Details:
I downloaded p4api.zip from ftp://ftp.perforce.com/perforce/r15.2/bin.mingw64x64/
Notice that the libraries found in p4api.zip are of type .a where as in the Chapter 2 of user guide says that for Windows it should be .lib
Visual Studio Configuration:
From Visual Studio, Project properties -> Configuration Properties:
Linker -> General -> Additional Libraries Directories => I specified the directory containing the p4api .a files eg C:\Users\myuser\Documents\Visual Studio 2013\Projects\ProjectName\ProjectName\lib\p4api
Linker -> Input -> Additional Dependencies => I specified the name of each .a file in the order described on user guide. I also added extra libs as described in this blog eg libclient.a;librpc.a;libsupp.a;libp4sslstub.a;wsock32.lib;libcmt.lib;oldnames.lib;kernel32.lib;ws2_32.lib;advapi32.lib
Linker -> Command Line -> Additional Options => As in user guide eg /DOS_NT /MT /DCASE_INSENSITIVE
C/C++ -> General -> Additional Include Directories => I specified the location of perforce header files eg C:\Users\myuser\Documents\Visual Studio 2013\Projects\ ProjectName\ProjectName\include\p4
Code
Main.h
#pragma once
#include <iostream>
#include <clientapi.h>
class Main : public ClientUser
{
public:
Main();
~Main();
};
Main.cpp
#include "Main.h"
Main::Main()
{
}
Main::~Main()
{
}
int main() {
std::cout << "Hello World\n";
ClientApi client;
Error e;
client.Init(&e);
Main ui;
client.Run("info", &ui);
client.Final(&e);
}
Build Errors:
1>------ Build started: Project: PEConnect, Configuration: Debug Win32 ------
1>cl : Command line warning D9025: overriding '/MDd' with '/MT'
1> Main.cpp
1>Main.obj : error LNK2019: unresolved external symbol "public: __thiscall Error::~Error(void)" (??1Error##QAE#XZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall ClientUser::~ClientUser(void)" (??1ClientUser##UAE#XZ) referenced in function "public: virtual __thiscall Main::~Main(void)" (??1Main##UAE#XZ)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::InputData(class StrBuf *,class Error *)" (?InputData#ClientUser##UAEXPAVStrBuf##PAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::HandleError(class Error *)" (?HandleError#ClientUser##UAEXPAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::Message(class Error *)" (?Message#ClientUser##UAEXPAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::OutputError(char const *)" (?OutputError#ClientUser##UAEXPBD#Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::OutputInfo(char,char const *)" (?OutputInfo#ClientUser##UAEXDPBD#Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::OutputBinary(char const *,int)" (?OutputBinary#ClientUser##UAEXPBDH#Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::OutputText(char const *,int)" (?OutputText#ClientUser##UAEXPBDH#Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::OutputStat(class StrDict *)" (?OutputStat#ClientUser##UAEXPAVStrDict###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::Prompt(class StrPtr const &,class StrBuf &,int,class Error *)" (?Prompt#ClientUser##UAEXABVStrPtr##AAVStrBuf##HPAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::Prompt(class StrPtr const &,class StrBuf &,int,int,class Error *)" (?Prompt#ClientUser##UAEXABVStrPtr##AAVStrBuf##HHPAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::ErrorPause(char *,class Error *)" (?ErrorPause#ClientUser##UAEXPADPAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::Edit(class FileSys *,class Error *)" (?Edit#ClientUser##UAEXPAVFileSys##PAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::Diff(class FileSys *,class FileSys *,int,char *,class Error *)" (?Diff#ClientUser##UAEXPAVFileSys##0HPADPAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::Diff(class FileSys *,class FileSys *,class FileSys *,int,char *,class Error *)" (?Diff#ClientUser##UAEXPAVFileSys##00HPADPAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::Merge(class FileSys *,class FileSys *,class FileSys *,class FileSys *,class Error *)" (?Merge#ClientUser##UAEXPAVFileSys##000PAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall ClientUser::Resolve(class ClientMerge *,class Error *)" (?Resolve#ClientUser##UAEHPAVClientMerge##PAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall ClientUser::Resolve(class ClientResolveA *,int,class Error *)" (?Resolve#ClientUser##UAEHPAVClientResolveA##HPAVError###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::Help(char const * const *)" (?Help#ClientUser##UAEXPBQBD#Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual class FileSys * __thiscall ClientUser::File(enum FileSysType)" (?File#ClientUser##UAEPAVFileSys##W4FileSysType###Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual class ClientProgress * __thiscall ClientUser::CreateProgress(int)" (?CreateProgress#ClientUser##UAEPAVClientProgress##H#Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall ClientUser::ProgressIndicator(void)" (?ProgressIndicator#ClientUser##UAEHXZ)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::SetOutputCharset(int)" (?SetOutputCharset#ClientUser##UAEXH#Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::DisableTmpCleanup(void)" (?DisableTmpCleanup#ClientUser##UAEXXZ)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall ClientUser::SetQuiet(void)" (?SetQuiet#ClientUser##UAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "public: __thiscall ClientApi::ClientApi(void)" (??0ClientApi##QAE#XZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall ClientApi::~ClientApi(void)" (??1ClientApi##UAE#XZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ClientApi::Init(class Error *)" (?Init#ClientApi##QAEXPAVError###Z) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ClientApi::Run(char const *,class ClientUser *)" (?Run#ClientApi##QAEXPBDPAVClientUser###Z) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: int __thiscall ClientApi::Final(class Error *)" (?Final#ClientApi##QAEHPAVError###Z) referenced in function _main
1>Main.obj : error LNK2001: unresolved external symbol "private: static char * StrBuf::nullStrBuf" (?nullStrBuf#StrBuf##0PADA)
1>c:\users\myuser\documents\visual studio 2013\Projects\ProjectName\Debug\PEConnect.exe : fatal error LNK1120: 32 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Additional concerns:
1) Did I download the correct p4api? I cannot find a folder specifically for Windows. The only folder which looks more relevant to Windows is bin.mingw
2) Why the library files are of type .a not .lib?
3) Did I set the dependencies correctly on Visual Studio? If yes, why build fails?
Please let me know if you need more details.
Thanks in advance.

unresolved external linking to static Qwt build

I'm trying to link to a static build of Qwt. to create the static build, I modified qwtconfig.pri to contain
#QWT_CONFIG += QwtDll
and I removed all the #define QWT_DLL references in the code.
However, when I link to the library, I get a bunch of undefined references complaining about QSvgRenderer:
15>qwt.lib(qwt_symbol.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QSvgRenderer::QSvgRenderer(class QObject *)" (__imp_??0QSvgRenderer##QEAA#PEAVQObject###Z) referenced in function "public: void __cdecl QwtSymbol::setSvgDocument(class QByteArray const &)" (?setSvgDocument#QwtSymbol##QEAAXAEBVQByteArray###Z)
15>qwt.lib(qwt_symbol.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl QSvgRenderer::~QSvgRenderer(void)" (__imp_??1QSvgRenderer##UEAA#XZ) referenced in function "public: virtual void * __cdecl QSvgRenderer::`scalar deleting destructor'(unsigned int)" (??_GQSvgRenderer##UEAAPEAXI#Z)
15>qwt.lib(qwt_symbol.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl QSvgRenderer::isValid(void)const " (__imp_?isValid#QSvgRenderer##QEBA_NXZ) referenced in function "void __cdecl qwtDrawSvgSymbols(class QPainter *,class QPointF const *,int,class QSvgRenderer *,class QwtSymbol const &)" (?qwtDrawSvgSymbols##YAXPEAVQPainter##PEBVQPointF##HPEAVQSvgRenderer##AEBVQwtSymbol###Z)
15>qwt.lib(qwt_symbol.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QRectF __cdecl QSvgRenderer::viewBoxF(void)const " (__imp_?viewBoxF#QSvgRenderer##QEBA?AVQRectF##XZ) referenced in function "public: virtual class QRect __cdecl QwtSymbol::boundingRect(void)const " (?boundingRect#QwtSymbol##UEBA?AVQRect##XZ)
15>qwt.lib(qwt_symbol.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl QSvgRenderer::load(class QByteArray const &)" (__imp_?load#QSvgRenderer##QEAA_NAEBVQByteArray###Z) referenced in function "public: void __cdecl QwtSymbol::setSvgDocument(class QByteArray const &)" (?setSvgDocument#QwtSymbol##QEAAXAEBVQByteArray###Z)
15>qwt.lib(qwt_symbol.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QSvgRenderer::render(class QPainter *,class QRectF const &)" (__imp_?render#QSvgRenderer##QEAAXPEAVQPainter##AEBVQRectF###Z) referenced in function "public: void __cdecl QwtSymbol::drawSymbol(class QPainter *,class QRectF const &)const " (?drawSymbol#QwtSymbol##QEBAXPEAVQPainter##AEBVQRectF###Z)
15>qwt.lib(qwt_symbol.obj) : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl QSvgRenderer::metaObject(void)const " (?metaObject#QSvgRenderer##UEBAPEBUQMetaObject##XZ)
15>qwt.lib(qwt_symbol.obj) : error LNK2001: unresolved external symbol "public: virtual int __cdecl QSvgRenderer::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall#QSvgRenderer##UEAAHW4Call#QMetaObject##HPEAPEAX#Z)
15>qwt.lib(qwt_symbol.obj) : error LNK2001: unresolved external symbol "public: virtual void * __cdecl QSvgRenderer::qt_metacast(char const *)" (?qt_metacast#QSvgRenderer##UEAAPEAXPEBD#Z)
15>C:\workspace\fixQwt\executables\linkerGUI\bin\Release\linkerGUI.exe : fatal error LNK1120: 9 unresolved externals
Is there something else in the project configuration I need to do so it can link properly to QSvgRenderer?
Guess your version of Qt is without SVG support - or you forget to add it to your project dependency. If you are not interested in SVG stuff at all you could also disable it in qwtconfig.pri as well:
See: "QWT_CONFIG += QwtSvg"

Creating a dll in pdfium

I am trying to create a dll for pdfium. I am using Visual Studio 2013 (C++)
I've tried following instructions from https://github.com/pvginkel/PdfiumViewer but that hasn't worked.(I am trying to get a pdfium dll for a project that is not PdfiumViewer). I get the following errors:
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(1193,5): warning MSB8012: TargetPath(\build\Debug\lib\pdfium.dll) does not match the Linker's OutputFile property value (C:\build\Debug\pdfium.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
2> Creating library \build\Debug\pdfium.lib and object \build\Debug\pdfium.exp
2>fpdfdoc.lib(doc_form.obj) : error LNK2019: unresolved external symbol __imp_CreateFontA referenced in function "public: static class CPDF_Font * __cdecl CPDF_InterForm::AddSystemFont(class CPDF_Document const *,class CFX_ByteString,unsigned char)" (?AddSystemFont#CPDF_InterForm##SAPEAVCPDF_Font##PEBVCPDF_Document##VCFX_ByteString##E#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2001: unresolved external symbol __imp_CreateFontA
2>fpdfdoc.lib(doc_form.obj) : error LNK2019: unresolved external symbol __imp_CreateFontW referenced in function "public: static class CPDF_Font * __cdecl CPDF_InterForm::AddSystemFont(class CPDF_Document const *,class CFX_WideString,unsigned char)" (?AddSystemFont#CPDF_InterForm##SAPEAVCPDF_Font##PEBVCPDF_Document##VCFX_WideString##E#Z)
2>fxge.lib(fx_win32_print.obj) : error LNK2001: unresolved external symbol __imp_DeleteObject
2>fpdfdoc.lib(doc_form.obj) : error LNK2001: unresolved external symbol __imp_DeleteObject
2>fpdfapi.lib(fpdf_edit_doc.obj) : error LNK2001: unresolved external symbol __imp_DeleteObject
2>fxge.lib(fx_win32_device.obj) : error LNK2001: unresolved external symbol __imp_DeleteObject
2>fxge.lib(fx_win32_dib.obj) : error LNK2001: unresolved external symbol __imp_DeleteObject
2>fpdfdoc.lib(doc_form.obj) : error LNK2019: unresolved external symbol __imp_EnumFontFamiliesExA referenced in function "int __cdecl RetrieveSpecificFont(struct tagLOGFONTA &)" (?RetrieveSpecificFont##YAHAEAUtagLOGFONTA###Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2001: unresolved external symbol __imp_EnumFontFamiliesExA
2>fpdfdoc.lib(doc_form.obj) : error LNK2019: unresolved external symbol __imp_GetStockObject referenced in function "int __cdecl RetrieveStockFont(int,unsigned char,struct tagLOGFONTA &)" (?RetrieveStockFont##YAHHEAEAUtagLOGFONTA###Z)
2>fpdfdoc.lib(doc_form.obj) : error LNK2019: unresolved external symbol __imp_GetObjectA referenced in function "public: static class CPDF_Font * __cdecl CPDF_InterForm::AddSystemFont(class CPDF_Document const *,class CFX_ByteString,unsigned char)" (?AddSystemFont#CPDF_InterForm##SAPEAVCPDF_Font##PEBVCPDF_Document##VCFX_ByteString##E#Z)
2>fpdfdoc.lib(doc_form.obj) : error LNK2019: unresolved external symbol __imp_GetObjectW referenced in function "public: static class CPDF_Font * __cdecl CPDF_InterForm::AddSystemFont(class CPDF_Document const *,class CFX_WideString,unsigned char)" (?AddSystemFont#CPDF_InterForm##SAPEAVCPDF_Font##PEBVCPDF_Document##VCFX_WideString##E#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2001: unresolved external symbol __imp_GetObjectW
2>fxge.lib(fx_win32_dib.obj) : error LNK2001: unresolved external symbol __imp_GetObjectW
2>fxge.lib(fx_win32_dwrite.obj) : error LNK2001: unresolved external symbol __imp_GetObjectW
2>fpdfdoc.lib(doc_form.obj) : error LNK2019: unresolved external symbol __imp_GetDC referenced in function "int __cdecl RetrieveSpecificFont(struct tagLOGFONTA &)" (?RetrieveSpecificFont##YAHAEAUtagLOGFONTA###Z)
2>fpdfdoc.lib(doc_form.obj) : error LNK2019: unresolved external symbol __imp_ReleaseDC referenced in function "int __cdecl RetrieveSpecificFont(struct tagLOGFONTA &)" (?RetrieveSpecificFont##YAHAEAUtagLOGFONTA###Z)
2>fpdfapi.lib(fpdf_edit_doc.obj) : error LNK2019: unresolved external symbol __imp_CreateCompatibleDC referenced in function "public: class CPDF_Font * __cdecl CPDF_Document::AddWindowsFont(struct tagLOGFONTA *,int,int)" (?AddWindowsFont#CPDF_Document##QEAAPEAVCPDF_Font##PEAUtagLOGFONTA##HH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2001: unresolved external symbol __imp_CreateCompatibleDC
2>fxge.lib(fx_win32_dib.obj) : error LNK2001: unresolved external symbol __imp_CreateCompatibleDC
2>fpdfapi.lib(fpdf_edit_doc.obj) : error LNK2019: unresolved external symbol __imp_CreateFontIndirectA referenced in function "public: class CPDF_Font * __cdecl CPDF_Document::AddWindowsFont(struct tagLOGFONTA *,int,int)" (?AddWindowsFont#CPDF_Document##QEAAPEAVCPDF_Font##PEAUtagLOGFONTA##HH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2001: unresolved external symbol __imp_CreateFontIndirectA
2>fpdfapi.lib(fpdf_edit_doc.obj) : error LNK2019: unresolved external symbol __imp_DeleteDC referenced in function "public: class CPDF_Font * __cdecl CPDF_Document::AddWindowsFont(struct tagLOGFONTA *,int,int)" (?AddWindowsFont#CPDF_Document##QEAAPEAVCPDF_Font##PEAUtagLOGFONTA##HH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2001: unresolved external symbol __imp_DeleteDC
2>fxge.lib(fx_win32_dib.obj) : error LNK2001: unresolved external symbol __imp_DeleteDC
2>fpdfapi.lib(fpdf_edit_doc.obj) : error LNK2019: unresolved external symbol __imp_GetCharWidthW referenced in function "public: class CPDF_Font * __cdecl CPDF_Document::AddWindowsFont(struct tagLOGFONTA *,int,int)" (?AddWindowsFont#CPDF_Document##QEAAPEAVCPDF_Font##PEAUtagLOGFONTA##HH#Z)
2>fpdfapi.lib(fpdf_edit_doc.obj) : error LNK2019: unresolved external symbol __imp_GetFontData referenced in function "class CFX_ByteString __cdecl _FPDF_GetPSNameFromTT(struct HDC__ *)" (?_FPDF_GetPSNameFromTT##YA?AVCFX_ByteString##PEAUHDC__###Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2001: unresolved external symbol __imp_GetFontData
2>fpdfapi.lib(fpdf_edit_doc.obj) : error LNK2019: unresolved external symbol __imp_GetOutlineTextMetricsW referenced in function "public: class CPDF_Font * __cdecl CPDF_Document::AddWindowsFont(struct tagLOGFONTA *,int,int)" (?AddWindowsFont#CPDF_Document##QEAAPEAVCPDF_Font##PEAUtagLOGFONTA##HH#Z)
2>fpdfapi.lib(fpdf_edit_doc.obj) : error LNK2019: unresolved external symbol __imp_SelectObject referenced in function "public: class CPDF_Font * __cdecl CPDF_Document::AddWindowsFont(struct tagLOGFONTA *,int,int)" (?AddWindowsFont#CPDF_Document##QEAAPEAVCPDF_Font##PEAUtagLOGFONTA##HH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2001: unresolved external symbol __imp_SelectObject
2>fxge.lib(fx_win32_dib.obj) : error LNK2001: unresolved external symbol __imp_SelectObject
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_BitBlt referenced in function "protected: virtual int __cdecl CGdiDisplayDriver::GetDIBits(class CFX_DIBitmap *,int,int,void *,int)" (?GetDIBits#CGdiDisplayDriver##MEAAHPEAVCFX_DIBitmap##HHPEAXH#Z)
2>fxge.lib(fx_win32_dib.obj) : error LNK2001: unresolved external symbol __imp_BitBlt
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_CreateBitmap referenced in function "protected: __cdecl CGdiDeviceDriver::CGdiDeviceDriver(struct HDC__ *,int)" (??0CGdiDeviceDriver##IEAA#PEAUHDC__##H#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_CreateCompatibleBitmap referenced in function "protected: virtual int __cdecl CGdiDisplayDriver::GetDIBits(class CFX_DIBitmap *,int,int,void *,int)" (?GetDIBits#CGdiDisplayDriver##MEAAHPEAVCFX_DIBitmap##HHPEAXH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_CreatePen referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::DrawCosmeticLine(float,float,float,float,unsigned int,int,void *,int)" (?DrawCosmeticLine#CGdiDeviceDriver##MEAAHMMMMIHPEAXH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_CreateRectRgn referenced in function "protected: virtual void * __cdecl CGdiDeviceDriver::GetClipRgn(void)" (?GetClipRgn#CGdiDeviceDriver##MEAAPEAXXZ)
2>fxge.lib(fx_win32_print.obj) : error LNK2001: unresolved external symbol __imp_CreateRectRgn
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_CreateSolidBrush referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::FillRect(struct FX_RECT const *,unsigned int,int,void *,int)" (?FillRect#CGdiDeviceDriver##MEAAHPEBUFX_RECT##IHPEAXH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_ExtEscape referenced in function "int __cdecl GetPSLevel(struct HDC__ *)" (?GetPSLevel##YAHPEAUHDC__###Z)
2>fxge.lib(fx_win32_print.obj) : error LNK2001: unresolved external symbol __imp_ExtEscape
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_GetClipBox referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::GetClipBox(struct FX_RECT *)" (?GetClipBox#CGdiDeviceDriver##MEAAHPEAUFX_RECT###Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_GetClipRgn referenced in function "protected: virtual void * __cdecl CGdiDeviceDriver::GetClipRgn(void)" (?GetClipRgn#CGdiDeviceDriver##MEAAPEAXXZ)
2>fxge.lib(fx_win32_print.obj) : error LNK2001: unresolved external symbol __imp_GetClipRgn
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_GetDeviceCaps referenced in function "protected: __cdecl CGdiDeviceDriver::CGdiDeviceDriver(struct HDC__ *,int)" (??0CGdiDeviceDriver##IEAA#PEAUHDC__##H#Z)
2>fxge.lib(fx_win32_print.obj) : error LNK2001: unresolved external symbol __imp_GetDeviceCaps
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_GetDIBits referenced in function "protected: virtual int __cdecl CGdiDisplayDriver::GetDIBits(class CFX_DIBitmap *,int,int,void *,int)" (?GetDIBits#CGdiDisplayDriver##MEAAHPEAVCFX_DIBitmap##HHPEAXH#Z)
2>fxge.lib(fx_win32_dib.obj) : error LNK2001: unresolved external symbol __imp_GetDIBits
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_GetObjectType referenced in function "protected: __cdecl CGdiDeviceDriver::CGdiDeviceDriver(struct HDC__ *,int)" (??0CGdiDeviceDriver##IEAA#PEAUHDC__##H#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_IntersectClipRect referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::SetClip_PathFill(class CFX_PathData const *,class CFX_Matrix const *,int)" (?SetClip_PathFill#CGdiDeviceDriver##MEAAHPEBVCFX_PathData##PEBVCFX_Matrix##H#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_LineTo referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::DrawCosmeticLine(float,float,float,float,unsigned int,int,void *,int)" (?DrawCosmeticLine#CGdiDeviceDriver##MEAAHMMMMIHPEAXH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_RestoreDC referenced in function "protected: virtual void __cdecl CGdiDeviceDriver::RestoreState(int)" (?RestoreState#CGdiDeviceDriver##MEAAXH#Z)
2>fxge.lib(fx_win32_print.obj) : error LNK2001: unresolved external symbol __imp_RestoreDC
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_SaveDC referenced in function "protected: virtual void __cdecl CGdiDeviceDriver::RestoreState(int)" (?RestoreState#CGdiDeviceDriver##MEAAXH#Z)
2>fxge.lib(fx_win32_print.obj) : error LNK2001: unresolved external symbol __imp_SaveDC
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_SelectClipRgn referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::SetClipRgn(void *)" (?SetClipRgn#CGdiDeviceDriver##MEAAHPEAX#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_SetDIBitsToDevice referenced in function "protected: int __cdecl CGdiDeviceDriver::GDI_SetDIBits(class CFX_DIBitmap const *,struct FX_RECT const *,int,int,void *)" (?GDI_SetDIBits#CGdiDeviceDriver##IEAAHPEBVCFX_DIBitmap##PEBUFX_RECT##HHPEAX#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_SetPolyFillMode referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::DrawPath(class CFX_PathData const *,class CFX_Matrix const *,class CFX_GraphStateData const *,unsigned int,unsigned int,int,int,void *,int)" (?DrawPath#CGdiDeviceDriver##MEAAHPEBVCFX_PathData##PEBVCFX_Matrix##PEBVCFX_GraphStateData##IIHHPEAXH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_StretchDIBits referenced in function "protected: int __cdecl CGdiDeviceDriver::GDI_SetDIBits(class CFX_DIBitmap const *,struct FX_RECT const *,int,int,void *)" (?GDI_SetDIBits#CGdiDeviceDriver##IEAAHPEBVCFX_DIBitmap##PEBUFX_RECT##HHPEAX#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_SetStretchBltMode referenced in function "protected: __cdecl CGdiDeviceDriver::CGdiDeviceDriver(struct HDC__ *,int)" (??0CGdiDeviceDriver##IEAA#PEAUHDC__##H#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_GetTextMetricsW referenced in function "public: virtual int __cdecl CWin32FontInfo::GetFontCharset(void *,int &)" (?GetFontCharset#CWin32FontInfo##UEAAHPEAXAEAH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_CreateDIBSection referenced in function "public: __cdecl CFX_WinBitmapDevice::CFX_WinBitmapDevice(int,int,enum FXDIB_Format)" (??0CFX_WinBitmapDevice##QEAA#HHW4FXDIB_Format###Z)
2>fxge.lib(fx_win32_dib.obj) : error LNK2001: unresolved external symbol __imp_CreateDIBSection
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_BeginPath referenced in function "void __cdecl _SetPathToDC(struct HDC__ *,class CFX_PathData const *,class CFX_Matrix const *)" (?_SetPathToDC##YAXPEAUHDC__##PEBVCFX_PathData##PEBVCFX_Matrix###Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_CloseFigure referenced in function "void __cdecl _SetPathToDC(struct HDC__ *,class CFX_PathData const *,class CFX_Matrix const *)" (?_SetPathToDC##YAXPEAUHDC__##PEBVCFX_PathData##PEBVCFX_Matrix###Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_EndPath referenced in function "void __cdecl _SetPathToDC(struct HDC__ *,class CFX_PathData const *,class CFX_Matrix const *)" (?_SetPathToDC##YAXPEAUHDC__##PEBVCFX_PathData##PEBVCFX_Matrix###Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_FillPath referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::DrawPath(class CFX_PathData const *,class CFX_Matrix const *,class CFX_GraphStateData const *,unsigned int,unsigned int,int,int,void *,int)" (?DrawPath#CGdiDeviceDriver##MEAAHPEBVCFX_PathData##PEBVCFX_Matrix##PEBVCFX_GraphStateData##IIHHPEAXH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_SelectClipPath referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::SetClip_PathFill(class CFX_PathData const *,class CFX_Matrix const *,int)" (?SetClip_PathFill#CGdiDeviceDriver##MEAAHPEBVCFX_PathData##PEBVCFX_Matrix##H#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_SetMiterLimit referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::DrawPath(class CFX_PathData const *,class CFX_Matrix const *,class CFX_GraphStateData const *,unsigned int,unsigned int,int,int,void *,int)" (?DrawPath#CGdiDeviceDriver##MEAAHPEBVCFX_PathData##PEBVCFX_Matrix##PEBVCFX_GraphStateData##IIHHPEAXH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_StrokeAndFillPath referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::DrawPath(class CFX_PathData const *,class CFX_Matrix const *,class CFX_GraphStateData const *,unsigned int,unsigned int,int,int,void *,int)" (?DrawPath#CGdiDeviceDriver##MEAAHPEBVCFX_PathData##PEBVCFX_Matrix##PEBVCFX_GraphStateData##IIHHPEAXH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_StrokePath referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::DrawPath(class CFX_PathData const *,class CFX_Matrix const *,class CFX_GraphStateData const *,unsigned int,unsigned int,int,int,void *,int)" (?DrawPath#CGdiDeviceDriver##MEAAHPEBVCFX_PathData##PEBVCFX_Matrix##PEBVCFX_GraphStateData##IIHHPEAXH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_WidenPath referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::SetClip_PathStroke(class CFX_PathData const *,class CFX_Matrix const *,class CFX_GraphStateData const *)" (?SetClip_PathStroke#CGdiDeviceDriver##MEAAHPEBVCFX_PathData##PEBVCFX_Matrix##PEBVCFX_GraphStateData###Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_ExtCreatePen referenced in function "struct HPEN__ * __cdecl _CreatePen(class CFX_GraphStateData const *,class CFX_Matrix const *,unsigned int)" (?_CreatePen##YAPEAUHPEN__##PEBVCFX_GraphStateData##PEBVCFX_Matrix##I#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_MoveToEx referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::DrawCosmeticLine(float,float,float,float,unsigned int,int,void *,int)" (?DrawCosmeticLine#CGdiDeviceDriver##MEAAHMMMMIHPEAXH#Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_PolyBezierTo referenced in function "void __cdecl _SetPathToDC(struct HDC__ *,class CFX_PathData const *,class CFX_Matrix const *)" (?_SetPathToDC##YAXPEAUHDC__##PEBVCFX_PathData##PEBVCFX_Matrix###Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_GetTextFaceA referenced in function "public: virtual int __cdecl CWin32FontInfo::GetFaceName(void *,class CFX_ByteString &)" (?GetFaceName#CWin32FontInfo##UEAAHPEAXAEAVCFX_ByteString###Z)
2>fxge.lib(fx_win32_device.obj) : error LNK2019: unresolved external symbol __imp_FillRect referenced in function "protected: virtual int __cdecl CGdiDeviceDriver::FillRect(struct FX_RECT const *,unsigned int,int,void *,int)" (?FillRect#CGdiDeviceDriver##MEAAHPEBUFX_RECT##IHPEAXH#Z)
2>fxge.lib(fx_win32_dib.obj) : error LNK2019: unresolved external symbol __imp_CreateDIBitmap referenced in function "public: static struct HBITMAP__ * __cdecl CFX_WindowsDIB::GetDDBitmap(class CFX_DIBitmap const *,struct HDC__ *)" (?GetDDBitmap#CFX_WindowsDIB##SAPEAUHBITMAP__##PEBVCFX_DIBitmap##PEAUHDC__###Z)
2>fxge.lib(fx_win32_dib.obj) : error LNK2019: unresolved external symbol __imp_LoadImageW referenced in function "public: static class CFX_DIBitmap * __cdecl CFX_WindowsDIB::LoadDIBitmap(struct WINDIB_Open_Args_)" (?LoadDIBitmap#CFX_WindowsDIB##SAPEAVCFX_DIBitmap##UWINDIB_Open_Args_###Z)
2>fxge.lib(fx_win32_dwrite.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentObject referenced in function "public: long __cdecl CDwGdiTextRenderer::DrawGlyphRun(struct FX_RECT const &,class CFX_ClipRgn *,struct DWRITE_MATRIX const *,float,float,enum DWRITE_MEASURING_MODE,struct DWRITE_GLYPH_RUN const *,unsigned long const &)" (?DrawGlyphRun#CDwGdiTextRenderer##QEAAJAEBUFX_RECT##PEAVCFX_ClipRgn##PEBUDWRITE_MATRIX##MMW4DWRITE_MEASURING_MODE##PEBUDWRITE_GLYPH_RUN##AEBK#Z)
2>fxge.lib(fx_win32_print.obj) : error LNK2019: unresolved external symbol __imp_GetRegionData referenced in function "public: int __cdecl CPSPrinterDriver::Init(struct HDC__ *,int,int)" (?Init#CPSPrinterDriver##QEAAHPEAUHDC__##HH#Z)
2>\build\Debug\pdfium.dll : fatal error LNK1120: 57 unresolved externals
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Does anyone have an idea on what I am supposed to do?
I downloaded and build pdfium as described in https://github.com/pvginkel/PdfiumViewer. My steps:
Download pdfium
Generate Visual Studio projects and solution
Open solution all.sln
Build all.sln, error LNK1112. I change target machine for project pdfium to /MACHINE:x86. Now all is ok, I get static lib
I change pdfium project type to dll
Add FPDFSDK_EXPORTS to preprocessor definitions
Add dependencies as described in https://github.com/pvginkel/PdfiumViewer
I change toolset to v120_xp
Build, linker errors. I change library list to (all libraries from $(OutDir)):
kernel32.lib
user32.lib
advapi32.lib
gdi32.lib
winmm.lib
$(OutDir)\lib\bigint.lib
$(OutDir)\lib\fdrm.lib
$(OutDir)\lib\formfiller.lib
$(OutDir)\lib\fpdfapi.lib
$(OutDir)\lib\fpdfdoc.lib
$(OutDir)\lib\fpdftext.lib
$(OutDir)\lib\freetype.lib
$(OutDir)\lib\fx_lpng.lib
$(OutDir)\lib\fxcodec.lib
$(OutDir)\lib\fxcrt.lib
$(OutDir)\lib\fxedit.lib
$(OutDir)\lib\fxge.lib
$(OutDir)\lib\gmock.lib
$(OutDir)\lib\gtest.lib
$(OutDir)\lib\gtest_main.lib
$(OutDir)\lib\icui18n.lib
$(OutDir)\lib\icuuc.lib
$(OutDir)\lib\javascript.lib
$(OutDir)\lib\jsapi.lib
$(OutDir)\lib\pdfwindow.lib
$(OutDir)\lib\v8_base_0.lib
$(OutDir)\lib\v8_base_1.lib
$(OutDir)\lib\v8_base_2.lib
$(OutDir)\lib\v8_base_3.lib
$(OutDir)\lib\v8_libbase.lib
$(OutDir)\lib\v8_libplatform.lib
$(OutDir)\lib\v8_nosnapshot.lib
$(OutDir)\lib\v8_snapshot.lib
Buil, Now all is ok, I get dynamic lib (dll)
I download file pdfiumviewer.cpp and add it to project
Build, compilation error, no header file found
Add third_party\freetype\include;v8;v8\include; to addition include directories
Build, compilation error.
In file pdfiumviewer.cpp replace string #include "../../fpdfsdk/include/fpdfview.h" to #include "../../public/fpdfview.h"
Build, now all is ok, I get dynamic lib (dll)
One more thing, if you want build pdfium_test project, you need fix fpdfview.h file:
#define DLLEXPORT __declspec( dllexport )
#define STDCALL __stdcall
#else
#define DLLEXPORT
#if !defined(_WIN64)
// On Windows Win32 (not x64) requires __stdcall convention
#define STDCALL __stdcall
#else
#define STDCALL
#endif // !defined(_WIN64)
#endif
For build pdfium_embeddertests you can just turn off Treat warnings as errors option, but I do not know about consequences.
If anyone is still looking for an answer to this, an alternate is to just download the precompiled libraries.
https://github.com/bblanchon/pdfium-binaries/ generates the latest binaries from the chromium source for Linux, Windows, Mac.

ITk VTK QT QMake link error

I have a problem linking libs from ITK in QT and building it using QTCreator. I get the following erorrs. It would be great to know your guidance for the problem.
:\Qt\qtcreator-2.8.1\bin\jom.exe -f Makefile.Release
link /LIBPATH:"c:\Qt\Qt4.8.3\lib" /NOLOGO /INCREMENTAL:NO /SUBSYSTEM:WINDOWS /OUT:release\ImageRegistration.exe #C:\Users\Venky\AppData\Local\Temp\ImageRegistration.exe.5976.47.jom
Creating library release\ImageRegistration.lib and object release\ImageRegistration.exp
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_GetStockObject referenced in function "protected: static int __cdecl itk::Win32OutputWindow::Initialize(void)" (?Initialize#Win32OutputWindow#itk##KAHXZ)
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_SendMessageA referenced in function "protected: static void __cdecl itk::Win32OutputWindow::AddText(char const *)" (?AddText#Win32OutputWindow#itk##KAXPEBD#Z)
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_DefWindowProcA referenced in function "public: static __int64 __cdecl itk::Win32OutputWindow::WndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?WndProc#Win32OutputWindow#itk##SA_JPEAUHWND__##I_K_J#Z)
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_RegisterClassA referenced in function "protected: static int __cdecl itk::Win32OutputWindow::Initialize(void)" (?Initialize#Win32OutputWindow#itk##KAHXZ)
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_GetClassInfoA referenced in function "protected: static int __cdecl itk::Win32OutputWindow::Initialize(void)" (?Initialize#Win32OutputWindow#itk##KAHXZ)
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_CreateWindowExA referenced in function "protected: static int __cdecl itk::Win32OutputWindow::Initialize(void)" (?Initialize#Win32OutputWindow#itk##KAHXZ)
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_DestroyWindow referenced in function "protected: virtual __cdecl itk::Win32OutputWindow::~Win32OutputWindow(void)" (??1Win32OutputWindow#itk##MEAA#XZ)
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_ShowWindow referenced in function "protected: static int __cdecl itk::Win32OutputWindow::Initialize(void)" (?Initialize#Win32OutputWindow#itk##KAHXZ)
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_MoveWindow referenced in function "public: static __int64 __cdecl itk::Win32OutputWindow::WndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?WndProc#Win32OutputWindow#itk##SA_JPEAUHWND__##I_K_J#Z)
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_MessageBoxA referenced in function "protected: void __cdecl itk::Win32OutputWindow::PromptText(char const *)" (?PromptText#Win32OutputWindow#itk##IEAAXPEBD#Z)
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_LoadCursorA referenced in function "protected: static int __cdecl itk::Win32OutputWindow::Initialize(void)" (?Initialize#Win32OutputWindow#itk##KAHXZ)
ITKCommon-4.4.lib(itkWin32OutputWindow.obj) : error LNK2019: unresolved external symbol __imp_LoadIconA referenced in function "protected: static int __cdecl itk::Win32OutputWindow::Initialize(void)" (?Initialize#Win32OutputWindow#itk##KAHXZ)
itksys-4.4.lib(SystemTools.obj) : error LNK2019: unresolved external symbol __imp_RegCloseKey referenced in function "public: static bool __cdecl itksys::SystemTools::DeleteRegistryValue(char const *,enum itksys::SystemTools::KeyWOW64)" (?DeleteRegistryValue#SystemTools#itksys##SA_NPEBDW4KeyWOW64#12##Z)
itksys-4.4.lib(SystemTools.obj) : error LNK2019: unresolved external symbol __imp_RegCreateKeyExA referenced in function "public: static bool __cdecl itksys::SystemTools::WriteRegistryValue(char const *,char const *,enum itksys::SystemTools::KeyWOW64)" (?WriteRegistryValue#SystemTools#itksys##SA_NPEBD0W4KeyWOW64#12##Z)
itksys-4.4.lib(SystemTools.obj) : error LNK2019: unresolved external symbol __imp_RegDeleteValueA referenced in function "public: static bool __cdecl itksys::SystemTools::DeleteRegistryValue(char const *,enum itksys::SystemTools::KeyWOW64)" (?DeleteRegistryValue#SystemTools#itksys##SA_NPEBDW4KeyWOW64#12##Z)
itksys-4.4.lib(SystemTools.obj) : error LNK2019: unresolved external symbol __imp_RegOpenKeyExA referenced in function "public: static bool __cdecl itksys::SystemTools::DeleteRegistryValue(char const *,enum itksys::SystemTools::KeyWOW64)" (?DeleteRegistryValue#SystemTools#itksys##SA_NPEBDW4KeyWOW64#12##Z)
itksys-4.4.lib(SystemTools.obj) : error LNK2019: unresolved external symbol __imp_RegQueryValueExA referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl itksys::SystemTools::GetOperatingSystemNameAndVersion(void)" (?GetOperatingSystemNameAndVersion#SystemTools#itksys##SA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ)
itksys-4.4.lib(SystemTools.obj) : error LNK2019: unresolved external symbol __imp_RegSetValueExA referenced in function "public: static bool __cdecl itksys::SystemTools::WriteRegistryValue(char const *,char const *,enum itksys::SystemTools::KeyWOW64)" (?WriteRegistryValue#SystemTools#itksys##SA_NPEBD0W4KeyWOW64#12##Z)
release\ImageRegistration.exe : fatal error LNK1120: 18 unresolved externals
Almost all the error are based on itksys and itkCommon. Both are in my libs in .Pro file