|
From: Brian D. <br...@de...> - 2006-11-30 16:23:30
|
Lennart Borgman wrote: > > I get the abover error when trying to link a program using > > GetLongPathName. It also uses GetFullPathName which I have had no > > trouble with. They are both in kernel32. > > > > What is wrong here? What do I need to link? [ Why is this text quoted? Who are you quoting? Who's talking? Why obfuscate your text in this way? ] The answer is that there is actually no such function GetLongPathName in kernel32, there is an ANSI version (GetLongPathNameA) and a wide character/Unicode version (GetLongPathNameW). GetLongPathName is #defined in winbase.h to one of these based on whether you've enabled Unicode or not. So the prolem you are having is due to an issue with your includes, not a linking problem. You need to make sure that you've included <windows.h> properly. This can also occur if you somehow managed to declare the function prototype without the WINAPI qualifier, as the compiler will use the default but wrong cdecl calling convention which has no decoration. But you should not be declaring this function, it should be declared by winbase.h (which is included by windows.h.) In short, look at the preprocessed source of your code, after all macro expansions and includes have occurred, and make sure that the above two things have been satisfied. Brian |