I'm programming with vc6.0 with my backup program. I included shlwapi.h, windows.h and I used PathStripPath function and PathRemoveFileSpec function.
When I complied this message came out.
BlackDlg.obj : error LNK2001: unresolved external symbol __imp__PathStripPathA@4
BlackDlg.obj : error LNK2001: unresolved external symbol __imp__PathRemoveFileSpecA@4
And I remove usage in my code and this message doesn't come. Thank for you quick advance.
To fix this issue, add the /NOENTRY option to the link command. This error can occur if you use incorrect /SUBSYSTEM or /ENTRY settings in your project. For example, if you write a console application and specify /SUBSYSTEM:WINDOWS, an unresolved external error is generated for WinMain .
So when we try to assign it a value in the main function, the linker doesn't find the symbol and may result in an “unresolved external symbol” or “undefined reference”. The way to fix this error is to explicitly scope the variable using '::' outside the main before using it.
An unresolved symbol is one that you've declared somewhere but never defined. Usually, it means you've #included some third party library's header file but not told the linker where to find the corresponding . obj files for the library.
The MSDN Library has plenty of information about both of these functions. If you look towards the ends of the articles you'll see that the functions are defined in shlwapi.lib
; you need to instruct your linker to include this library for your project to build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With