Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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? Smile

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 Very Happy

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 Smile ).

Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: RichPickToValue PROPOSAL
Next Topic: First use of SetVppLogName will call sOpenVppLog twice
Goto Forum:
  


Current Time: Fri Jul 18 08:19:43 CEST 2025

Total time taken to generate the page: 0.03898 seconds