Register
Handmade Hero»Forums»Code»can't include a directory with cl /I
64 posts
can't include a directory with cl /I
10 months, 4 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?



Mārtiņš Možeiko
2074 posts / 1 project
can't include a directory with cl /I
10 months, 4 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.
64 posts
can't include a directory with cl /I
10 months, 4 weeks ago
Thanks, it was just executing from the wrong directory. Now it works!