Active Forums => QB64 Discussion => Topic started by: SMcNeill on December 15, 2021, 08:50:17 am
Title: DECLARE LIBRARY adding extra slashes to paths
Post by: SMcNeill on December 15, 2021, 08:50:17 am
[ This attachment cannot be displayed inline in 'Print Page' view ]
Title: Re: DECLARE LIBRARY adding extra slashes to paths
Post by: FellippeHeitor on December 15, 2021, 09:00:14 am
They're needed internally (first backslash is an escape char) - you'll notice the extra ",14" indicating the length of the string. That's internal compiler intermediate representation, no need to worry about it.
Title: Re: DECLARE LIBRARY adding extra slashes to paths
Post by: SMcNeill on December 15, 2021, 09:09:49 am
Except it's not finding the library which is right where it should be.
If mem.h is moved into the same directory as the EXE, it'll find it with a path of "./mem", but it won't find it if we just DECLARE LIBRARY "mem".
Something isn't pathing as it should be properly.
Title: Re: DECLARE LIBRARY adding extra slashes to paths
Post by: SMcNeill on December 15, 2021, 09:15:03 am
Notice the $EXEIcon has no problem finding the resource based off from where the .BAS file is located. (It's in the /chess folder.)
The call to DECLARE LIBRARY, however, needs a path to be in relation to QB64.EXE, rather than where the chess.BAS is located.
It doesn't appear that DECLARE LIBRARY is looking for files in relation to the source code's folder, even if Export EXE to Source Folder is selected in the options.
To sum up the odd behavior I'm seeing here:
".\mem" *will* look in the folder with the BAS file and find our header file. "mem" doesn't, though it seems like it should default to the same directory as the BAS file. ".\chessdat\mem" doesn't find the file, even though there's a copy of it inside the "chessdat" folder. For whatever reason, it can't find the relative folder and the file inside it.
Title: Re: DECLARE LIBRARY adding extra slashes to paths
Post by: FellippeHeitor on December 15, 2021, 10:33:54 am
Path resolution for declare blocks is a known issue, open at the repository as we speak. If you do any work on it before we do, let us know.
Title: Re: DECLARE LIBRARY adding extra slashes to paths
Post by: FellippeHeitor on December 15, 2021, 10:34:29 am
https://github.com/QB64Team/qb64/issues/7
Title: Re: DECLARE LIBRARY adding extra slashes to paths
Post by: SMcNeill on December 15, 2021, 12:23:42 pm
Path resolution for declare blocks is a known issue, open at the repository as we speak. If you do any work on it before we do, let us know.
My schedule more-or-less frees up starting around mid-January. If no one's dug into it before then, I'll see what I can find with it. I'd never had issues with the before, so wasn't aware it was an issue for us.
Title: Re: DECLARE LIBRARY adding extra slashes to paths
Post by: George McGinn on December 15, 2021, 12:29:34 pm
Couldn't you use a ../ like you can when you have an INCLUDE?
The code snippet is part of a SUB located in the /include directory, because it is used in 3 programs. the deleteWorkFiles.inc is used in many of my programs in the project directory.
I've never tried this with DECLARE LIBRARY statements before, but wouldn't it still resolve correctly?