"unresolved external symbol"

Pages: 12
Jan 29, 2013 at 3:48pm
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?
Jan 29, 2013 at 5:22pm
Which configuration did you add it to?
Jan 29, 2013 at 5:44pm
Properties > Config > Linker > Input > Additional Dependencies
Jan 30, 2013 at 12:06pm
Anyone?
Jan 30, 2013 at 12:41pm
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')?
Jan 30, 2013 at 1:24pm
Yes, adding the library doesn't change anything.
Jan 30, 2013 at 1:45pm
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.
Jan 30, 2013 at 3:32pm
That's what I thought, but none came with the package... just one unrelated library.
Jan 30, 2013 at 3:48pm
You will need to generate your own lib file then see:

http://adrianhenke.wordpress.com/2008/12/05/create-lib-file-from-dll/
Jan 30, 2013 at 3:50pm
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?
Jan 30, 2013 at 3:54pm
Send me a PM
Jan 30, 2013 at 4:58pm
All sorted then?
Jan 30, 2013 at 6:05pm
No sorry, bust with other work. PM on the way.
Jan 31, 2013 at 9:19am
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
Jan 31, 2013 at 9:47am
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?
Jan 31, 2013 at 11:53am
ajh32:
I added Dbghelp.lib, but got the same error...


coder777:
yes, I added the path. Sorry.
Jan 31, 2013 at 1:57pm
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.
Jan 31, 2013 at 2:32pm
Not working for me. Am I doing something wrong? What compiler are you using?

Screencap of my compiler:
http://i45.tinypic.com/oq92rp.jpg
Jan 31, 2013 at 3:03pm
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
Jan 31, 2013 at 3:58pm
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 Jan 31, 2013 at 3:59pm
Pages: 12