Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: Kaz on May 11, 2021, 04:02:37 pm
-
Hello,
I want to enable the line 2 in the photo
by adding the include directory, rather than writing the full path as in the line 1.
And I think I did so, as in the build log, but when I try to open #include file: 'glad/gl.h', I get this warning "Not found".
So can anyone tell me how to do this corrctly?
-
I think you should write
<> is normally reserved for standard compiler paths.
-
https://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F (https://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F)
WARNING: Use the "For your project :" section of the directions!
Tim S.
-
I think you should write
<> is normally reserved for standard compiler paths.
The above is likely officially true; but, in practice it tends to mean an Compiler or Third Party include when using angle brackets <>.
Tim S.
-
https://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F (https://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F)
WARNING: Use the "For your project :" section of the directions!
Tim S.
I added the path to both for compiler and linker, but unfortunately still can't open the header file.
I also tried replacing "" with <>, which didn't make a difference either.
-
Post the "build log" Do not post the "Build Messages"!
Edit: Add FAQ link https://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (https://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)
Tim S.
-
Post the "build log" Do not post the "Build Messages"!
Note: Also you can "right click -> copy" instead of posting screen shots :)
-
Here is the build log. I've notced that it compiles without errors, but it's just that I can't open the header filefrom code blocks unless I write the full path. Does this mean that it's no problem apart from the inconvenience?...
-------------- Build: Debug in 10MayTest (compiler: GNU GCC Compiler)---------------
g++ -Wall -fexceptions -g -I/home/kazuya/vcpkg/buildtrees/glfw3/src/3.3.3-47325b0495.clean/deps/ -c /home/kazuya/Documents/10MayTest/main.cpp -o obj/Debug/main.o
g++ -L/home/kazuya/vcpkg/buildtrees/glfw3/src/3.3.3-47325b0495.clean/deps/ -o bin/Debug/10MayTest obj/Debug/main.o
Output file is bin/Debug/10MayTest with size 91.13 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
-
If you simply right click on the line containing #include "glad/gl.h", you should see a popup with open 'glad/gl.h'
-
If you simply right click on the line containing #include "glad/gl.h", you should see a popup with open 'glad/gl.h'
Somehow it doesn't work, to repeat myself, unless I type with the full path.
However, now I've realised that this might be just slight inconvenience with no serious consequences, so I'd like to leave this for now.
Thank you very much for the answers, though.
-
did you add a path to compilers serach directories?
In the project build options you have to add the search directory like this:
../../yourLocalPathToGlad/glad/include
-
Here is the build log. I've notced that it compiles without errors, but it's just that I can't open the header filefrom code blocks unless I write the full path. Does this mean that it's no problem apart from the inconvenience?...
It is a bug if you've set the search path in the project -> build options -> search directories.
Where exactly have you added the path?
-
What do you mean with "It is a bug"? A mistake?
There may be other ways to get to Rome but this is the one I use successfully.
If I remember right, I used a book from Joey de Vries when I startet with openGL and did it the same way since then.
-
What do you mean with "It is a bug"? A mistake?
I mean that if the "open include file" feature of the IDE doesn't work, but compilation from the IDE works, then it is most probably a bug in the IDE and it should be possible to fix it.