View previous topic :: View next topic |
Author |
Message |
MrTact
Joined: 09 Nov 2005 Posts: 12
|
Posted: Sat Dec 30, 2006 10:08 am Post subject: -od path should be passed to linker, as well? |
|
|
It seems to me I have been able to link .obj files created in the directory I specify with the -od switch without also adding that dir to LIBPATH. Now suddenly, that is not the case, and I wonder whether I broke that with my tinkering, or if perhaps I just hallucinated it.
If that isn't the expected behavior, then can I suggest perhaps it should be? It only makes sense that wherever you tell the compiler to create object files is also a place you want the linker to look for them.
TimK |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Sat Dec 30, 2006 3:56 pm Post subject: Re: -od path should be passed to linker, as well? |
|
|
MrTact wrote: | It seems to me I have been able to link .obj files created in the directory I specify with the -od switch without also adding that dir to LIBPATH. Now suddenly, that is not the case, and I wonder whether I broke that with my tinkering, or if perhaps I just hallucinated it.
If that isn't the expected behavior, then can I suggest perhaps it should be? It only makes sense that wherever you tell the compiler to create object files is also a place you want the linker to look for them. |
LIBPATH is where the linker looks for libraries and not your object files. The path to each object file is specified in the command line given to OptLink. What does your <project>.ksp file look like? _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
MrTact
Joined: 09 Nov 2005 Posts: 12
|
Posted: Thu Jan 11, 2007 1:12 am Post subject: |
|
|
OK, having had a little time to come back to this, I probably broke this with my long filenames patch. (So don't apply it until I have a chance to fix it!
It looks like I'm not getting an object file for any source file that has a long filename. (The filename only -- paths with long directory names don't seem to be a problem.) Which, naturally, would explain why I'm getting link errors -- can't link to an object that doesn't exist!
With luck, by the time you read this I'll have fixed it . . .
TimK |
|
Back to top |
|
|
MrTact
Joined: 09 Nov 2005 Posts: 12
|
Posted: Wed Jan 17, 2007 9:18 pm Post subject: |
|
|
I found a solution for this. The problem was, in fact, that any source file name longer than 8 characters was subject to the shortening effect, so foobarbaz.d would become FOOBAR~1.D. For obvious reasons, this prevented Build from generating correct object files.
The fix was to strip off the filename before passing the path to GetShortPathname and then re-append it afterward. I have an updated patch that does this, but with the ticket assigned to you, I don't seem to be able to modify it anymore. Can you put it into a state where I can add a comment & attach the updated patch? If that proves too troublesome I can simply write another ticket.
TimK |
|
Back to top |
|
|
MrTact
Joined: 09 Nov 2005 Posts: 12
|
Posted: Thu Feb 01, 2007 1:14 pm Post subject: |
|
|
OK, I'm a nitwit. I couldn't update the ticket because I wasn't logged in! I just attached the updated patch to ticket #45. |
|
Back to top |
|
|
|