Я не могу включить FTGL и freetype2, и я действительно не могу понять, почему, возможно, из-за кода.
Я установил обе библиотеки*
libftgl-dev установлена
"окноу" это моя папка с кодом.
мои вставки в код C++:
#include
#include
#include
#include
#include
#include
#include
в «include» есть файлы
mbr@MBR:/usr/include$ ls
aio.h GLES netrose sysexits.h
aliases.h GLES2 nfs syslog.h
alloca.h GLES3 nl_types.h tar.h
argp.h GLFW nss.h termio.h
argz.h glob.h obstack.h termios.h
ar.h glvnd openvpn tgmath.h
arpa gnumake.h paths.h thread_db.h
asm-generic gnu-versions.h pngconf.h threads.h
assert.h grp.h png.h time.h
brotli gshadow.h pnglibconf.h tirpc
byteswap.h iconv.h poll.h ttyent.h
c++ ifaddrs.h printf.h uchar.h
complex.h inttypes.h proc_service.h ucontext.h
cpio.h iproute2 protocols ulimit.h
crypt.h KHR pthread.h unistd.h
ctype.h langinfo.h pty.h utime.h
dirent.h lastlog.h pwd.h utmp.h
dlfcn.h libgen.h python3.10 utmpx.h
drm libintl.h rdma values.h
EGL libpng re_comp.h video
elf.h libpng16 regex.h vk_video
endian.h limits.h regexp.h vulkan
envz.h link.h resolv.h wait.h
err.h linux rpc wayland-client-core.h
errno.h locale.h rpcsvc wayland-client.h
error.h malloc.h sched.h wayland-client-protocol.h
execinfo.h math.h scsi wayland-cursor.h
fcntl.h mcheck.h search.h wayland-egl-core.h
features.h memory.h semaphore.h wayland-egl.h
features-time64.h misc setjmp.h wayland-server-core.h
fenv.h mntent.h sgtty.h wayland-server.h
finclude monetary.h shadow.h wayland-server-protocol.h
fmtmsg.h mqueue.h signal.h wayland-util.h
fnmatch.h mtd sound wayland-version.h
freetype2 net spawn.h wchar.h
fstab.h netash stab.h wctype.h
FTGL netatalk stdc-predef.h wordexp.h
fts.h netax25 stdint.h X11
ftw.h netdb.h stdio_ext.h x86_64-linux-gnu
gcalc-2 neteconet stdio.h xcb
gci-2 netinet stdlib.h xen
gconv.h netipx string.h xorg
gdb netiucv strings.h zconf.h
getopt.h netpacket sudo_plugin.h zlib.h
GL netrom syscall.h
mbr@MBR:/usr/include$ cd FTGL
mbr@MBR:/usr/include/FTGL$ ls
FTBBox.h ftgl.h FTOutlineGlyph.h
FTBitmapGlyph.h FTGLOutlineFont.h FTPixmapGlyph.h
FTBufferFont.h FTGLPixmapFont.h FTPoint.h
FTBufferGlyph.h FTGLPolygonFont.h FTPolyGlyph.h
FTBuffer.h FTGLTextureFont.h FTSimpleLayout.h
FTExtrdGlyph.h FTGLTriangleExtractorFont.h FTTextureGlyph.h
FTFont.h FTGlyph.h FTTriangleExtractorGlyph.h
FTGLBitmapFont.h FTLayout.h
FTGLExtrdFont.h FTLibrary.h
mbr@MBR:/usr/include/FTGL$ cd ..
mbr@MBR:/usr/include$ cd freetype2
mbr@MBR:/usr/include/freetype2$ ls
freetype ft2build.h
mbr@MBR:/usr/include/freetype2$
понятия не имею, что делать, я делаю это впервые
я проверил некоторые сайты, вот что я попробовал на них:
mbr@MBR:~/Desktop/окноу$ g++ app.cpp -I usr/include/FTGL
app.cpp:6:10: fatal error: ft2build.h: No such file or directory
6 | #include
| ^~~~~~~~~~~~
compilation terminated.
mbr@MBR:~/Desktop/окноу$ sudo g++ app.cpp -I usr/include/freetype2
app.cpp:6:10: fatal error: ft2build.h: No such file or directory
6 | #include
| ^~~~~~~~~~~~
compilation terminated.
mbr@MBR:~/Desktop/окноу$ sudo g++ app.cpp -L usr/include/FTGL
[sudo] password for mbr:
app.cpp:6:10: fatal error: ft2build.h: No such file or directory
6 | #include
| ^~~~~~~~~~~~
compilation terminated.
mbr@MBR:~/Desktop/окноу$ sudo g++ app.cpp -L usr/include/freetype2
app.cpp:6:10: fatal error: ft2build.h: No such file or directory
6 | #include
| ^~~~~~~~~~~~
compilation terminated.
также из ваших комментариев:
#include
#include
#include
#include
#include
#include // i added freetype2 before
#include
консоль:
g++ app.cpp -I /usr/include/FTGL
app.cpp:6:10: fatal error: ft2build.h: No such file or directory
6 | #include
| ^~~~~~~~~~~~
после добавления freetype2* ничего не изменилось, я перезапустил «vs code»
In file included from app.cpp:6:
/usr/include/freetype2/ft2build.h:37:10: fatal error: freetype/config/ftheader.h: No such file or directory
37 | #include
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
после компиляции с использованием -lGL -lglfw -lGLEW
код, включающий 37 строк:
#include
#include
#include
#include
#include
#include
#include
#define RED "\x1b[31m"
#define GREEN "\x1b[32m"
#define YELLOW "\x1b[33m"
#define BLUE "\x1b[34m"
#define MAGENTA "\x1b[35m"
#define CYAN "\x1b[36m"
#define COLOR_RESET "\x1b[0m"
void error_callback(int error, const char *description)
{
std::cerr
Подробнее здесь: https://stackoverflow.com/questions/786 ... -freetype2
Не могу включить FTGL и freetype2 [закрыто] ⇐ C++
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение