在 mingw 下编译时出现路径查找文件名错误
error with PathFindFileName when compiling under mingw
code:
#include <shlwapi.h>
int main() {
TCHAR buffer[MAX_PATH];
DWORD bufSize;
GetModuleFileName(NULL, buffer, bufSize);
TCHAR* out = PathFindFileName(buffer);
}
错误信息:
ccQzTh4t.o:pathfind.cpp:(.text.startup+0x40): undefined reference to `_imp__PathFindFileNameA@4'
collect2: ld returned 1 exit status
也许我忘记了一些包含?
PathFindFileName
是Shlwapi.lib
库的一部分,你需要链接到它。
相关文章:
- 查找 GCD:并非所有控制路径都返回值
- 用于查找网格中最短路径的算法
- 查找最短路径算法
- 使用连续字符及其路径查找矩阵中最长路径的长度
- 在具有随机边的图形中查找路径
- 如何在Cmake中正确查找头路径,以便在我的项目中构建Box2D
- A*路径查找-如何有效地更新openNodes优先级队列中的节点值
- 沿着路径查找节点数量
- 递归路径查找,直到除法结果为1
- C++通过windows搜索路径查找可执行文件
- 带地图的 GUI C++最短路径查找器
- 用于多个目标的2D平铺贴图的路径查找
- A* 路径查找中 std::map 性能的视觉C++性能问题
- 在 mingw 下编译时出现路径查找文件名错误
- 优化多目标的A*路径查找
- 无向图中的路径查找
- C++路径查找与a星,优化
- 路径查找(在网格中)与Boost图形库
- 路径查找算法创建循环
- 用于测试路径查找算法的可能数据集