User forums > General (but related to Code::Blocks)

Moving to GCC question

<< < (2/11) > >>

thomas:

--- Quote from: troels on January 18, 2006, 01:43:03 pm ---It certainly does. It compiles in MSVC.
--- End quote ---
It is not as certain as you think.

In the project which you supplied, for example, none of the headers exist from the point of the compiler's view, there are no include directory settings at all, and the include files are in a subfolder.

troels:

--- Quote from: Michael on January 18, 2006, 02:14:07 pm ---After adding the include directories, I had to modify...

--- End quote ---

Sorry, buy this (gcctest.zip) is a perfectly valid project as is, I believe.
The idea is to not change anything. Especially not the source files.


--- Quote from: thomas on January 18, 2006, 02:21:17 pm ---In the project which you supplied...there are no include directory settings at all

--- End quote ---

This is on purpose.

But, perhaps moving to gcc just requires adding include directories (adding gazillions of include directories if you have gazillions of subprojects) ??

Thanks
Troels

thomas:

--- Quote from: troels on January 18, 2006, 02:26:15 pm ---This is on purpose.

But, perhaps moving to gcc just requires adding include directories (adding gazillions of include directories if you have gazillions of subprojects) ??
--- End quote ---
Well, on purpose or not, it's wrong ;)

I don't know whether the MS compiler automatically looks into ../include or whether Visual Studio adds that path secretly, but it is a certain thing that the compiler cannot possibly find those files if it does not know where to look.
You don't need to add millions of paths for the same number of projects, since you can use relative pathnames, and if you don't like adding them to the individual projects, you can do so in global compiler options.

Michael:

--- Quote from: troels on January 18, 2006, 02:26:15 pm ---
--- Quote from: Michael on January 18, 2006, 02:14:07 pm ---After adding the include directories, I had to modify...

--- End quote ---

Sorry, buy this (gcctest.zip) is a perfectly valid project as is, I believe.
The idea is to not change anything. Especially not the source files.

--- End quote ---

Sorry, but I think it is not valid. If I add the include directories to C::B, then I have to modify as above, if I add no include directories, then I have to modify the #include in:


--- Code: ---#include "./mylib/include/mylib.h"

--- End code ---

The problem is when you give a relative path: from where begin the search?

Michael

troels:

--- Quote from: Michael on January 18, 2006, 02:49:08 pm ---
--- Code: ---#include "./mylib/include/mylib.h"

--- End code ---
The problem is when you give a relative path: from where begin the search?

--- End quote ---

I believe it's fairly clear, apostrophes ("") means 'here' (the location of the .c file with the #include in it), lessthan-greaterthan (<>) means search include paths (first). But I could be wrong I guess.


--- Quote from: thomas on January 18, 2006, 02:45:07 pm ---
--- Quote from: troels on January 18, 2006, 02:26:15 pm ---This is on purpose.
--- End quote ---
Well, on purpose or not, it's wrong ;)

--- End quote ---

It can't be entirely wrong, rightclicking -> "Build File" works.

/Troels

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version