News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

no such file or directory

Started by dv82xl, October 28, 2024, 03:26:17 PM

Previous topic - Next topic

dv82xl

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   

MichaelAgarkov

IIRC the project workspace structure can be different from the actual directory structure of the project.

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

gd_on

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 (25H2), svn C::B (last version or almost!), wxWidgets 3.3.2, Msys2 Compilers 16.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

dv82xl

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   

stahta01

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]