User forums > Using Code::Blocks

non-standard include directories and cmake

(1/2) > >>

seasoned_geek:
All,

I used the command line to convert a small demo CMake application to Code::Blocks. Under CMake it builds and runs.

Ubuntu 20.04 LTS.

ame             : Code::Blocks
Version          : 20.03-r11997
SDK Version      : 2.0.0
Scintilla Version: 3.7.5
Author           : The Code::Blocks Team
E-mail           : info@codeblocks.org
Website          : http://www.codeblocks.org

wxWidgets Library (wxGTK port)
Version 3.0.4 (Unicode: wchar_t, debug level: 1),
Runtime version of toolkit used is 3.24.
Compile-time GTK+ version is 3.24.14.

My issue seems to be related to this question:

https://forums.codeblocks.org/index.php/topic,24485.0.html

Forum software complained that message was over 120 days old and requested I create a new topic.

||=== Build: all in ThreeScreens (compiler: GNU GCC Compiler) ===|
/home/developer/Projects/ThreeScreens/testapp.h|4|fatal error: Screen.h: No such file or directory|
 [CMakeFiles/ThreeScreens.dir/build.make|76|CMakeFiles/ThreeScreens.dir/testapp.cpp.o] Error 1|
/home/developer/Projects/ThreeScreens/testapp.h|4|fatal error: Screen.h: No such file or directory|
 [CMakeFiles/ThreeScreens.dir/build.make|63|CMakeFiles/ThreeScreens.dir/main.cpp.o] Error 1|
 [CMakeFiles/Makefile2|76|CMakeFiles/ThreeScreens.dir/all] Error 2|
 [/home/developer/Projects/ThreeScreens/build/Makefile|106|all] Error 2|
||=== Build failed: 6 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

I am no expert but the project file looks correct.



In the IDE, not so much.



Even if I manually add the search path



It still errors out. Doesn't matter if I put "" around the include file or <>

1) Is there a version where this has been fixed?

2) What is the work around? We have to use CMake. I was setting Code::Blocks up in the development VM because some of the team cannot function without an IDE.  We use CMake to build inside of a container and there is no changing that.

I just need to find and document a workable path for other team members.

If you need to see the CMakeLists.txt and source, that is fine. This is just a dumb little 3-screen NanoGUI demo program. Absolutely nothing proprietary (or useful) about it.

Thanks,

AndrewCot:
I have not used the "Project->Properties->C/C++ parser options" and I have not played with CMAKE.

To change you go into the "Project->Build Options" menu and then select the "Search Directories" tab and then add/change/update the paths that are required for either the compiler or linker or resource compiler by selecting the appropriate tab.

Is the header "Screen.h" (case check as well) in one of the search directories specified?

stahta01:
FYI: Unless Cmake has changed it does not make an normal CB project instead it makes an CB custom makefile project.

The above was true about two years ago; but, cmake might make an normal CB project now.

Tim S.

seasoned_geek:

--- Quote from: AndrewCot on November 20, 2021, 12:32:34 am ---I have not used the "Project->Properties->C/C++ parser options" and I have not played with CMAKE.

To change you go into the "Project->Build Options" menu and then select the "Search Directories" tab and then add/change/update the paths that are required for either the compiler or linker or resource compiler by selecting the appropriate tab.

Is the header "Screen.h" (case check as well) in one of the search directories specified?

--- End quote ---

As stated with original post, this project builds and runs with CMake and the command line. Was just looking for a near painless path to IDE support for junior members who cannot function without an IDE.

What version of Code::Blocks are you using? Here is what I see for Project->Build Options



There is no "Search Directories" tab. As stated in the original post, the only place I found "search paths" was here.



That made absolutely zero difference.

You did hit on something rather remarkable though.



This thing actually built and ran with miss-matched case. Should never have worked.

stahta01:
FYI: When using an custom makefile project in the CB IDE some things to check are
1. The location of the CB Project file along with the location of the custom makefile the relative location is often a problem
2. The "Make" commands
3. The toolchain setting is using the same make executable as you are from the command line
Note: I have never heard the Linux people have item 3 problems; but, Windows people do sometimes.

Tim S.

Navigation

[0] Message Index

[#] Next page

Go to full version