---
title: "v 语言初试 'KHR/khrplatform.h' file not found"
author: "ipython"
date: "2019-06-24T15:23:46Z"
tags: []
categories: ["编程语言"]
slug: "v-khr-khrplatform-h-file-not-found"
draft: false
lastmod: "2019-06-25T13:58:33Z"
id: 2442097
url: "https://ipython.iteye.com/blog/2442097"
---

v 语言初试

在macOS下运行example里面的俄罗斯方块,出错:

cd ~/code/v/examples/tetris

v run tetris.v

\----

出错,提示'KHR/khrplatform.h' file not found

\----

解决办法:

在 https://glad.dav1d.de/ 中,选中gl Version 3.3, Profile 选Core

再点Generate按钮,然后下载glad.zip,解压,将里面的include目录下面的glad和KHR目录copy到/usr/local/include目录即可.

 

然后再运行v run tetris.v,发现就可以运行啦.

 

\----

参考: [http://blog.shenyuanluo.com/OpenGLEnvironment.html](http://blog.shenyuanluo.com/OpenGLEnvironment.html)

\-----

**发现在作者已经修复这个问题了，在第三方目录里面加了KHR/khrplatform.h文件。**