Author Topic: Problem with "explicitly add current file directory".  (Read 2911 times)

Offline G-Shadow

  • Multiple posting newcomer
  • *
  • Posts: 16
Problem with "explicitly add current file directory".
« on: April 18, 2015, 01:40:53 pm »
Hi. I`m trying to cross-compile for ARM and faced a problem.
I need to pass a currently compiling file`s directory as an include directory to the compiler.
To do so I have set both global compiler options: explicitly add project`s top level directory and current file`s directory.
The problem is a wrong (truncated or empty) path passed to the compiler.

Project location is "E:\DENIS\Projects\test\TestArmCodeblocks\TestArmCodeblocks.cbp" with sources in the same directory.
But when I enable both "explicitly add" options I see only "-IE:\DENIS" in compiler command line.

I tried to enable only one option at a time and found that:
1) "Explicitly add currently compiling file`s directory" adds nothing.
2) "Explicitly add currently project`s top-level directory" adds "E:\DENIS" instead of full path to my project.

Then I tried to change compiler to the Windows tdm-gcc and found that
1) "Explicitly add currently compiling file`s directory" adds correct path!
2) "Explicitly add currently project`s top-level directory" adds wrong "E:\DENIS" as well.

At the same time I have other initially-Windows (tdm-gcc) project where both options works correctly. But if I switch compiler to ARM it adds one correct path and other is empty. Well... I suspect the problem is somewhere in my project (and it also appears when switching compiler), but I could not find what`s wrong.

Thanks in advance for your help.

Some info:
Code::Blocks - tried both stable 13.12 and "svn 10216" latest nightly.
OS: Windows 8.1 x64 and Windows 7 x64.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11770
    • Travis build status
Re: Problem with "explicitly add current file directory".
« Reply #1 on: April 18, 2015, 01:49:55 pm »
As far as I know top level is not the same as the directory where the project file is, but it is the common top level directory of all files added to the project.
Do you have added files to the project that are not inside E:\DENIS\Projects\test\TestArmCodeblocks\?
(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 G-Shadow

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Problem with "explicitly add current file directory".
« Reply #2 on: April 18, 2015, 02:56:28 pm »
Yes, I have added libraries from E:\DENIS\...
Ok, thanks, now I understand why project`s top level path differs from what I`ve expected.

Then the last hope is currently compiling file`s directory. Why it is empty for ARM compiler but correct for tdm-gcc?

Offline G-Shadow

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Problem with "explicitly add current file directory".
« Reply #3 on: April 18, 2015, 07:51:18 pm »
I have read help and added $(WORKSPACE_DIR) to the project include directories, but this puts C::B profile directory: "-IC:\Users\Denis\AppData\Roaming\CodeBlocks"

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11770
    • Travis build status
Re: Problem with "explicitly add current file directory".
« Reply #4 on: April 18, 2015, 08:03:11 pm »
Probably you're using the default workspace, which is saved in the user's folders.
You'll have to save a workspace file next to your project file.
(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!]