Home » U++ Library support » U++ Core » How to know if a package is loaded
Re: How to know if a package is loaded [message #29506 is a reply to message #29503] |
Mon, 25 October 2010 10:00   |
|
luzr wrote on Mon, 25 October 2010 08:37 |
koldo wrote on Sun, 24 October 2010 16:17 | How a cpp source can know if a package is loaded?
Imagine a general purpose library that includes some feature for GridCtrl package. If the programmer uses this package but s/he does not include GridCtrl, there will be a linking error.
|
Does not it give a nice and simple answer? 
BTW, the case described above is a bug of the library - it should have add "GridCtrl" in its 'uses'.
Mirek
|
We can try to ask once more, being nicer this time 
Anyway I think what Koldo meant (and me too) is that sometimes it is better to make some extension voluntary. GridCtrl is not the best example, but imagine you would like to provide some extension of the stuff in MySql package - then adding it into your package would make the whole thing unusable on computers which don't have the mysql library installed. But if you could detect if the MySql is already used, than it would be safe to use it. Otherwise, you would just #ifdef out the MySql related parts and everyone would be happy (especially linker ).
Honza
|
|
|
Goto Forum:
Current Time: Fri Jul 18 08:19:43 CEST 2025
Total time taken to generate the page: 0.03898 seconds
|