error LNK2020: unresolved token (0A000015) IID_IPropertySetStorage - c++

I am trying to edit 'Summary Information' of a file. I found following code which works fine. But when I try to bring that code to my project, the build fails at Linking stage.
http://www.codeproject.com/Articles/16314/Access-the-Summary-Information-Property-Set-of-a-f
The error
1>Linking...
1>FileSummaryInfo.obj : error LNK2020: unresolved token (0A000015) IID_IPropertySetStorage
1>FileSummaryInfo.obj : error LNK2001: unresolved external symbol IID_IPropertySetStorage
1>E:\software\TagMyPics\TagMyPics\Debug\TagMyPics.exe : fatal error LNK1120: 2 unresolved externals
The program that I am working on is capable of identifying faces in an image. Once an image file is provided to the program, it detects the face and look up the database to find the name of the person. If name is not in the database it prompts user to enter the name. Then the name is added as a keyword in image file's summary. So when I want to find the images that my friend is in, I can easily search by name. For this I want to edit Keyword property.
Googling suggested that this may be due to the difference between a Win32 Console application (original) and a Win32 Forms application(my version). But I could not find a solution to get this to work.
Could you suggest a solution for this or an alternative?

I changed 'Project Property Pages' > 'Configuration Properties' > 'C / C++' > 'General' > 'Common Language Runtime Support to /clr. Earlier it was /clr:pure. Now it works
/clr allows having both managed and un-managed functions.
For more information read : Common Language Runtime Compilation and Mixed (Native and Managed) Assemblies

Can you check that the option to not link in the standard library is off (it
is by default). Make sure you've included any headers you need, and that
you're compiling and linking C++ files in C++ language mode. If all else
fails, try starting a new project and re-adding all your source files.
Try the steps in this Link

Related

Embarcadero Cbuilder [ilink32 Error] Error: Unresolved external 'System::Sysutils::Exception::{1173}...'

I think that I understand the concept "unresolved external symbol means" - the objects were all compiled and during the linking phase the linker could not find the definition (body) of that particular symbol anywhere. So I guess I either have to use the symbol differently or I have to add to the project some missing system library. I am not sure which is correct and how I can check that (no previous experience with RAD).
I am converting some old code (win95) to win10, I started a new project under the latest RAD Studio 10.3 and I added all the source files (add to project) manually. I saw an advice here that I should make sure that the compilers are not mixed. I can see that all source files are compiled with bcc32c. In the documentation I can see that Exception basically provides only various constructors http://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils.Exception .
During the linking phase I get the error above - [ilink32 Error] Error: Unresolved external 'System::Sysutils::Exception::{1173}...'
All the calls were originally Exception("constant") or Exception("constant" + AnsiStringVariable). As most of the problems were caused by old calling schemes I tried to change it to Exception(L"constant") and Exception(L"constant"+UnicodeString), but this is clearly not the problem.
Thanks for any advice.
So clearly this code:
if(x!=S0getb()) Exception("Bad final checksum!");
generates the error in question. The problem is the missing throw. Probably it somehow compiled in the previous versions and nobody noticed. I guess there is a difference between en error code for a missing function symbol and a missing class symbol. But I did not recognized that this is a function call while it should be a new class instance.
The correct code:
if(x!=S0getb()) throw Exception("Bad final checksum!");
fixes the issue.

Qt Link Issue with MyClass::metaobject VS2005

