Author Topic: no such file or directory  (Read 4668 times)

Offline dv82xl

  • Single posting newcomer
  • *
  • Posts: 2
no such file or directory
« 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   
« Last Edit: October 29, 2024, 10:33:30 am by dv82xl »

MichaelAgarkov

  • Guest
Re: no such file or directory
« Reply #1 on: October 28, 2024, 05:21:28 pm »
IIRC the project workspace structure can be different from the actual directory structure of the project.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7716
    • My Best Post
Re: no such file or directory
« Reply #2 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
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gd_on

  • Lives here!
  • ****
  • Posts: 800
Re: no such file or directory
« Reply #3 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.
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.5 (tests with 3.3), Msys2 Compilers 14.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline dv82xl

  • Single posting newcomer
  • *
  • Posts: 2
Re: no such file or directory
« Reply #4 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   

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7716
    • My Best Post
Re: no such file or directory
« Reply #5 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org