I am running Code::Blocks version Code::Blocks 20.03 on Zorin OS 16 Core.
The compiler I use is GNU GCC Compiler
version gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04).
When I import a VS code sample project using a 3rd Party SDK (Ultra App Kit) and added in the needed include folder in the directory search for the 3rd Party SDK everything seems fine.
Until I go to build / Compile where it asks for X11/Xmu/WinUtil.h, which is in the usr/include/ folder on the system.
The header file asking with the line; #include <X11/Xmu/WinUtil.h> // `apt-get install libxmu-dev
is part of the 3rd Party SDK, and yes, I ran sudo apt-get install libxmu-dev to make sure it was installed.
Though now that I look at the order of includes in that file something seems a bit weird.
As just above the line with an error is; include <X11/Xlib.h> // `apt-get install libx11-dev`
so is Code::Blocks not doing a recursive check in the /usr/include/X11 folder?
Or do I need to rebuild a certain file somewhere so the compiler can more easily see it?
Build log:
-------------- Clean: Debug x64 in Testing (compiler: GNU GCC Compiler)---------------
Cleaned "Testing - Debug x64"
-------------- Build: Debug x64 in Testing (compiler: GNU GCC Compiler)---------------
g++ -lX11 -Wall -g -O0 -D_ULTRA_APPKIT -D_DEBUG -I/Include/ -I"../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include" -c "/home/ryos/Documents/Ultra Engine/Projects/Testing/Source/main.cpp" -o Debug/Source/main.o
g++ -lX11 -Wall -g -O0 -D_ULTRA_APPKIT -D_DEBUG -I/Include/ -I"../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include" -c "/home/ryos/Documents/Ultra Engine/Projects/Testing/Source/UltraEngine.cpp" -o Debug/Source/UltraEngine.o
In file included from ../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include/UltraEngine.h:42,
from /home/ryos/Documents/Ultra Engine/Projects/Testing/Source/main.cpp:1:
../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include/framework.h:43:18: fatal error: X11/Xmu/WinUtil.h: No such file or directory
43 | #include <X11/Xmu/WinUtil.h> // `apt-get install libxmu-dev
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
In file included from ../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include/UltraEngine.h:42,
from /home/ryos/Documents/Ultra Engine/Projects/Testing/Source/UltraEngine.cpp:1:
../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include/framework.h:43:18: fatal error: X11/Xmu/WinUtil.h: No such file or directory
43 | #include <X11/Xmu/WinUtil.h> // `apt-get install libxmu-dev
| ^~~~~~~~~~~~~~~~~~~
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))
I've tried to get the IDE to include usr/include/X11 in the search directory list and it can't see the X11 folder in the usr/include/ location.
I have a tried Looking for a VC++ compiler since I am importing a VS code sample project even loading the mingw compiler.
I gave that a shot and got the same error.
It is like as I mentioned in the OP, Code::Blocks can not seem to see the X11 folder when doing the directory search, and in the second post noted something weird.
As the file that has the issue is like this:
....
#include <X11/Xlib.h> // <-- does Fine
#include <X11/Xmu/WinUtil.h> // <-- Gives error
#include <X11/Xatom.h>
...
How can X11/Xlib.h be fine, but X11/Xmu/WinUtil.h not be?
Here's the Build Log:
-------------- Clean: Debug x64 in Testing (compiler: GNU GCC Compiler)---------------
Cleaned "Testing - Debug x64"
-------------- Build: Debug x64 in Testing (compiler: GNU GCC Compiler)---------------
g++ -lX11 -Wall -g -O0 -D_ULTRA_APPKIT -D_DEBUG -I/Include/ -I/usr/include -I"../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include" -c "/home/ryos/Documents/Ultra Engine/Projects/Testing/Source/main.cpp" -o Debug/Source/main.o
g++ -lX11 -Wall -g -O0 -D_ULTRA_APPKIT -D_DEBUG -I/Include/ -I/usr/include -I"../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include" -c "/home/ryos/Documents/Ultra Engine/Projects/Testing/Source/UltraEngine.cpp" -o Debug/Source/UltraEngine.o
In file included from ../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include/UltraEngine.h:42,
from /home/ryos/Documents/Ultra Engine/Projects/Testing/Source/main.cpp:1:
../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include/framework.h:43:18: fatal error: X11/Xmu/WinUtil.h: No such file or directory
43 | #include <X11/Xmu/WinUtil.h> // `apt-get install libxmu-dev
| ^~~~~~~~~~~~~~~~~~~
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))
In file included from ../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include/UltraEngine.h:42,
from /home/ryos/Documents/Ultra Engine/Projects/Testing/Source/UltraEngine.cpp:1:
../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include/framework.h:43:18: fatal error: X11/Xmu/WinUtil.h: No such file or directory
43 | #include <X11/Xmu/WinUtil.h> // `apt-get install libxmu-dev
| ^~~~~~~~~~~~~~~~~~~
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))
is X11/Xmu/WinUtil.h in your file system? Have you actually checked id the file is there? only running
apt-get install libxmu-dev
does not ensure that the file is there :)
can you run
tree /usr/include > test.txt
in a shell/bash in your home directory, zip the generated test.txt and post it here?
Linux file system is case sensitive... Are the x in your includes the same case? They should be upper case according your tree output
have you tried to switch order of includes?
Have you checked the access rights to the Xmu folder?
it is not codeblocks that is giving you errors, but gcc...
can you run c++ -xc++ /dev/null -E -Wp,-v 2>&1 | sed -n 's,^ ,,p'
in your console and post the result here?
This has to be some stupid error, where we all will head bang when it works...
Looking at your files, confirms that "/usr/include" is in the default search path, so #including <X11/Xmu/WinUtil.h> should result in /usr/include/X11/Xmu/WinUtil.h
Ok ,i am somehow out of ideas:
I tried to reproduce your problem, the steps i did:
1) Set up fresh linux Mint
2) sudo apt-get install libx11-dev
3) sudo apt-get install libxmu-dev
4) Open codeblocks, create a c++ console project
5) paste#include <X11/Xmu/WinUtil.h> // <-- Gives error
#include <X11/Xatom.h>
#include <X11/Xlib.h> // <-- does Fine
6) Hit compile
everything compiles fine...
i also added your include directories (beside the steam things) and still everything worked fine...
have you tried to call in your project folder
g++ -lX11 -Wall -g -O0 -D_ULTRA_APPKIT -D_DEBUG -I/Include/ -I/usr/include -I"../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include" -c "/home/ryos/Documents/Ultra Engine/Projects/Testing/Source/UltraEngine.cpp" -o Debug/Source/UltraEngine.o
directly in console and look at the output?
Also you can try to call (note the added -v -E)
g++ -v -E -lX11 -Wall -g -O0 -D_ULTRA_APPKIT -D_DEBUG -I/Include/ -I/usr/include -I"../../../../.steam/debian-installation/steamapps/common/Ultra App Kit/Include" -c "/home/ryos/Documents/Ultra Engine/Projects/Testing/Source/UltraEngine.cpp" -o Debug/Source/UltraEngine.o
and look at the include directories if you can find something
Are you running in a linux on windows system, or native linux system?
I've run those commands (sudo) when setting up codeblocks and even used Synaptic package manager to re-install them encase something was corrupted.
And I can't run CodeBlocks as sudo in the terminal
ryos@ZorinVM:~$ sudo codeblocks
sudo: codeblocks: command not found
Seems I must have a different version of code-blocks installed.
I'll try using the one from the Zorin repo using sudo apt-get install codeblocks
and the console project works now.
So their is an Issue with one from the software centre, Version: 20.03, Updated: 2021-12-06, sourced from dl.flathub.org.
While the apt-get one works.