Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: skoroglyadov on November 24, 2022, 12:07:21 pm

Title: Path, include, directory.
Post by: skoroglyadov on November 24, 2022, 12:07:21 pm
Hello everyone When adding paths to the search directory, new undiscovered files appear, although they are located in the same directory.
I will be grateful for your help.
Code
-------------- Build: Release in jj (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -O2 -I..\..\wxWidgets\include\wx -I..\..\wxWidgets\include\wx -c C:\pro\jj\jjApp.cpp -o obj\Release\jjApp.o
g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -O2 -I..\..\wxWidgets\include\wx -I..\..\wxWidgets\include\wx -c C:\pro\jj\jjMain.cpp -o obj\Release\jjMain.o
windres.exe -IC:\wxWidgets\include\wx -I..\..\wxWidgets\include\wx  -J rc -O coff -i C:\pro\jj\resource.rc -o obj\Release\resource.res
g++.exe -LC:\wxWidgets\lib\gcc_dll -o bin\Release\jj.exe obj\Release\jjApp.o obj\Release\jjMain.o  obj\Release\resource.res -s -mthreads  -lwxmsw31 -mwindows
In file included from C:\pro\jj\jjApp.cpp:10:
C:\pro\jj\jjApp.h:13:10: fatal error: wx/app.h: No such file or directory
 #include <wx/app.h>
          ^~~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
 
In file included from C:\pro\jj\jjMain.cpp:10:
C:\pro\jj\jjMain.h:14:10: fatal error: wx/button.h: No such file or directory
 #include <wx/button.h>
          ^~~~~~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Title: Re: Path, include, directory.
Post by: skoroglyadov on November 24, 2022, 12:16:52 pm
Attach
Title: Re: Path, include, directory.
Post by: skoroglyadov on November 24, 2022, 12:18:09 pm
Atach
Title: Re: Path, include, directory.
Post by: gd_on on November 24, 2022, 12:43:44 pm
If in your search path for the compiler you have wxWidgets\include\wx then as in your program you hane #include <wx\app.h> the real searched file is wxWidgets\include\wx\wx\app.h, which is not correct.
In your global variable, simply use C:\wxWidgets. It is not necessary to add the include path because it is done automaticcaly by C::B.
Same problem in the project ..\..\wxWidgets\include\wx. It's redundant with the global definition (and \wx should be deleted).
In your project configuration, don't forget to add the global path by $(#WXWIDGETS)\include [or  $(#WXWIDGETS.include)]: it's better than redefining the whole relative path (particularly if you move your project).
Title: Re: Path, include, directory.
Post by: skoroglyadov on November 24, 2022, 01:38:52 pm
Thank you, I changed the paths, now I'm not looking for wx/setup.h
Title: Re: Path, include, directory.
Post by: gd_on on November 24, 2022, 03:27:39 pm
That's because you also need to set $(#WXWIDGETS)\lib\gcc_dll\mswu in the compiler search directories, where normally this wx\setup.h has been created when you built wxWidgets.
Title: Re: Path, include, directory.
Post by: skoroglyadov on November 24, 2022, 04:41:00 pm
Thank you, everything works! I would also add that wx/setup.h works with unicode enabled.