A quick question about organizing my folders

Started by
1 comment, last by wintertime 11 years ago

Hello, I am wondering if/how I can separate my .dlls into another folder. Currently I only have one folder with all my "crap"(code, images, sounds, .dlls, ect) in it, and I am looking into organizing the "crap" into multiple folders. Thanks for any help.

Advertisement

Well it depends on your programming language, what I usually have, for C or C++, is as follows:


project
 |- bin/           (for binaries and required DLLs.. you can also have a lib folder)
 |   |- debug/
 |   |- release/
 |- data/          (for assets, such as databases, images, sounds, and so on)
 |   |- images/    
 |   |- sounds/
 |- doc/           (for your documentation, either generated or written)
 |   |- html/
 |   |- pdf/
 |- src/           (for the source code files, organize in subfolders)
 |   |- folder1/
 |   |- folder2/
 |- include/       (for the header code files, if applicable)
 |   |- folder1/
 |   |- folder2/
 |- misc/          (anything left that you want to include)

When it comes to DLL's, though, you might not want to drag around a bunch of common DLL's when distributing your program, so you might want to ask the user to install the required frameworks instead of providing the DLL's yourself, this makes it easier on you and ultimately on the user, since there will be no duplication.

As for how to get your program to find those DLL's, well, unless you are loading them dynamically, they need to be in the program's PATH variable for the system to find them, this PATH includes your system PATH (operating system library folder, and other programs tend to write themselves in this variable too) in addition to the directory where the program was launched, which generally means you need your custom DLL's to be right next to your program, at least under Windows.

This also applies to resources to some extent, so for release you probably don't want a bin/ folder.

If you use an installer you can make things more consistent, but this is more advanced.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

You can also add:

obj - with debug and realease subdirs, so the compiled object files are not intermingled with the source files

lib - with debug and realease subdirs, so you can neatly organize your project into librarys and have the .lib or .a files there

test - source for test programs/unittests

srcdata - if you have data files that get converted before being used by your program

srcdoc - if you generate those html/pdf/whatever automatically

Actually you can just add as many folders as you need, if they help organizing your files.

This topic is closed to new replies.

Advertisement