OpenGL安装和QtCreator安装

在MacOS上

得到Sample Code

OpenGL安装步骤:

  1. 检查在Terminal上已经安装g++/clang++
    g++ -v
    
  2. 安装Homebrew
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  3. 安装cmake和GLFW
    # CMake tool to compile
    brew install cmake
    
    # The Library GLFW
    brew install glfw
    

期间可能会出现的问题:
Error:Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
解决方法:

brew install pkg-config

OpenGL检查安装成功:

移动到CMakeList所在的文件夹,在命令行运行下面代码

# Generate the directory build/
mkdir build 

# Go to the build/ directory
cd build

# Run CMake
cmake ..
# A file Makefile should be generated

# Compile
make
# Make sure the compilation succeed, a file pgm should be created

# Go back to the root directory
cd ..

# Run the executable from the root directory
#  (possibly adapt to the name of your executable)
build/sample_code

结果:
在这里插入图片描述

QtCreator安装

brew install qt
brew install qt-creator

运行时候的问题及解决方案

Expected in: /usr/local/lib/libJPEG.dylib in /System/Library/Frameworks/Imag
在这里插入图片描述

在运行选项中找到Add build library search path to DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH,保证它没有被选中

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值