PathCchAddBackslash: which lib?

Started by iwrbc, August 16, 2020, 09:16:38 PM

Previous topic - Next topic

iwrbc

Hi, I am new to Pelles C, therefore I post it here. In my first Pelles C program, I use PathCchAddBackslash. This function is declared in pathcch.h so I included that file. According to the documentation at MSDN, the function is included in Pathcch.lib. When I add this lib to the linker options (library and object files), the file can not be found during the linking process. In fact, there is no such lib in Pelles C program dir. There is a file pathcch.lib elsewhere on my PC.  Can I just copy this lib and use it? Or should I use a different solution?
Any help is appreciated.

algernon_77

Hi!
I searched a bit and it seems PathCchAddBackslash is exported from api-ms-win-core-path-l1-1-0.dll
This, as I recall, is found in Win8 or newer. If this is the case, you may try to feed the patchcch.lib that you have to the linker (copy it to Pelle lib folder and add it to project->project options->linker->library and object files).

If there's no issue, you may use PathAddBackslash (the older, less safe version) which is in shlwapi.lib (this one is already in the Pelle lib folder).

Regards!

iwrbc

Thanks, it now works. Just a warning when compiling the debug version, but it does what I want.