Reputation: 29397
code:
#include <shlwapi.h>
int main() {
TCHAR buffer[MAX_PATH];
DWORD bufSize;
GetModuleFileName(NULL, buffer, bufSize);
TCHAR* out = PathFindFileName(buffer);
}
error message:
ccQzTh4t.o:pathfind.cpp:(.text.startup+0x40): undefined reference to `_imp__PathFindFileNameA@4'
collect2: ld returned 1 exit status
Maybe I forgot some includes ?
Upvotes: 2
Views: 3233
Reputation: 81379
PathFindFileName
is part of the Shlwapi.lib
library, you need to link against it.
Upvotes: 3