1.分析问题

问题原因在于找不到对应的.h(头文件)
寻找的对应的.h文件复制到指定的文件夹中,最后链接到cmakelist文件夹中

2.寻找.h文件

sudo find / -name tchar.h
(base) ts@ts:~/crnn-pytorch-master/include$ sudo find / -name tchar.h
/home/ts/crnn-pytorch-master/include/tchar.h
/home/ts/.deepinwine/deepin-wine5/include/windows/tchar.h
/home/ts/application/deepin-wine-for-ubuntu/deepin-libwine-dev_2.18-12_i386/usr/include/deepin-wine/windows/tchar.h
/usr/share/mingw-w64/include/tchar.h
/usr/x86_64-w64-mingw32/include/tchar.h
/usr/include/deepin-wine/windows/tchar.h
/usr/i686-w64-mingw32/include/tchar.h
find: ‘/run/user/1000/gvfs’: 权限不够

3.复制.h文件到指定的文件夹中

mkdir include
cd include
sudo cp  /usr/include/deepin-wine/windows/tchar.h ./

4.链接到cmakelists.txt

include_directories(/home/ts/crnn-pytorch-master/include)

add_executable(demo main.cpp /home/ts/crnn-pytorch-master/include)
Logo

更多推荐