Sunday 15 April 2012

VS10 C++ - Fatal Error LNK 1120 -


I'm trying to create a simple C ++ app that's all on my PC. I am trying to find out the LNK 1120 error but there is no luck, anyone can point me in the right direction with this one and tell me what I am doing wrong here?

  #include "stdafx.h" #include "iostream" #include "Shlwapi.h" # included "windows.h" Zero FindFilesRecursively (LPCTSTR lpFolder, LPCTSTR lpFilePattern); Int _tmain (int argc, _TCHAR * argv []) {LPCTSTR loc = "C: //"; LPCTSTR Feet = ".wav"; FindFilesRecursively (location, feet); Return 0; } Zero FindFilesRecursively (LPCTSTR lpFolder, LPCTSTR lpFilePattern) {TCHAR szFullPattern [MAX_PATH]; WIN32_FIND_DATA FindFileData; Handle HFIFFile; // First we are going to process a subdirectory on PathCombine (szFullPattern, lpFolder, _T ("*");); HFindFile = FindFirstFile (szFullPattern, and FindFileData); If (! HFindFile = INVALID_HANDLE_VALUE) {do {if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {// found sub-directory; It is rewritten by PathCombine (as Fulpaperten, LPFolder, FinefiledData ciphername); FindFilesRecursively (szFullPattern, lpFilePattern); }} While (FindNextFile (hFindFile, and FindFileData)); FindClose (hFindFile); } // Now we are going to search the mail file PathCombine (szFullPattern, lpFolder, lpFilePattern); HFindFile = FindFirstFile (szFullPattern, and FindFileData); If (! HFindFile = INVALID_HANDLE_VALUE) {to {if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)} {// found a file; Do something with pathcombine (szFullPattern, lpFolder, FindFileData.cFileName); Std :: cout & lt; & Lt; (_T ("% s \ n"), szFullPattern); }} While (FindNextFile (hFindFile, and FindFileData)); FindClose (hFindFile); }}   

This is the error message that I receive

  1> ------ The build has been started: Project: SearchForFile, Configuration : Debug Win32 ------ 1 & gt; SearchForFile.cpp 1 & gt; SearchForFile.obj: Error LNK2019: Unsolved external symbol __imp__PathCombineA @ 12 function referred to in "Zero __cdecl FindFilesRecursively (Four constant *, four constant *)" (FindFilesRecursively @@ YAXPBD0 @ Z) 1 & gt; C: \ users \ User \ Document \ Visual Studio 2010 \ Projects \ SearchForFile \ Debug \ SearchForFile.exe: Fatal Error LNK1120: 1 Unsolved External & gt; ========= Build: 0 succeeded, 1 failed, 0 up-to-date, 0 left ==========    

PathCombine function in the code> Shlwapi.lib library, you will need to add This library of your projects linker settings

Open your project settings and visit To go to the option for "Configuration Properties & gt; Linker- & gt; Input" and "Additional Dependency" and add Library Code <> Shlwapi.lib there.

No comments:

Post a Comment