Author Topic: Projectfiles on other drives  (Read 7460 times)

MadMeX

  • Guest
Projectfiles on other drives
« on: November 29, 2007, 02:59:27 pm »
Hello,

my setup is as follows. I have a development kit on drive c:\ and my project reside on a network share, say z:\ . I want to include a source file from the kit into my project, but everytime I try to include it, it is relative to the project folder. And when I try to build then, the linker complains about the filename. Can I include the file with an absolute path ? If I just copy the file to my other source files it works, but this is not nice.

Thanks in advance
MeX

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Projectfiles on other drives
« Reply #1 on: November 29, 2007, 04:29:34 pm »
All my projects are on D:. I just added a file which is on C:, and this works just fine?

I can't tell about 1-2 year old versions of course, but r4660 (which I'm using as stable revision all day) has no such problems.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

MadMeX

  • Guest
Re: Projectfiles on other drives
« Reply #2 on: November 29, 2007, 06:35:35 pm »
Ok, i'm using r3466 from 1.jan.07. It is shipped with the development kit from jennic for zigbee-modules.
In the dev-kit codeblocks is preconfigured, so when the demo-apps are in the right place, everything works fine. There is one common file which is in the .cbp referenced like
  <Unit filename="..\..\..\..\SDK\Common\Source\AppQueueApi.c">
but this won't work, couse i'm not in the default dir. if i change it to
  <Unit filename="$(#jennicsdk)\Common\Source\AppQueueApi.c">
