Author Topic: Path, include, directory.  (Read 191 times)

Offline skoroglyadov

  • Multiple posting newcomer
  • *
  • Posts: 10
Path, include, directory.
« 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))

« Last Edit: November 24, 2022, 12:20:53 pm by skoroglyadov »

Offline skoroglyadov

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Path, include, directory.
« Reply #1 on: November 24, 2022, 12:16:52 pm »
Attach

Offline skoroglyadov

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Path, include, directory.
« Reply #2 on: November 24, 2022, 12:18:09 pm »
Atach

Offline gd_on

  • Lives here!
  • ****
  • Posts: 769
Re: Path, include, directory.
« Reply #3 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).
« Last Edit: November 24, 2022, 01:26:52 pm by gd_on »
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline skoroglyadov

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Path, include, directory.
« Reply #4 on: November 24, 2022, 01:38:52 pm »
Thank you, I changed the paths, now I'm not looking for wx/setup.h

Offline gd_on

  • Lives here!
  • ****
  • Posts: 769
Re: Path, include, directory.
« Reply #5 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.
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline skoroglyadov

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Path, include, directory.
« Reply #6 on: November 24, 2022, 04:41:00 pm »
Thank you, everything works! I would also add that wx/setup.h works with unicode enabled.
« Last Edit: November 24, 2022, 04:45:48 pm by skoroglyadov »