Just quickly before I start, I have searched SO and Google for a length of time trying to solve this and have been unsuccessful.
I am trying to compile my project, which used to use a certain library for providing GUI functionality based on Windows Forms. Now my company has started to move to Qt, and I decided I would start to convert my small application to support Qt also.
At first it would not compile at all, due to missing headers. Now that is sorted, I am stuck with my final .exe not being able to link due to the following errors.
Creating library Bin\VS_V8\Win32\Debug\Disp.lib and object Bin\VS_V8\Win32\Debug\Disp.exp
QtMainMenu.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall QtMainMenu::metaObject(void)const " (?metaObject#QtMainMenu##UBEPBUQMetaObject##XZ)
QtMainMenu.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall QtMainMenu::qt_metacast(char const *)" (?qt_metacast#QtMainMenu##UAEPAXPBD#Z)
QtMainMenu.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall QtMainMenu::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall#QtMainMenu##UAEHW4Call#QMetaObject##HPAPAX#Z)
Bin\VS_V8\Win32\Debug\Disp.exe : fatal error LNK1120: 3 unresolved externals
Our company has a small "Qt Test App" that was written to play around with, which is where I have based my import from. I can compile and link that fine. From what I have gathered, the following properties must be met with Qt files:
Make sure QTDir is included
Add to the UI Files the UIC Compiler
Add to the Resoruce Files the Resource Compiler
Add to the created Header Files the MOC compiler.
I noticed I was missing the MOC Build Tool commands, so I have added them to my UI File's header. However this didnt change the linking problem. I read that I should delete all built files and do a clean to solve it. This didnt work either.
I have checked, and Q_OBJECT is defined in the class.
I am using VS2005 with the Qt Addin. I did not start a new project for Qt however, I am just using the old Visual Studio Solution / VCProj.
Any ideas where to go next?
#Cameron Stubber you need moc object .. You need to modify Custom Build Step.
You can find Custom Build Step in header file (which has Q_OBJECT) Properties by right click. Then type this commands ;
Command Line = $(QTDIR)\bin\moc.exe -I"$(QTDIR)\include\QtCore" -I"$(QTDIR)\include\QtGui" -I"$(QTDIR)\include" -I"$(QTDIR)\mkspecs\$(QMAKESPEC)" finddialog.h -o debug\moc_finddialog.cpp
Description = MOC finddialog.h
Outputs = debug\moc_finddialog.cpp
Additional Dependencies = $(QTDIR)\bin\moc.exe;finddialog.h
But carefull by writing this types you need to change somethings here like $(QTDIR) it is my enviroment variables you need to write full form of where your QT located like D:\qt_5\
and also you need to be carefull finddialog you should write your .h and .cpp files name
And then you need to create a folder by right clicking solution explorer Add\New Filter .. Make folder name as Generated Files
And last step right click Generated Files add\existing item and you will see Debug folder in your solution Project and add moc_"projectName".cpp
Then re-build your solution. Problem will be solved.
Also you should add C/C++ /General/Additional Library Directories
$(QTDIR)\include
$(QTDIR)\include\QtGui
$(QTDIR)\include\QtCore
And Link/General/Additional Library Directories
$(QTDIR)\lib
Link/Input/Additional Dependencies
qtmaind.lib
QtCored4.lib
QtGuid4.lib
But dont forget to change $(QTDIR) to your enviroment variables or location of your qt folder. Like D:\qt_4.7.4

Unresolved external symbol - IdnToAscii

I tried to build the following sample application available on msdn:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd319089%28v=vs.85%29.aspx
I created a new C++ command line project in Visual Studio 2012 Premium on a windows 7 64bit box, and copied the code of the sample in the main cpp file.
When I try to compile, I get the following error:
Error 1 error LNK2001: unresolved external symbol __imp__IdnToAscii#20
From other posts of people having similar errors, I figure I'm supposed to include some header or lib file. But which one(s)? How do I do that in VS2012/C++ (I'm a complete c++ noob...)
It seems from MSDN, you need to link against Normaliz.dll.
Try adding Normaliz.lib in Linker -> Input -> Additional Dependencies

Unresolved external symbol

Help me guys,
I've been searching for a really long time.
I'm using visual studio 2010 and I tried to include an external lib but I get an unresolved external error.
The external project is composed of files in the following way
backend.cpp
//some functions
frontend.cpp
//some functions
header.h
I build this project using SCons then I includes the .lib file in the project and refered to its path and I copied the .h file to msvc directory .
VS seems to access and read the functions in backend.cpp(from the auto complete) but when I run the project it says that there is an unresolved external # the called function
I'm not a Visual Studio expert, but I guess that it being able to auto complete your code is associated with it finding the headers of your source code.
Unresolved external means that the compiler can't find the object files in the linking process. This could mean that you failed to add the lib files correctly, or that you are missing some .cpp file.
That may happen for a variety of reasons. But all of them end up being one of the following:
You are not linking the correct .lib file.
The symbol name you are using in your program is not identical to the one provided in the .lib.
The first one is easy enough to check, so please, double check it.
The second one is trickier. The symbol name used in your program is output in the error message "unresolved external symbol abc", or whatever. The symbols available in the library can be listed with the command: dumpbin /all name.lib.
If you cannot find the problem, please post the exact error you are getting and the output of the dumpbin program.

Debugging Visual Studio linker

I am trying to build an xll addin for Excel using appropriate framwork downloaded from MS website. I am getting the following linker errors:
1>FRAMEWRK.obj : error LNK2001: unresolved external symbol _Excel4
1>FRAMEWRK.obj : error LNK2001: unresolved external symbol _Excel4v#16
I think that these should be defined in XLCALL32.LIB included in the package from MS, but I don't know how to check it. Moreover, added the folder containing this library to the Additional Library Directories, without luck.
Hence my questions:
(1) How can I check what is in XLCALL32.LIB?
(2) How can I see which files the linker is using to see if my library is actually included?
In your project properties, Under Configuration Properties->Linker->Input, you will see 'Additional Dependencies' - these are the files the linker is using. Assuming that _Excel4 and _Excel4v are defined in XLCALL32.LIB (which I think they are), you simply need to ensure that this file is specified in this list.