Author Topic: Correct project layout/setup for multiplatform project  (Read 7073 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Correct project layout/setup for multiplatform project
« on: January 04, 2006, 04:29:30 pm »
Hello,
I wanted to try codeblocks for months but the laziness was stopping me:(
Now I have it installed (rc2 first, now svn) and I like it.

But I don't now how to setup, lay out my project.
It is multy directory project. I have on main directory, and many subdirectories. I have some kind of a project setuped but I get unresolved symbols, when file from the main dir depends on file in subdir.

I also don't know how to set it up for dual os, before codeblocks(kdevelop/vstudio), I have project define WIN32 for window, but it was setuped in different environments, but in cb is in one:)
I also need to have a way to build it in debug/release mode and have DEBUG defines setup appropriate.

Can someone explain the steps I have to make, or point me to a tutorial, explanation of this kind of setup?

Thanks in advance, and happy new year:)

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Correct project layout/setup for multiplatform project
« Reply #1 on: January 04, 2006, 05:52:56 pm »
For each target you can specify on build options (or was it in properties?) where the output file will be. Then you'll link that library from your "main" target.

As for debug / release, i think you need to make different targets, specifying debug / release in each.

_OR_ you could copy the project into a new one, and them modify the new project to use different settings. The only problem with that is that you need to keep sync'ed the two projects.

Here's what *I* would do: For your "release project", in the "project build options", add "optimize" and "strip executable", and for your "debug project", add "add debugging symbols" (and your defines) instead. Do this only for the project's settings, not for each target.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Correct project layout/setup for multiplatform project
« Reply #2 on: January 04, 2006, 08:40:58 pm »
Thanks for the reply.
I fixed the problem with the unresolved symbols (bad source code stupid me :(  )

So to make things clear. Is this the compiler settings hierarchy (from least to most significant):
1: setting->compiler or build->compiler options // they look and behave the same, correct me if I'm wrong;
2: project->build options->project selected;
3: project->build options->target selected;

If this observation is correct, I would (maybe) setup 3x2 targets, two targets by compiler(gcc/unix, gcc/win, vc/win)

The two project idea is not for me, I don't like to add the same files twice...

And one(hope so) last question, for today:
I saw that there is code highlighting for openGL shading language(and I develop ogl app), how should I add them to the manager, and edit them in C::B




(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Correct project layout/setup for multiplatform project
« Reply #3 on: January 04, 2006, 09:27:39 pm »
So to make things clear. Is this the compiler settings hierarchy (from least to most significant):
1: setting->compiler or build->compiler options // they look and behave the same, correct me if I'm wrong;
What do you mean by "they look and behave the same"? For example, if I set compiler options for debug and release, they will not be the same.

And one(hope so) last question, for today:
I saw that there is code highlighting for openGL shading language(and I develop ogl app), how should I add them to the manager, and edit them in C::B

May be this wiki article could be helpful.

Michael

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Correct project layout/setup for multiplatform project
« Reply #4 on: January 06, 2006, 01:05:02 am »

What do you mean by "they look and behave the same"? For example, if I set compiler options for debug and release, they will not be the same.
I was talking for the menu options settings -> compiler & build -> compiler options. They look the same (I'm using c::b from svn, updated yesterday), and behave the same. I made a test to see if this assumption is correct: set the -g option into the first dialog and checked to see what is its value in the second, and they were the same, the reverse is also true.


May be this wiki article could be helpful.

This shows how to setup ogl, but I've done that. I want to know how to edit glsl files in c::b, and how to keep them in the project, I suppose it is something related to resource files but I have to investigate a little more.

I hope, I've cleared the missunderstanding from my second post.

Teodor


(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Correct project layout/setup for multiplatform project
« Reply #5 on: January 06, 2006, 01:21:18 am »
I was talking for the menu options settings -> compiler & build -> compiler options. They look the same (I'm using c::b from svn, updated yesterday), and behave the same. I made a test to see if this assumption is correct: set the -g option into the first dialog and checked to see what is its value in the second, and they were the same, the reverse is also true.

Yes, I see. I have tested it too and AFAIK they are/behave the same.  It seems to me some kind of redundancy :?.

Michael

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Correct project layout/setup for multiplatform project
« Reply #6 on: January 06, 2006, 01:28:17 am »
I was talking for the menu options settings -> compiler & build -> compiler options. They look the same (I'm using c::b from svn, updated yesterday), and behave the same. I made a test to see if this assumption is correct: set the -g option into the first dialog and checked to see what is its value in the second, and they were the same, the reverse is also true.

Yes, I see. I have tested it too and AFAIK they are/behave the same.  It seems to me some kind of redundancy :?.

Michael


Yes, they 're exactly the same. Rick thought that users would have trouble finding one of them so he added them both...
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Correct project layout/setup for multiplatform project
« Reply #7 on: January 06, 2006, 01:31:38 am »
Yes, that was when the Build menu was called "Compile". To me it made more sense having Compiler Options under the "Compile" menu, but that doesn't apply now.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Correct project layout/setup for multiplatform project
« Reply #8 on: January 06, 2006, 03:10:04 pm »
Ok, I understand. Thank you for your explanations.

Yes, I agree. When the Build menu was called Compile it had sense to put compiler options there. But now it is IMHO a bit confusing. May be just leave the Global Compiler Options under the Settings menu.

Michael