Hi ALL!
In the build under windows "standalone" the paths are placed like this:
fbc
bin\
include\
lib\
And on linux paths are already arranged differently:
bin\fbc
include\freebasic\
lib\freebasic
Is it possible to programmatically find out the path to the included files? Can eat any macro about which I do not know?
PATH for include files
Re: PATH for include files
Usually such changes are hardcoded defines set with an #ifdef.
Re: PATH for include files
Probably best to not rely on those paths in your program. This should be something configured on a system or compiler level: they should already be in your path or passed as an option when compiling.
Re: PATH for include files
Thanks guys for answers! I thought that there might be some kind of macro or command. Okay, I have to set the hard path to this directory.
-
- Posts: 606
- Joined: Nov 28, 2012 1:27
- Location: CA, USA moving to WA, USA
- Contact:
Re: PATH for include files
Vanya
There are several descriptions for 'standard' or typical library organizations for Linux. Search the web. Each OS may still use some other organization.
Linux has several methods to locate or list paths.
Of course, you do have to go to the OS.
'which' is the most used command in console to find an executable, though it only searches in the established paths, and may not indicate when one is an alias.
'find' is much more complex, beyond a quick explanation.
'ldconfig' will control most linker paths and library caches. Study that command.
Simply:
Wrap the query in an open pipe or some other system command.
Library calls are are a little more difficult: each language may have its own method to locate its library.
In a console, enter 'env' to see the usual sets of paths - per this instance of your user.
For YOUR programs, develop your own standard, then soft-code locations and make a small utility function that tests/verifies your program got installed as you intended, or some other sensible way according to your expectations.
David
There are several descriptions for 'standard' or typical library organizations for Linux. Search the web. Each OS may still use some other organization.
Linux has several methods to locate or list paths.
Of course, you do have to go to the OS.
'which' is the most used command in console to find an executable, though it only searches in the established paths, and may not indicate when one is an alias.
'find' is much more complex, beyond a quick explanation.
'ldconfig' will control most linker paths and library caches. Study that command.
Simply:
will tell you where the fbc executable is located.which fbc
Wrap the query in an open pipe or some other system command.
Code: Select all
dim as integer fnum
dim as string result
fnum = freefile
open pipe "which fbc" for input as fnum
input #fnum, result
close fnum
print result
/usr/local/bin/fbc
In a console, enter 'env' to see the usual sets of paths - per this instance of your user.
For YOUR programs, develop your own standard, then soft-code locations and make a small utility function that tests/verifies your program got installed as you intended, or some other sensible way according to your expectations.
David
Re: PATH for include files
Thank you speedfixer , I will definitely try this method.
Re: PATH for include files
(traditional unix has this in the "hier" manpage, short for hierarchy, try "man hier")speedfixer wrote: There are several descriptions for 'standard' or typical library organizations for Linux. Search the web. Each OS may still use some other organization.