I have project written in C++ that use Qt Framework and QScintilla2. I cannot build Release because of linker errors. I'm using Visual Studio 2013.
Errors:
1>codeditor.obj : error LNK2019: unresolved external symbol "public:
static struct QMetaObject const QsciScintillaBase::staticMetaObject"
(?staticMetaObject#QsciScintillaBase##2UQMetaObject##B) referenced in
function "public: static class QMetaObject::Connection __cdecl
QObject::connect(class QsciScintillaBase const ,void (__thiscall QsciScintillaBase::)(int,int,char const
*,int,int,int,int,int,int,int),class CodeEditor const ,void (__thiscall CodeEditor::)(int,int,char const
*,int,int,int,int,int,int,int),enum Qt::ConnectionType)" (??$connect#P8QsciScintillaBase##AEXHHPBDHHHHHHH#ZP8CodeEditor##AEXHH0HHHHHHH#Z#QObject##SA?AVConnection#QMetaObject##PBVQsciScintillaBase##P83#AEXHHPBDHHHHHHH#ZPBVCodeEditor##P84#AEXHH1HHHHHHH#ZW4ConnectionType#Qt###Z)
1>codeditor.obj : error LNK2019: unresolved external symbol "public:
static struct QMetaObject const QsciScintilla::staticMetaObject"
(?staticMetaObject#QsciScintilla##2UQMetaObject##B) referenced in
function "public: static class QMetaObject::Connection __cdecl
QObject::connect),void (__thiscall
CodeEditor::*)(int,int,class QFlags)>(class
QsciScintilla const ,void (__thiscall QsciScintilla::)(int,int,class
QFlags),class CodeEditor const ,void
(__thiscall CodeEditor::)(int,int,class QFlags),enum Qt::ConnectionType)"
(??$connect#P8QsciScintilla##AEXHHV?$QFlags#W4KeyboardModifier#Qt#####ZP8CodeEditor##AEXHH0#Z#QObject##SA?AVConnection#QMetaObject##PBVQsciScintilla##P83#AEXHHV?$QFlags#W4KeyboardModifier#Qt#####ZPBVCodeEditor##P85#AEXHH1#ZW4ConnectionType#Qt###Z)
1>release\JSD-V8-QT.exe : fatal error LNK1120: 2 unresolved externals
Related
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?
Build started: Project: xlnt.test, Configuration: Release x64
...
runner-autogen.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl xml::qname::~qname(void)" (__imp_??1qname#xml##QEAA#XZ) referenced in function "int public: __cdecl std::pair<class xml::qname const ,struct xml::parser::attribute_value_type>::pair<class xml::qname const ,struct xml::parser::attribute_value_type>(struct pair<class xml::qname const ,struct xml::parser::attribute_value_type>::dtor$0 const &)'::1'::dtor$0" (?dtor$0#?0???0?$pair#$$CBVqname#xml##Uattribute_value_type#parser#2##std##QEAA#AEBU01##Z#4HA)
4> 1>
4>runner-autogen.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl xml::qname::qname(class xml::qname const &)" (__imp_??0qname#xml##QEAA#AEBV01##Z) referenced in function "public: __cdecl std::pair::pair(struct std::pair const &)" (??0?$pair#$$CBVqname#xml##Uattribute_value_type#parser#2##std##QEAA#AEBU01##Z)
4> 1>
4>runner-autogen.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl xml::parser::parser(void const *,unsigned __int64,class std::basic_string,class std::allocator > const &,unsigned short)" (__imp_??0parser#xml##QEAA#PEBX_KAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##G#Z) referenced in function "public: static bool __cdecl xml_helper::compare_xml_exact(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &,bool)" (?compare_xml_exact#xml_helper##SA_NAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##0_N#Z)
4> 1>
I ended up building libstudxml-1.0.1 (http://www.codesynthesis.com/projects/libstudxml/ ) and linking xlnt.test with that library resolves the undefined symbol issue.
Also note that on my system xlnt does not link successfully with libstudxml-1.0.1 and it has to be linked with xlnt-master\third-party\libstudxml...\libstudxml.lib
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 ==========
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.
I'm getting a bunch of LNK2001 and LNK2019 errors with Qt 5.4 and Crypto++. Tried both static and dynamic linking. Libs are in the project folder and .pro file has something like:
win32: LIBS += -L$$PWD/ -lcryptlib
INCLUDEPATH += $$PWD/include
DEPENDPATH += $$PWD/include
win32:!win32-g++: PRE_TARGETDEPS += $$PWD/cryptlib.lib
else:win32-g++: PRE_TARGETDEPS += $$PWD/libcryptlib.a
As soon as I reference something from cryptopp header files I get 15+ linker errors. Also, lib was built with the same MSVC2013 compiler I'm using for Qt.
Any ideas?
EDIT: Yeah, sorry for not including the errors.
main.obj:-1: error: LNK2019: unresolved external symbol "public: __cdecl CryptoPP::Algorithm::Algorithm(bool)" (??0Algorithm#CryptoPP##QEAA#_N#Z) referenced in function "public: __cdecl CryptoPP::BlockTransformation::BlockTransformation(void)" (??0BlockTransformation#CryptoPP##QEAA#XZ)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::SimpleKeyingInterface::SetKey(unsigned char const *,unsigned __int64,class CryptoPP::NameValuePairs const &)" (?SetKey#SimpleKeyingInterface#CryptoPP##UEAAXPEBE_KAEBVNameValuePairs#2##Z)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::SimpleKeyingInterface::GetNextIV(class CryptoPP::RandomNumberGenerator &,unsigned char *)" (?GetNextIV#SimpleKeyingInterface#CryptoPP##UEAAXAEAVRandomNumberGenerator#2#PEAE#Z)
main.obj:-1: error: LNK2019: unresolved external symbol "protected: unsigned __int64 __cdecl CryptoPP::SimpleKeyingInterface::ThrowIfInvalidIVLength(int)" (?ThrowIfInvalidIVLength#SimpleKeyingInterface#CryptoPP##IEAA_KH#Z) referenced in function "public: virtual void __cdecl CryptoPP::BlockOrientedCipherModeBase::Resynchronize(unsigned char const *,int)" (?Resynchronize#BlockOrientedCipherModeBase#CryptoPP##UEAAXPEBEH#Z)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual unsigned int __cdecl CryptoPP::BlockTransformation::OptimalDataAlignment(void)const " (?OptimalDataAlignment#BlockTransformation#CryptoPP##UEBAIXZ)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::StreamTransformation::ProcessLastBlock(unsigned char *,unsigned char const *,unsigned __int64)" (?ProcessLastBlock#StreamTransformation#CryptoPP##UEAAXPEAEPEBE_K#Z)
main.obj:-1: error: LNK2019: unresolved external symbol "void * __cdecl CryptoPP::AlignedAllocate(unsigned __int64)" (?AlignedAllocate#CryptoPP##YAPEAX_K#Z) referenced in function "public: unsigned char * __cdecl CryptoPP::AllocatorWithCleanup<unsigned char,1>::allocate(unsigned __int64,void const *)" (?allocate#?$AllocatorWithCleanup#E$00#CryptoPP##QEAAPEAE_KPEBX#Z)
main.obj:-1: error: LNK2019: unresolved external symbol "void __cdecl CryptoPP::AlignedDeallocate(void *)" (?AlignedDeallocate#CryptoPP##YAXPEAX#Z) referenced in function "public: void __cdecl CryptoPP::AllocatorWithCleanup<unsigned char,1>::deallocate(void *,unsigned __int64)" (?deallocate#?$AllocatorWithCleanup#E$00#CryptoPP##QEAAXPEAX_K#Z)
main.obj:-1: error: LNK2019: unresolved external symbol "void * __cdecl CryptoPP::UnalignedAllocate(unsigned __int64)" (?UnalignedAllocate#CryptoPP##YAPEAX_K#Z) referenced in function "public: unsigned char * __cdecl CryptoPP::AllocatorWithCleanup<unsigned char,1>::allocate(unsigned __int64,void const *)" (?allocate#?$AllocatorWithCleanup#E$00#CryptoPP##QEAAPEAE_KPEBX#Z)
main.obj:-1: error: LNK2019: unresolved external symbol "void __cdecl CryptoPP::UnalignedDeallocate(void *)" (?UnalignedDeallocate#CryptoPP##YAXPEAX#Z) referenced in function "public: void __cdecl CryptoPP::AllocatorWithCleanup<unsigned char,1>::deallocate(void *,unsigned __int64)" (?deallocate#?$AllocatorWithCleanup#E$00#CryptoPP##QEAAXPEAX_K#Z)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::BlockOrientedCipherModeBase::UncheckedSetKey(unsigned char const *,unsigned int,class CryptoPP::NameValuePairs const &)" (?UncheckedSetKey#BlockOrientedCipherModeBase#CryptoPP##UEAAXPEBEIAEBVNameValuePairs#2##Z)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::CBC_Encryption::ProcessData(unsigned char *,unsigned char const *,unsigned __int64)" (?ProcessData#CBC_Encryption#CryptoPP##UEAAXPEAEPEBE_K#Z)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::Rijndael::Base::UncheckedSetKey(unsigned char const *,unsigned int,class CryptoPP::NameValuePairs const &)" (?UncheckedSetKey#Base#Rijndael#CryptoPP##UEAAXPEBEIAEBVNameValuePairs#3##Z)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl CryptoPP::Rijndael::Enc::ProcessAndXorBlock(unsigned char const *,unsigned char const *,unsigned char *)const " (?ProcessAndXorBlock#Enc#Rijndael#CryptoPP##UEBAXPEBE0PEAE#Z)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual unsigned __int64 __cdecl CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const *,unsigned char const *,unsigned char *,unsigned __int64,unsigned int)const " (?AdvancedProcessBlocks#Enc#Rijndael#CryptoPP##UEBA_KPEBE0PEAE_KI#Z)
I'm using downloaded Qt, and in about section of Qt Creator it says it's compiled with MSVC 2010 32bit.