Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error LNK2001: unresolved external symbol __imp__PathRemoveFileSpecA@4

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.

like image 272
bTagTiger Avatar asked Nov 16 '11 00:11

bTagTiger


People also ask

How do I fix unresolved external symbol lnk2001?

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 .

How do I fix unresolved external symbol in C++?

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.

What is unresolved external symbol?

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.


1 Answers

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.

like image 188
Adam Maras Avatar answered Oct 01 '22 20:10

Adam Maras