Author Topic: Added source files don't show under "src"  (Read 3780 times)

nununo

  • Guest
Added source files don't show under "src"
« on: June 02, 2008, 03:44:14 am »
Hi,

This must be a very silly question but...

When I add files (.CPP or .H) to a project, instead of showing up under /src they show up under another folder hierarchy next to /src, even though the actual files are inside /src on my hard drive. This other folder is blue instead of green.

How can I make the new files appear under /src?

Thanks,
Nuno

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Added source files don't show under "src"
« Reply #1 on: June 02, 2008, 04:03:35 am »
With an project open try the various settings of

Project -> Project Tree

"Categorize by file types"
"Display Folders as On Disk"

I think you want "Display Folders as On Disk" checked; I have both of them checked.

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

nununo

  • Guest
Re: Added source files don't show under "src"
« Reply #2 on: June 02, 2008, 11:54:04 am »
I found the solution.

Hum... actually I have that option checked. The problem was something else.
In the project file (.CBP) I can see the following:

<Unit filename="src\main.cpp">
  <Option virtualFolder="src\" />
</Unit>
<Unit filename="src\testApp.cpp">
  <Option virtualFolder="src\" />
</Unit>
<Unit filename="src\testApp.h">
  <Option virtualFolder="src\" />
</Unit>
<Unit filename="src\testApp2.cpp" />
<Unit filename="src\testApp2.h" />

So, the already existing files have a virtualFolder defined while the ones I added manually don't.

As soon as I learned this, I realized that it was as simple as dragging the files from the blue folder to the green "virtual" folder.

Problem solved!

Thanks!
Nuno