User forums > Help
Not obeying compiler flags
lissalissa:
Hello friends,
I am trying to compile a project using wxWidgets. I build the wx libraries from source, and after getting the compiler and linker flags from wx-config --cppflags and --libs respectively, I inserted the flags into the compiler and linker options in codeblocks. And yet, when I try to build, it spits out no such file or directory errors for the files included from the wx libraries.
I'm doing this on Fedora 35 in codeblocks 20.03.
Any ideas?
stahta01:
IIRC, You need to put `wx-config --cppflags` in the other settings section.
The tilted single quotes are required.
Edit: I have always needed to close and reopen either the CB project or CB itself when the output of these shell command change under Windows OS. I have been told this is not needed under Linux and some people claim it is not needed under Windows; but, I have never gotten it to work with Win7.
Edit2: If you still have a problem post a build log with the gcc command and its error; because after I reread your post I realized I may have read it wrong. https://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
Tim S.
BlueHazzard:
--- Quote ---Edit: I have always needed to close and reopen either the CB project or CB itself when the output of these shell command change under Windows OS. I have been told this is not needed under Linux and some people claim it is not needed under Windows; but, I have never gotten it to work with Win7.
--- End quote ---
You can see your backtick cache in settings->Backtick cache
lissalissa:
It's still not working. Here's the build log:
--- Code: ----------------- Clean: Debug in Patient Encoder (compiler: GNU GCC Compiler)---------------
Cleaned "Patient Encoder - Debug"
-------------- Build: Debug in Patient Encoder (compiler: GNU GCC Compiler)---------------
g++ -Wall -fexceptions -g -I/usr/wx3.0.5/wx-dynamic-build/lib/wx/include/gtk3-unicode-3.0 -I/usr/wx3.0.5/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -c "/home/alissa/Documents/development/Patient Encoder/addtogroup.cpp" -o obj/Debug/addtogroup.o
g++ -Wall -fexceptions -g -I/usr/wx3.0.5/wx-dynamic-build/lib/wx/include/gtk3-unicode-3.0 -I/usr/wx3.0.5/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -c "/home/alissa/Documents/development/Patient Encoder/deletegroup.cpp" -o obj/Debug/deletegroup.o
g++ -Wall -fexceptions -g -I/usr/wx3.0.5/wx-dynamic-build/lib/wx/include/gtk3-unicode-3.0 -I/usr/wx3.0.5/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -c "/home/alissa/Documents/development/Patient Encoder/group.cpp" -o obj/Debug/group.o
g++ -Wall -fexceptions -g -I/usr/wx3.0.5/wx-dynamic-build/lib/wx/include/gtk3-unicode-3.0 -I/usr/wx3.0.5/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -c "/home/alissa/Documents/development/Patient Encoder/main.cpp" -o obj/Debug/main.o
g++ -Wall -fexceptions -g -I/usr/wx3.0.5/wx-dynamic-build/lib/wx/include/gtk3-unicode-3.0 -I/usr/wx3.0.5/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -c "/home/alissa/Documents/development/Patient Encoder/mainwindow.cpp" -o obj/Debug/mainwindow.o
g++ -Wall -fexceptions -g -I/usr/wx3.0.5/wx-dynamic-build/lib/wx/include/gtk3-unicode-3.0 -I/usr/wx3.0.5/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -c "/home/alissa/Documents/development/Patient Encoder/newgroup.cpp" -o obj/Debug/newgroup.o
g++ -Wall -fexceptions -g -I/usr/wx3.0.5/wx-dynamic-build/lib/wx/include/gtk3-unicode-3.0 -I/usr/wx3.0.5/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -c "/home/alissa/Documents/development/Patient Encoder/newptdialog.cpp" -o obj/Debug/newptdialog.o
g++ -Wall -fexceptions -g -I/usr/wx3.0.5/wx-dynamic-build/lib/wx/include/gtk3-unicode-3.0 -I/usr/wx3.0.5/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -c "/home/alissa/Documents/development/Patient Encoder/patient.cpp" -o obj/Debug/patient.o
g++ -Wall -fexceptions -g -I/usr/wx3.0.5/wx-dynamic-build/lib/wx/include/gtk3-unicode-3.0 -I/usr/wx3.0.5/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -c "/home/alissa/Documents/development/Patient Encoder/plist.cpp" -o obj/Debug/plist.o
g++ -Wall -fexceptions -g -I/usr/wx3.0.5/wx-dynamic-build/lib/wx/include/gtk3-unicode-3.0 -I/usr/wx3.0.5/include -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -c "/home/alissa/Documents/development/Patient Encoder/suffix.cpp" -o obj/Debug/suffix.o
g++ -o "bin/Debug/Patient Encoder - CB" obj/Debug/addtogroup.o obj/Debug/deletegroup.o obj/Debug/group.o obj/Debug/main.o obj/Debug/mainwindow.o obj/Debug/newgroup.o obj/Debug/newptdialog.o obj/Debug/patient.o obj/Debug/plist.o obj/Debug/suffix.o -L/usr/wx3.0.5/wx-dynamic-build/lib -pthread -Wl,-rpath,/usr/wx3.0.5/wx-dynamic-build/lib -lwx_gtk3u_xrc-3.0 -lwx_gtk3u_html-3.0 -lwx_gtk3u_qa-3.0 -lwx_gtk3u_adv-3.0 -lwx_gtk3u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
In file included from /home/alissa/Documents/development/Patient Encoder/main.cpp:3:
/home/alissa/Documents/development/Patient Encoder/mainwindow.h:5:10: fatal error: wx/wx.h: No such file or directory
5 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
In file included from /home/alissa/Documents/development/Patient Encoder/mainwindow.cpp:1:
/home/alissa/Documents/development/Patient Encoder/mainwindow.h:5:10: fatal error: wx/wx.h: No such file or directory
5 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
In file included from /home/alissa/Documents/development/Patient Encoder/newgroup.cpp:1:
/home/alissa/Documents/development/Patient Encoder/newgroup.h:7:10: fatal error: wx/wx.h: No such file or directory
7 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
In file included from /home/alissa/Documents/development/Patient Encoder/addtogroup.cpp:3:
/home/alissa/Documents/development/Patient Encoder/addtogroup.h:9:10: fatal error: wx/wx.h: No such file or directory
9 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
In file included from /home/alissa/Documents/development/Patient Encoder/deletegroup.cpp:1:
/home/alissa/Documents/development/Patient Encoder/deletegroup.h:11:10: fatal error: wx/wx.h: No such file or directory
11 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
In file included from /home/alissa/Documents/development/Patient Encoder/suffix.h:13,
from /home/alissa/Documents/development/Patient Encoder/suffix.cpp:4:
/home/alissa/Documents/development/Patient Encoder/patient.h:10:10: fatal error: wx/wx.h: No such file or directory
10 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
In file included from /home/alissa/Documents/development/Patient Encoder/group.h:12,
from /home/alissa/Documents/development/Patient Encoder/group.cpp:3:
/home/alissa/Documents/development/Patient Encoder/patient.h:10:10: fatal error: wx/wx.h: No such file or directory
10 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
In file included from /home/alissa/Documents/development/Patient Encoder/newptdialog.cpp:3:
/home/alissa/Documents/development/Patient Encoder/newptdialog.h:12:10: fatal error: wx/wx.h: No such file or directory
12 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
In file included from /home/alissa/Documents/development/Patient Encoder/patient.cpp:3:
/home/alissa/Documents/development/Patient Encoder/patient.h:10:10: fatal error: wx/wx.h: No such file or directory
10 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
9 error(s), 0 warning(s) (0 minute(s), 0 second(s))
In file included from /home/alissa/Documents/development/Patient Encoder/group.h:12,
from /home/alissa/Documents/development/Patient Encoder/plist.h:13,
from /home/alissa/Documents/development/Patient Encoder/plist.cpp:3:
/home/alissa/Documents/development/Patient Encoder/patient.h:10:10: fatal error: wx/wx.h: No such file or directory
10 | #include <wx/wx.h>
| ^~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
10 error(s), 0 warning(s) (0 minute(s), 0 second(s))
--- End code ---
stahta01:
If you were on windows, I would be sure it is the spaces in the path "bin/Debug/Patient Encoder - CB" that caused the problem.
I have no idea if the same problem exists for Linux users.
I would also avoid the dash "-" in the path.
I suggest doing the path changes and see if it fixes the issue.
Tim S.
Navigation
[0] Message Index
[#] Next page
Go to full version