Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: dv82xl on October 28, 2024, 03:26:17 pm

Title: no such file or directory
Post by: dv82xl on October 28, 2024, 03:26:17 pm
I have a project, the files are listed in the project, when typing #include, the file CLEditDB.h is listed with the other headers in the include folder - the build function errors out - see picture
this wasn't an issue yesterday - the project built without issue
codeblocks edit can see the file - the build cannot
ideas?
p.s. please don't tell me I don't know how to ask a question - if you don't have a helpful answer please stay silent         

also: I find it strange that adding a class in codeblocks created the include folder - yet - codeblocks build can't see it   
Title: Re: no such file or directory
Post by: MichaelAgarkov on October 28, 2024, 05:21:28 pm
IIRC the project workspace structure can be different from the actual directory structure of the project.
Title: Re: no such file or directory
Post by: stahta01 on October 28, 2024, 07:22:32 pm
Post a build log and maybe some can help you. Fail to post a build log and I for one will ignore you!

https://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (https://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)
Title: Re: no such file or directory
Post by: gd_on on October 28, 2024, 08:02:21 pm
If I understand how is set your project, you have a file structure like this:
CLEdit
|-src
   |- CLEditCF.cpp
   |- CLEditDB.cpp
|
|-include
   |- CLEditCF.h
   |- CLEditDB.h
|
|-CLEditApp.cpp
|-CLEditApp.h
|-CLEditMain.cpp
|-CLEditMain.h

from inside CLEditDB.cpp, you have an #include CLEditDB.h
from inside CLEditMain.h, you have an #include CLEditCF.h

The compiler will find your .h files if you add in your project CLEdit / build options / Search directories / compiler, the path to the "include" folder.

An other solution is to have all your files directly in the root folder CLEdit, but it's not a goob solution for big projects.
Title: Re: no such file or directory
Post by: dv82xl on October 28, 2024, 08:24:29 pm
I did as you showed - and it worked!
agree that 'putting all your eggs in one basket' is a bad idea
I started coding on punch cards
sometimes - oftentimes these tools are not very verbose
If I improved CodeBlocks - it wouldn't  say 'no such file or directory' especially when it's clearly in the project - I would code the file search engine to recursively look in the project folder
thanks for your help   
p.s. CLEdit is going to be a command line editor merging IBM TSO Edit and including the BIM extensions features - it will obliterate vim- which I simply dislike   
Title: Re: no such file or directory
Post by: stahta01 on October 28, 2024, 09:48:06 pm
Please read the FAQ in the CB Wiki; Code::Blocks is not the Compiler one is on topic today.
To complain about an Compiler Message as if it was created by the Code::Blocks IDE just shows you have not read even the first 5 FAQs or you failed to understand them.

Tim S.