CodeBlocks Question

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
JarrodParkes
ES Beta Backer
ES Beta Backer
Posts: 325
Joined: Thu Feb 25, 2010 2:39 pm
Current Project: Yes, iPhone Application(s)
Favorite Gaming Platforms: N64, PC
Programming Language of Choice: C++
Location: Mountain View, CA
Contact:

CodeBlocks Question

Post by JarrodParkes »

I have recently installed and set-up the CodeBlocks IDE on my MAC with SDL libraries included. I have been playing around in the IDE looking at different settings and features. One thing I noticed was the inability to create folders within your project to organize files. Maybe I have overlooked something, but the only folder that you can create within your project is a virtual folder? Is a virtual folder the same as a normal folder like one you would create in Visual Studio or something?

Ideally I would like to have...
ProjectName
-> Headers
-> Source
-> Resource
-> Etc.

If anyone knows anything about this or could help clear up some of my confusion, your help would be greatly appreciated!

Thanks,
Jarrod
X Abstract X
Chaos Rift Regular
Chaos Rift Regular
Posts: 173
Joined: Thu Feb 11, 2010 9:46 pm

Re: CodeBlocks Question

Post by X Abstract X »

I'm going to take a guess that it is the same as in Visual Studio. The only reason they call it virtual is because it isn't a folder that actually exists on your disk - it only exists in the IDE, for organizational purposes.
User avatar
JarrodParkes
ES Beta Backer
ES Beta Backer
Posts: 325
Joined: Thu Feb 25, 2010 2:39 pm
Current Project: Yes, iPhone Application(s)
Favorite Gaming Platforms: N64, PC
Programming Language of Choice: C++
Location: Mountain View, CA
Contact:

Re: CodeBlocks Question

Post by JarrodParkes »

So visual studio also creates these "virtual" folders, however I'm guessing it is just less obvious? I guess I am being too picky, I just like to know what/why everything is where it is on the screen.

Thanks,
Jarrod
X Abstract X
Chaos Rift Regular
Chaos Rift Regular
Posts: 173
Joined: Thu Feb 11, 2010 9:46 pm

Re: CodeBlocks Question

Post by X Abstract X »

Yes, in visual studio for example, my headers and source files are in separate "folders". However, when you look at them in the project folder outside of Visual Studio, they are NOT in separate folders.
XianForce
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 767
Joined: Wed Oct 29, 2008 8:36 pm

Re: CodeBlocks Question

Post by XianForce »

Not too sure about the Mac version, but I'm assuming it's the same as the PC version. Anyways, right click on your project, and click "Add Virtual Folder". If you want a folder within a folder, you can right click a folder and click "Add Virtual Folder".
User avatar
JarrodParkes
ES Beta Backer
ES Beta Backer
Posts: 325
Joined: Thu Feb 25, 2010 2:39 pm
Current Project: Yes, iPhone Application(s)
Favorite Gaming Platforms: N64, PC
Programming Language of Choice: C++
Location: Mountain View, CA
Contact:

Re: CodeBlocks Question

Post by JarrodParkes »

XianForce wrote:
"Not too sure about the Mac version, but I'm assuming it's the same as the PC version. Anyways, right click on your project, and click "Add Virtual Folder". If you want a folder within a folder, you can right click a folder and click "Add Virtual Folder"."
Yeah I got that far, I was just unsure what exactly it was doing. Well, looks like I have some new experimentation to do...

Thanks,
Jarrod
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: CodeBlocks Question

Post by Falco Girgis »

Jarrod, the only IDE that I've encountered that actually keeps a directory structure (nonvirtual) in the IDE is XCode (the one thing it does right).

Visual Studio, Code::Blocks, and I think DevC++ support directories in the project only "virtually." So I have a folder in the engine called source and one called header. Then I organize these nicer in the project with a bunch of virtual folders/filters called things like player, level, physics, collision, etc.
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: CodeBlocks Question

Post by avansc »

EDIT: ah i just saw you said in the IDE, my bad, but just dont think that gets translated to filesystem.

actually xcode does a few things right...

now. as for your comment. well this is a complicated issue really.

xcode does very sneaky things to ultimately make your life easier, but in the process can bug.

by default xcode DOES use a virtual structure. The reason being that in a project it could be showing that you are using lets say SDL.framework, but in reality its just a link to somewhere. so for there kinda files i recommend staying with the virtual folder.

okay, now for folders/structure and files that you want in the project workspace to have the same structure in the filesystem.
ps: xcode will show a yellow folder for a virtual and a blue one that exists.

So, if you want to have a non virtual structure you have to set it up on the file system. then add existing files to xcode, but tick the tab, "create folder references for any added folders", this will ensure that it maintains a real structure.

its a little bit of a pain, and there might be a way to make a script that will convert groups to folders for you, but whatev.

hope that clears that up.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Post Reply