Author Topic: Relative Paths  (Read 3655 times)

0 Members and 1 Guest are viewing this topic.

Offline Qbee

  • Newbie
  • Posts: 27
    • View Profile
Relative Paths
« on: December 11, 2019, 06:26:46 pm »
Hello,

after trying a lot of codes from this forum and others I remarked that some will not run because they have problems to load resources (so I couldn't run Qwerkey's "Pi-in-the-sky" https://www.qb64.org/forum/index.php?topic=1969.0).

Actually I tried to start Ashish's OpenGL-3D-collection from github (https://github.com/AshishKingdom/QB64_OpenGL_Demos) and got an error after starting the first program. I changed the responsible relative path to an absolute path according to my installation. That solved the problem.

Now my question is, how QB64 resolves paths in programs ?


Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Relative Paths
« Reply #1 on: December 11, 2019, 06:33:39 pm »
QB64 doesn't resolve paths... QB64 programmers do.

Pete

When I die, I will be programmed into SCREEN 0. That way, I can still talk out of my ascii.
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

FellippeHeitor

  • Guest
Re: Relative Paths
« Reply #2 on: December 11, 2019, 06:38:50 pm »
In the Run menu, check the option that indicates the next compilation will output the executable to the same folder as the source file you’re compiling.

  [ You are not allowed to view this attachment ]  
« Last Edit: December 11, 2019, 06:40:44 pm by FellippeHeitor »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Relative Paths
« Reply #3 on: December 11, 2019, 06:39:12 pm »
Paths are relative to where the EXE is.

Go into the IDE and click the option to “Save EXE with Source”, and usually most of your path problems will disappear.  ;)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Qbee

  • Newbie
  • Posts: 27
    • View Profile
Re: Relative Paths
« Reply #4 on: December 11, 2019, 06:44:35 pm »
Thanks for the quick responses.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Relative Paths
« Reply #5 on: December 12, 2019, 07:22:46 am »
(so I couldn't run Qwerkey's "Pi-in-the-sky" https://www.qb64.org/forum/index.php?topic=1969.0).

In my defence, I even gave instructions on the "Save EXE to Source Folder" requirement.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Relative Paths
« Reply #6 on: December 12, 2019, 10:24:14 am »
Can someone remind me why this (Save EXE to SourceFolder) isn't the default option?

FellippeHeitor

  • Guest
Re: Relative Paths
« Reply #7 on: December 12, 2019, 10:54:28 am »
Because it has been added to the IDE long after QB64 was released. Default behavior has always been keeping binaries in QB64’s folder.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Relative Paths
« Reply #8 on: December 12, 2019, 11:23:52 am »
OK thanks Fellippe