0
votes

I am trying to compile a simple c++ program but the include file is not being added to the compile command.

Here is the code

#include <stdlib.h>
#include "GLES2/gl2.h"

int main()
{
    return 0;
}

SConstruct

env = Environment()
cpp_path = '''
    .
    include
'''
env.Append(CPPPATH = Split(cpp_path))
Program('test_gcc_scons.c')

scons output

scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... gcc -o test_gcc_scons.o -c test_gcc_scons.c test_gcc_scons.c:2:23: fatal error: GLES2/gl2.h: No such file or directory

Directory

pi@raspberrypi ~/projects/test_gcc_scons $ ls include/GLES2/
gl2ext.h  gl2.h  gl2platform.h

EDIT: Found the problem. Had to do this instead

env.Program("test_gcc_scons.c")
1

1 Answers

0
votes

Found the problem. Had to do this instead

env.Program("test_gcc_scons.c")