Handmade Hero » Forums » Code » can't include a directory with cl /I
C_Worm
27 posts
#21217 can't include a directory with cl /I
2 months, 2 weeks ago Edited by C_Worm on July 3, 2019, 7:31 p.m.

hi!

im trying to set up my .bat file to check for additional include files. my "cl"-command is like this:

cl /I \deps\include\GLFW -nologo -Zi -GR- -Oi -EHsc -MD ..\GL_002.cpp kernel32.lib user32.lib gdi32.lib winmm.lib shell32.lib opengl32.lib


my includes are:

#include "windows.h"
#include <glfw3.h>
#include "GL\gl.h"


when i try to build it i get this error:

..\GL_002.cpp(2): fatal error C1083: Cannot open include file: 'glfw3.h': No such file or directory

and is there a way to use the $(SolutionDir) MACRO from my buil.bat file?



mmozeiko
Mārtiņš Možeiko
1971 posts / 1 project
#21219 can't include a directory with cl /I
2 months, 2 weeks ago

Are you executing this .bat file from same drive as where your deps folder is? Try putting absolute path (with disk) to see if it fixes this. /I argument should work fine like this. You probably are executing it from wrong place. Put "cd" inside .bat file before line that calls cl.exe to see what is current working folder.
C_Worm
27 posts
#21221 can't include a directory with cl /I
2 months, 1 week ago

Thanks, it was just executing from the wrong directory. Now it works!