User forums > Help
Codeblocks cant find include files
Miguel Gimenez:
Post a full rebuild log, see this link
AndrewCot:
LeslieS, Can you please also upload the project CBP file as well as the log.
LeslieS:
Build log:
--- Code: ----------------- Build: Debug in sss (compiler: GNU GCC Compiler)---------------
g++ -Wall -g -I/usr/lib/x86_64-linux-gnu/qt5 -I/usr/lib/qt5 -I/usr/share/qt5 -I/usr/lib/x86_64-linux-gnu/qt5 -I/usr/lib/qt5 -I/usr/share/qt5 -c /home/noone/new.cpp -o obj/Debug/new.o
g++ -o bin/Debug/sss obj/Debug/new.o
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QVersionNumber:1,
from /home/noone/new.cpp:2:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qversionnumber.h:45:10: fatal error: QtCore/qnamespace.h: No such file or directory
45 | #include <QtCore/qnamespace.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
--- End code ---
cbp:
--- Code: ---<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="sss" />
<Option execution_dir="." />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/sss" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
<Add directory="/usr/lib/x86_64-linux-gnu/qt5" />
<Add directory="/usr/lib/qt5" />
<Add directory="/usr/share/qt5" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/sss" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Unit filename="new.cpp" />
<Extensions />
</Project>
</CodeBlocks_project_file>
--- End code ---
Note that the compiler options mentioned in the faq are not found in the compiler settings (at least not in that I could find). In fact I couldn't find those options anywhere.
--- Code: ---Code::Blocks version, compiler log (go to Settings->Compiler and debugger...->Build options (tab) and check Save build log and Always output the full command line),
--- End code ---
Miguel Gimenez:
Remove this paths from the compiler search directories and global compiler search directories from all targets:
--- Code: ---/usr/lib/x86_64-linux-gnu/qt5
/usr/lib/qt5
/usr/share/qt5
--- End code ---
and add only this (and only to the project build options):
--- Code: ---/usr/include/x86_64-linux-gnu/qt5
--- End code ---
LeslieS:
If I did it correctly it seems to be the same result.
Using the menu options to change the settings didn't actually change the cbp file.
I had to go in and manually remove the items from it using a text editor I am not 100% sure I got it right.
--- Code: ----------------- Build: Debug in sss (compiler: GNU GCC Compiler)---------------
g++ -Wall -g -I/usr/lib/x86_64-linux-gnu/qt5 -c /home/noone/new.cpp -o obj/Debug/new.o
g++ -o bin/Debug/sss obj/Debug/new.o
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QVersionNumber:1,
from /home/noone/new.cpp:2:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qversionnumber.h:45:10: fatal error: QtCore/qnamespace.h: No such file or directory
45 | #include <QtCore/qnamespace.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
--- End code ---
--- Code: ---<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="sss" />
<Option execution_dir="." />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/sss" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
<Add directory="/usr/lib/x86_64-linux-gnu/qt5" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/sss" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Unit filename="new.cpp" />
<Extensions />
</Project>
</CodeBlocks_project_file>
--- End code ---
I also tried to start a new project but have run into some strangeness there too. It is endlessly looping "It seems that this project has not been built yet. Do you want to build it now?". Selecting yes just brings this up again.
Selecting no brings up a window "sh: 1: /home/noone/bin/debug/test2: file not found".
I think that maybe CodeBlocks is geared towards people who are already quite familiar with the intricacies of C/C++ compiling.
It could be that there is too much I don't know.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version