Project

General

Profile

unresolved external symbol public: class std::_Vector_iterator

Added by Harry McKame over 3 years ago

I have been using Exiv2 in Microsoft Visual Studio 2008, perfectly well.

I have now upgraded to Windows 10 and Visual Studio 2015, and I'm getting the following link errors :

error LNK2019: unresolved external symbol "public: class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class Exiv2::Xmpdatum> > > __thiscall Exiv2::XmpData::begin(void)" (?begin@XmpData@Exiv2@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@VXmpdatum@Exiv2@@@std@@@std@@@std@@XZ) referenced in function "int __cdecl GetImageMeta(void const *,void (__cdecl*)(void const *,char const *,char const *))" (?GetImageMeta@@YAHPBXP6AX0PBD1@Z@Z)

error LNK2019: unresolved external symbol "public: class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class Exiv2::Xmpdatum> > > __thiscall Exiv2::XmpData::end(void)" (?end@XmpData@Exiv2@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@VXmpdatum@Exiv2@@@std@@@std@@@std@@XZ) referenced in function "int __cdecl GetImageMeta(void const *,void (__cdecl*)(void const *,char const *,char const *))" (?GetImageMeta@@YAHPBXP6AX0PBD1@Z@Z)

fatal error LNK1120: 2 unresolved externals

The errors are coming from my code that looks like :

Exiv2::ExifData::const_iterator end = exifData.end();
  for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i)
    func(pvar, i->key().c_str(), i->toString().c_str());

For debug reasons, I'm using an Exiv2 project that was gracefully furnished to me by Robin as a complete trunk project for compiling Exiv2 on Visual Studio 2005 & 2003.
Would it be possible to have that same project again, but this time for Visual Studio 2015 ?


Replies (5)

RE: unresolved external symbol public: class std::_Vector_iterator - Added by Robin Mills over 3 years ago

Harry

I don't immediately remember what I gave to you. We build/test the trunk every night using Visual Studio 2015 on Windows 10. Which source are you building? Something from a while back, or the trunk? Can you be sure to build/clean, then build. I doubt if you can incrementally build with VS2015 into a build tree with VS2008 artefacts. Visual Studio provides Build/Clean menu item. To destroy old stuff from previous builds there is a batch file:

<exiv2dir>\msvc2005\exiv2\cleaner.bat
Read the code. Use carefully! (make a backup of your build just in case).

I assume the function "GetImageMeta" is in your code. Can you compile/run samples/exifdata.cpp. If that's linking and running, everything should be good. I can successfully built the trunk with Visual Studio 2015 Express Desktop.

C:\cygwin64\home\rmills\gnu\exiv2\trunk\msvc2005>bin\x64\ReleaseDLL\exifprint.exe --version
exiv2=0.25.0
platform=windows
compiler=MSVC
bits=64
dll=1
debug=0
cplusplus=199711
cplusplus11=0
version=13.00 (2015/x64)
date=Jul 19 2016
time=22:30:35
...
xmlns=xmpidq:http://ns.adobe.com/xmp/Identifier/qual/1.0/

C:\cygwin64\home\rmills\gnu\exiv2\trunk\msvc2005>bin\x64\ReleaseDLL\exifprint.exe http://clanmills.com/Stonehe
nge.jpg | head -3
Exif.Image.Make                              0x010f Ascii      18  NIKON CORPORATION
Exif.Image.Model                             0x0110 Ascii      12  NIKON D5300
Exif.Image.Orientation                       0x0112 Short       1  1

Robin

RE: unresolved external symbol public: class std::_Vector_iterator - Added by Harry McKame over 3 years ago

Hi Robin,

I followed your advice, but I still get all sort of errors when recompiling exiv2.
But maybe I don't need to compile it - my application now works, so I do not need to trace problems into the exiv2 code.

In any case, for now it's not the exiv2 library that is the problem, but using the include files in VS2015 in only one function of mine.
Would you maybe have an alternative syntax to Exiv2::ExifData::const_iterator for VS2015 ?
This might be a problem with std only - have you done any sort of installation for it (I'm not an std user) ?

Regards
Harry

RE: unresolved external symbol public: class std::_Vector_iterator - Added by Robin Mills over 3 years ago

I think your header files (exiv2/*.hpp) are not in alignment with your library. So you are compiling your application with different headers than those used to create the library. And that's not necessarily an Exiv2 issue and can be something to do with libraries compiled with different versions of Visual Studio. For this reason, our daily build compiles with Visual Studio 2005/8/10/12/13/15 (as well as Linux/Cygwin/MinGW+gcc and Mac+clang.

You really haven't given me sufficient information to diagnose your issues with Exiv2+2015. Perhaps we have to screen-share on Skype to get to the bottom of this.

I'll build the trunk later on 2015 and give you the build-tree. http://clanmills.com/files/Exiv2VS2015.zip. It'll be available after 23:59 UTC 2016-07-20.

Robin

RE: unresolved external symbol public: class std::_Vector_iterator - Added by Harry McKame over 3 years ago

Robin,

Many thanks - using the VS2015 trunk has solved all my problems.
Maybe you should update the release.

Apropos - it has now been a year since the last release. Has development slowed down ?

Regards
Harry

RE: unresolved external symbol public: class std::_Vector_iterator - Added by Robin Mills over 3 years ago

We are almost feature complete on v0.26. We've typically released Exiv2 about every 18 months. So, everything's moving about the usual pace. I'm always hoping to find more developers to help.

    (1-5/5)