-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Include" & "Declare Library" resolves file path differently #124
Comments
Hey :) Not trying to ignore this, I've just had lots of work stuff recently, hopefully it should slow down in the coming week. That said I agree the behavior isn't great, it's a bad interaction with the fact that anything from There may be an argument that the current behavior is correct though, I'm not really sure. |
I like to keep my source code and libraries organized. Everything like libraries (.bi .bm .h .a) go into an include directory and the main program /demos source code stay at the top level. Something like below.
Now the problem here is QB64 does not like this and I have to end up doing the following:
Now, all these workarounds seem wrong to me. I believe is not something we should be forced to do. |
You should have a look into my QB64GuiTools project. It's organized in the way you suggest above.
If you just look into the files, you'll see that I address the global includes assuming the qb64 folder as root, hence starting my path at $INCLUDE/DECLARE LIBRARY with QB64GuiTools, while for the local includes the program/app folder is assumed as root, as you would expect, just use it without the That works perfect for me on Windows, doesn't matter if I compile to the qb64 folder or to the source folder. Back the days when I started GuiTools and tried to organize the files of the ever growing project, I also had problems, until I waived to the damn '.\', that seems to cause the real problem. |
I see that you've used a bunch of |
Awesome library! Ok. Here is what I figured out after using it. I read your note in README.md. Everything worked as expected as long as I kept the I use GitHub extensively. On a Windows machine I let GitHub Desktop put my code to a location it wants. This may not be the QB64 directory. Similarly, on Linux I want to be able to |
Ah, now I get the point, so you won't neccessarily the QB64 folder being the root for all relative paths, but any independent location on your drive, trying to "inject" that "base/root" location using Well, that might be tricky to find the cause, it's nearly 800 lines in source\qb64.bas (39xx to 47xx) not counting the SUB/FUNC calls involved. |
Correct. I know this may not be a top priority item but I think the logic how Now that you have given me a place to look at, I'll try to dig and see if I can find something when I get some time. 🙂 |
I also noticed that |
Correct. I noticed the |
Both
Include
andDeclare Library
take file names. However, the way they resolve the path is different and this should not be the case.For example, take the following case for
Include
that works perfectly. Note the directories..\incmain.bas
.\include\include1.bi
.\include\include2.bi
Now, a similar case but with
Declare Library
that throws the error: Library not found.\libmain.bas
.\include\lib1.bas
.\include\lib2.h
The issue is the same even with static libraries (
Declare Static Library
).I understand that when using
Declare Dynamic Library
DLLs need to be close to the executable for it to work. However, the behavior for header based and static libraries seem so wrong.Attaching test code test.zip.
Related? QB64Team/qb64#7
The text was updated successfully, but these errors were encountered: