본문 바로가기
개발언어/C++

[에러] unresolved external symbol __imp__PathAddBackslashA 해결하기

by 엔돌슨 2010. 5. 7.
반응형
컴파일시 에러가 발행하였다. 에러는 LINK 링커 에러이다.


에러메시지


1 --------------------Configuration: ControlTest - Win32 Debug--------------------
2 Linking...
3 ControlTest.obj : error LNK2001: unresolved external symbol __imp__PathAddBackslashA@4
4 ControlTest.obj : error LNK2001: unresolved external symbol __imp__PathRemoveFileSpecA@4
5 Debug/ControlTest.exe : fatal error LNK1120: 2 unresolved externals
6 Error executing link.exe.
7 ControlTest.exe - 3 error(s), 0 warning(s)



PathAddBackslash


Adds a backslash to the end of a string to create the correct syntax for a path. If the source path already has a trailing backslash, no backslash will be added.

LINK에 Shlwapi.lib 추가하여 에러해결하기







Shlwapi.lib 를 추가해주면 에러는 없어진다.
MSDN에 보면 PathAddBackslash를 사용하였을 경우, import해주라는 부분이 있다.

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 4.0 or later).
  Windows 95/98/Me: Requires Windows 98 (or Windows 95 with Internet Explorer 4.0 or later).
  Header: Declared in Shlwapi.h.
  Import Library: Shlwapi.lib.