with $(#jennicsdk)=C:\Jennic\cygwin\jennic\SDK I get
ba-elf-ld: ..\JN5139_Build\Release\.objs\C:\Jennic\cygwin\jennic\SDK\Common\Source\AppQueueApi.o: No such file: No such file or directory

I hope this helps to understand my problem.
Thanks
MeX

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Projectfiles on other drives
« Reply #3 on: November 29, 2007, 06:53:55 pm »
Ok, i'm using r3466 from 1.jan.07. It is shipped with the development kit from jennic for zigbee-modules.

You are using a very old version of C:B. This bug has been fixed long ago and doesn't exist in newer nightlies. Please upgrade to a latest nightly.
Be a part of the solution, not a part of the problem.

MadMeX

  • Guest
Re: Projectfiles on other drives
« Reply #4 on: December 01, 2007, 09:02:27 pm »
I upgraded to the latest build 4681.

The problem is still there.
I have a global variable jennicsdk with base C:\Jennic\cygwin\jennic\SDK

If I have an item like
<Unit filename="$(#jennicsdk)\Chip\Common\Source\Printf.c">
   <Option compilerVar="CC" />
</Unit>

I will get the error
ba-elf-ld: ..\JN5139_Build\Debug\.objs\C:\Jennic\cygwin\jennic\SDK\Chip\Common\Source\Printf.o: No such file: No such file or directory

If I change the unit path to
<Unit filename="C:\Jennic\cygwin\jennic\SDK\Chip\Common\Source\Printf.c">
   <Option compilerVar="CC" />
</Unit>
it works

i think the problem is somewhere in the expansion of the variable to the linker. The .o file is compiled and at \Debug\.objsC\Jennic\cygwin\jennic\SDK\Chip\Common\Source

Thanks
MeX


Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Projectfiles on other drives
« Reply #5 on: December 01, 2007, 10:44:18 pm »
Quote from: MadMeX
Can I include the file with an absolute path ?

Quote from: MadMeX
<Unit filename="$(#jennicsdk)\Chip\Common\Source\Printf.c">

The moment you start describing your problems accurately, we may be in a position to help you...
Be patient!
This bug will be fixed soon...

MadMeX

  • Guest
Re: Projectfiles on other drives
« Reply #6 on: December 01, 2007, 11:32:57 pm »
Quote from: MadMeX
Can I include the file with an absolute path ?

Quote from: MadMeX
<Unit filename="$(#jennicsdk)\Chip\Common\Source\Printf.c">

The moment you start describing your problems accurately, we may be in a position to help you...

Ok, in my first post i did not understand the problem. please remember for a moment only the last post. There I described my actual problem.
As far as I understand my problem, C:B generates a path for the .o relative to the .objs similiar to the location on the drive. And because of windows filenames a directory name of c: isn't allowed, so it generates .objsC. So there is some kind of reinterpretation of c:\... to objsC\... But when the unit-filename is composed of a variable, this reinterpretation is not done, when gernerating the full filename for the ba-elf-ld linker - see the errormessage, it should be ..\JN5139_Build\Debug\.objsC\.... passed to ld, but then the file would be found.

so my question is: is this a bug or am i using the compiler-var the wrong way? I want to include a file relative to a compiler-var, like the first <unit filename>-block, so that it is an absolute path like the second block (which should be the same, as far as I understand)

I hope this is now clearer. (my first description with an absolute path was wrong, because i not realised the structured objs... dirs)

Thanks
MeX

Online stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Projectfiles on other drives
« Reply #7 on: December 10, 2007, 05:27:33 am »
I am taking the time to try to understand your issue.

I am downloading JN-SW-4026-SDKwithIDE-1v5.0.msi to try to duplicate your setup.

Do you know what complier is being used?
I saw the word CygWin in the path and I am guessing a custom version of CygWin GCC, is this correct?
If it is CygWin, that may be the issue, it is not tested very often so it might have bugs in the current version.

File, 90 MB, being downloaded from here. It going real slow, might be a while to finish.
http://www.jennic.com/files/support_files/JN-SW-4026-SDKwithIDE-1v5.0.msi

Quote
development kit on drive c:\ and my project reside on a network share, say z:\

Is the following correct?
jennicSDK is on drive C: (Local Drive)
Project source code is on drive Z: (Network Drive)
Project cbp file is on drive Z: (Network Drive)

Which drive is the compiler on?

Which sample application code::blocks project file is closest to yours?
I need one to try to compile, I may need to ask you questions about some basic things; since, I have no knowledge of this stuff. But, I know Code::Blocks and I have some time till tomorrow when I may need to go to College.

The problem seems to be they assume the SDK and the project using it are on the same drive. I will have to change the sample app into two projects each.

Note, I don't have an Network Drive, so can only test it on a different drive letter.

Tim S
« Last Edit: December 10, 2007, 06:29:31 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Online stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Projectfiles on other drives
« Reply #8 on: December 10, 2007, 08:23:41 am »
I have uploaded two code::Blocks files to
http://www.savefile.com/projects/1039215
File is called jennicCBP.7z

I used $(#jennicsdk)=C:\Jennic\cygwin\jennic\SDK

Place the project jennicSDK.cbp into the folder C:\Jennic\cygwin\jennic\SDK it must be compiled first.
It creates a static library called mySDK that is used by your project file.

The second project is JN5139R1_Coordinator.cbp which I used as the example user project.

I tested it with SVN 3466 and 4717.

Tim S

For my Future Info:

The compiler name is jn51xx_compiler used CygWin as compiler to copy.
Compiler program settings are
Folder C:\Jennic\cygwin\ba-elf
ba-elf-gcc.exe
ba-elf-g++.exe
ba-elf-ld.exe
ba-elf-ar.exe
ba-elf-gdb.exe

Note: Linker did not like to use linker search directories to find the libraries; I had to place the relative or full path in the library name entry area.
« Last Edit: December 10, 2007, 08:45:02 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

MadMeX

  • Guest
Re: Projectfiles on other drives
« Reply #9 on: December 11, 2007, 06:51:28 pm »
Great THANKS for your help !!
and spending your time !

It works fine. :)

There is only one little problem left. If I compile the static-lib, ranlib shall be called, but there is no ranlib. My workaround is to rename the ba-elf-ranlib to ranlib, but how can I tell C:B, what name "ranlib" has ? I didn't found the field in the compiler-settings.

Thanks
MeX

Online stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Projectfiles on other drives
« Reply #10 on: December 12, 2007, 08:25:13 am »
I am not certain what "ranlib" does; but, did you check the standard location of

"Settings" -> "Compiler and Debugger"
Tab "Program" Tab "Program Files"

But, I do not see a spot for "ranlib".

Edit: You might wish to leave your settings alone and just add an Additional path of C:\Jennic\cygwin\ba-elf\ba-elf\bin it might work, don't have time to test.

Below, it a major different way to setup the compiler.
But, I figured out a second method of setting up the Compiler. Not sure if it will fix this issue or not.

Compiler Install directory is "C:\Jennic\cygwin\ba-elf\ba-elf"
Additional path is "C:\Jennic\cygwin\ba-elf\libexec\gcc\ba-elf\4.1.2"

Program files are
gcc.exe
g++.exe
ld.exe
ar.exe
gdb.exe

Search Directories
Compiler
C:\Jennic\cygwin\ba-elf\ba-elf\include
C:\Jennic\cygwin\ba-elf\lib\gcc\ba-elf\4.1.2\include

Linker
C:\Jennic\cygwin\ba-elf\ba-elf\lib

Tim S
« Last Edit: December 12, 2007, 08:27:56 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org