"unresolved external symbol"

Pages: 12
Hello,

I am not the best with C++, and I am being forced to use Visual Studio 2010 which I am not very comfortable with, so excuse my lack of knowledge.


I am attempting to compile code that was supplied to me by TI to operate a micro controller... getting the following errors:

1
2
3
4
5
6
7
1>DirDialog.obj : error LNK2019: unresolved external symbol __imp__MakeSureDirectoryPathExists@4 referenced in function "protected: void __thiscall CDlgWnd::OnOpen(void)" (?OnOpen@CDlgWnd@@IAEXXZ)
1>TabNFC.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CDirDialog2::~CDirDialog2(void)" (??1CDirDialog2@@UAE@XZ) referenced in function "protected: void __thiscall CTabNFC::OnNFCNewDname(void)" (?OnNFCNewDname@CTabNFC@@IAEXXZ)
1>TabNFC.obj : error LNK2019: unresolved external symbol "public: int __thiscall CDirDialog2::DoBrowse(void)" (?DoBrowse@CDirDialog2@@QAEHXZ) referenced in function "protected: void __thiscall CTabNFC::OnNFCNewDname(void)" (?OnNFCNewDname@CTabNFC@@IAEXXZ)
1>TabNFC.obj : error LNK2019: unresolved external symbol "public: __thiscall CDirDialog2::CDirDialog2(void)" (??0CDirDialog2@@QAE@XZ) referenced in function "protected: void __thiscall CTabNFC::OnNFCNewDname(void)" (?OnNFCNewDname@CTabNFC@@IAEXXZ)
1>.\Debug\RFIDread.exe : fatal error LNK1120: 4 unresolved externals
1>
1>Build FAILED.


From my limited knowledge I thought it was just a missing library... but only one came with the package, I added it to the libraries folder, didn't help. I added it in the "Additional Dependencies" option, get a fatal error, cant read it. Believe it may be some other issue...

any ideas?
Which configuration did you add it to?
Properties > Config > Linker > Input > Additional Dependencies
Anyone?
Is the library suitable for the visual C++ compiler?

If so, did you add the appropriate path to the library (in the section above 'Linker /Input')?
Yes, adding the library doesn't change anything.
Although you have provided the header to the functions you are using it does look as though you are not providing the library i.e. .lib file for these functions.
That's what I thought, but none came with the package... just one unrelated library.
You will need to generate your own lib file then see:

http://adrianhenke.wordpress.com/2008/12/05/create-lib-file-from-dll/
The only .dll file I got with the package was the one that matches the already made library...

Perhaps I could post a link to the package, would that help you help me?
Send me a PM
All sorted then?
No sorry, bust with other work. PM on the way.
You need to add the following to your Linker\Input\AdditionalDependancies:

Dbghelp.lib

That should resolve your issues. Let me know if you are ok then or whether you have additional issues.

Andrew
NewfieTechie wrote:
Yes, adding the library doesn't change anything.
Did you read my post? I was refering to path. Did you set the path to the library?
ajh32:
I added Dbghelp.lib, but got the same error...


coder777:
yes, I added the path. Sorry.
re:

ajh32:
I added Dbghelp.lib, but got the same error...


Well I did the same to your RFDread project and it then compiled and worked. The 'Dbghelp.lib' on my PC is located in:

c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib

and the associated header is located in:

c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include

Why don't you locate where these files are located on your PC and ensure that the filepaths are on your PATH as @coder777 has suggested. Once the compiler and linker can find the required files all will be well.
Not working for me. Am I doing something wrong? What compiler are you using?

Screencap of my compiler:
http://i45.tinypic.com/oq92rp.jpg
I'm using VS2010.

You appear to have changed the project, why have you added the 'DbgHelp.h' file to the project?

You have used the 'MakeSureDirectoryPathExists(...)' function on line#233 and line#400 of the 'DirDialog.cpp' file.

All I did to resolve the linker error was to add the 'Dbghelp.lib' to the additional includes:

http://i1102.photobucket.com/albums/g452/AndyInSurrey/Capture_zpsf48e41f9.jpg
Am I doing something wrong?
Yes, you must not provide the path in the Input section. The path must be set in the General section.

if you provide a path in the 'Additional Dependencies' the library is not recognized and silently dropped.

Wonder what the Dbghelp.lib has to do with it
Last edited on
Pages: 12