
Namespaces are halting me!
Namespaces are halting me!
Ive been desperately trying to find various DLLs to work with PB but all use namespaces and so I cant really try to interface them. All I would like is if PB had support for namespaces (just when dealing with external DLLs) and I could probably get a multitude of them working. Why does the world have to be so.... C++? 

Mark my words, when you least expect it, your uppance will come...
what *are* namespaces?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
What the hell?>actually, i've never been much in seven of nine
You wish
Well , not that pretty though..

Namespaces are an OO feature of C++ and the like - they are a measure to prevent two libs clashing when both libs have a command with the same name. An example would be DLL1 and DLL2 - imagine these both had a command called GetString() or something like that. If you typed GetString() into your prog that was using both these libs, bad things would happen because it wouldnt know which DLL you were referring to. Therefore the DLL's use namespaces - in C++ it would look like DLL1::GetString() and DLL2::GetString(). this way it knows which you mean and problems are avoided.what *are* namespaces?
Basically every DLL Ive found uses namespaces and without an equivalent in PB, they cant really be used. For example in the Irrlicht 3d engine it uses the namespaces irr::, irr::core, irr::gui, irr::io, irr::scene and irr:video whereby classes are contained within these namespaces.
Its only a small thing and I just thought PB might benefit from the compatibility.
Mark my words, when you least expect it, your uppance will come...
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
it's heaven of nine 
if it only would be seven of mine
oh darn, getting poetic on my age...

if it only would be seven of mine

oh darn, getting poetic on my age...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
As a work around, if you desperately need access to a library, I suppose someone could write a C++ wrapper to call the namespace functions and export non-namespace functions.
And if someone fluent in C++ provides that for you, I think MS provides C++ compilers free to download (I don't know if they are .net, or if namespaces requires .net). I imagine, with one program in hand, as a template, others would not be too difficult.
And if someone fluent in C++ provides that for you, I think MS provides C++ compilers free to download (I don't know if they are .net, or if namespaces requires .net). I imagine, with one program in hand, as a template, others would not be too difficult.