Import and Import C accept var for path to lib

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Import and Import C accept var for path to lib

Post by IdeasVacuum »

It seems utterly daft that Import and Import C only accept a literal path to a lib, given that the lib could be in different places on different machines or OS versions etc.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Import and Import C accept var for path to lib

Post by skywalk »

Variables are unknown at Import time.
You can use #MyLib$ = "somelib.lib" and CompilerIf's.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Import and Import C accept var for path to lib

Post by IdeasVacuum »

Variables are unknown at Import time.
So that is the problem to be solved.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Import and Import C accept var for path to lib

Post by freak »

The imported libraries are combined into the final executable when you compile. Variables only have a value once the program is running. That is why only constant expressions are allowed.

It is like asking for variables to be allowed in IncludeFile statements.
quidquid Latine dictum sit altum videtur
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

[FIXED] Re: Import and Import C accept var for path to lib

Post by IdeasVacuum »

That makes sense :)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply