C++ to PB

Just starting out? Need help? Post your questions and find answers here.
Patrice Terrier
User
User
Posts: 21
Joined: Sun Aug 10, 2003 11:45 am
Location: France
Contact:

C++ to PB

Post by Patrice Terrier »

Does there is a utility to convert a C++ header (external DLL declaration) into PureBasic?
Patrice Terrier
objreader@gmail.com
http://www.objreader.com
Addon: WinLIFT (Skin Engine), GDImage (Graphic library), ObjReader (3D engine)
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: C++ to PB

Post by Kuron »

Not that I am aware of, but that does not mean it doesn't exist. It would be a very handy thing.
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: C++ to PB

Post by Kuron »

I just browsed http://purearea.net/pb/english/index.htm and did not see anything that stood out.
Best wishes to the PB community. Thank you for the memories. ♥️
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: C++ to PB

Post by AZJIO »

PureBasic\SDK\Header Converter\Header Converter.exe
Patrice Terrier
User
User
Posts: 21
Joined: Sun Aug 10, 2003 11:45 am
Location: France
Contact:

Re: C++ to PB

Post by Patrice Terrier »

Thank you for the answers.

Unfortunatly I couldn't get "Header Converter.exe" to work with my C++ Visual Studio 2022 headers.
Patrice Terrier
objreader@gmail.com
http://www.objreader.com
Addon: WinLIFT (Skin Engine), GDImage (Graphic library), ObjReader (3D engine)
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Re: C++ to PB

Post by Inner »

Patrice Terrier wrote: Fri Nov 17, 2023 1:48 pm Thank you for the answers.

Unfortunatly I couldn't get "Header Converter.exe" to work with my C++ Visual Studio 2022 headers.
I couldn't get it to convert a C header or maybe we're not understanding "Header Converter.exe" and it's intended purpose, it might be for just general purpose header conversions that doesn't take into account the nuances of more complex headers and it's bailing out, as I've given it a header output folders not sure what 'validation files path' is in aide of at a guess it might be something to cross check structures or what have you are of the right sizes, but as I said I've not been able to get it to output anything, is the source available for header converter.exe?
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: C++ to PB

Post by Fred »

It's a very old tool which was useful at time to mass convert constants and structs, but it's probably not working anymore with current headers. I will remove it from the SDK
User avatar
mk-soft
Always Here
Always Here
Posts: 6204
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: C++ to PB

Post by mk-soft »

Fred wrote: Thu Nov 30, 2023 3:23 pm It's a very old tool which was useful at time to mass convert constants and structs, but it's probably not working anymore with current headers. I will remove it from the SDK
Why remove it, you can still use it for old header files.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: C++ to PB

Post by idle »

If people insert beer I will write a header converter, I have already scoped out a solution a few months ago that will work but I've not had the motivation to do it and I was waiting to see where Fred's heading with 6.10 but I've come to the conclusion an auto importer would actually be more beneficial than including c directly as it requires a full c compiler suite or at least the right system headers. It will take around 6 to 8 weeks to do. But will probably get results in a week it's dealing with edge cases and ambiguities that will take time as you've got to find them.
User avatar
mk-soft
Always Here
Always Here
Posts: 6204
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: C++ to PB

Post by mk-soft »

@Idle,
Where should I send the beer :?: 8)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: C++ to PB

Post by idle »

mk-soft wrote: Thu Nov 30, 2023 8:19 pm @Idle,
Where should I send the beer :?: 8)
Pour it in the funnel that's attached to the hose in my mouth.
normeus
Enthusiast
Enthusiast
Posts: 470
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: C++ to PB

Post by normeus »

Beer+ ( generic beer, unless there is a specific place/brand for said pitcher/Barrel of beer)
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Re: C++ to PB

Post by Inner »

idle wrote: Thu Nov 30, 2023 8:17 pm If people insert beer I will write a header converter, I have already scoped out a solution a few months ago that will work but I've not had the motivation to do it and I was waiting to see where Fred's heading with 6.10 but I've come to the conclusion an auto importer would actually be more beneficial than including c directly as it requires a full c compiler suite or at least the right system headers. It will take around 6 to 8 weeks to do. But will probably get results in a week it's dealing with edge cases and ambiguities that will take time as you've got to find them.
now that would be of immense help I'm (as you might know) forever trying to 'Purify' all sorts of .libs/.dlls the most time consuming part is converting .h files their a nightmare when you don't exactly know what a type a variable is supposed to be, sometimes it's like a treasure hunt trying to nail down what someone has typedef as lollipop only to discover an hour later that it's simply at unsigned int :x

if I understand 6.10 direction properly it sounds like when I've simplified it down to being just able to include .lib files as is, which will still require some sort of .h translation for structs, constants, enums and so on anyway, I've thought about it myself from time to time over the years I left it for a more skilled programmer to do as it's quite an involved project which requires a god like understanding of C.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: C++ to PB

Post by idle »

Inner wrote: Fri Dec 01, 2023 2:23 am
idle wrote: Thu Nov 30, 2023 8:17 pm If people insert beer I will write a header converter, I have already scoped out a solution a few months ago that will work but I've not had the motivation to do it and I was waiting to see where Fred's heading with 6.10 but I've come to the conclusion an auto importer would actually be more beneficial than including c directly as it requires a full c compiler suite or at least the right system headers. It will take around 6 to 8 weeks to do. But will probably get results in a week it's dealing with edge cases and ambiguities that will take time as you've got to find them.
now that would be of immense help I'm (as you might know) forever trying to 'Purify' all sorts of .libs/.dlls the most time consuming part is converting .h files their a nightmare when you don't exactly know what a type a variable is supposed to be, sometimes it's like a treasure hunt trying to nail down what someone has typedef as lollipop only to discover an hour later that it's simply at unsigned int :x

if I understand 6.10 direction properly it sounds like when I've simplified it down to being just able to include .lib files as is, which will still require some sort of .h translation for structs, constants, enums and so on anyway, I've thought about it myself from time to time over the years I left it for a more skilled programmer to do as it's quite an involved project which requires a god like understanding of C.
I don't know what Fred's doing yet but I've recently come to the conclusion that trying to import c libs with my hacks doesn't always work which I think is a conflict between the c system headers what gcc expects vs mingw llvm, so we would need a copy of the c headers and c system headers for that to work. I've found a couple of ways to get the required information to do the job but I'm still not 100% decided on which way to go. One needs a llvm install and the other is a stand alone tool based on llvm tools. It's output isn't exactly human friendly to read but it'll be fine in code
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Re: C++ to PB

Post by Inner »

idle wrote: Fri Dec 01, 2023 4:26 am
Inner wrote: Fri Dec 01, 2023 2:23 am
idle wrote: Thu Nov 30, 2023 8:17 pm If people insert beer I will write a header converter, I have already scoped out a solution a few months ago that will work but I've not had the motivation to do it and I was waiting to see where Fred's heading with 6.10 but I've come to the conclusion an auto importer would actually be more beneficial than including c directly as it requires a full c compiler suite or at least the right system headers. It will take around 6 to 8 weeks to do. But will probably get results in a week it's dealing with edge cases and ambiguities that will take time as you've got to find them.
now that would be of immense help I'm (as you might know) forever trying to 'Purify' all sorts of .libs/.dlls the most time consuming part is converting .h files their a nightmare when you don't exactly know what a type a variable is supposed to be, sometimes it's like a treasure hunt trying to nail down what someone has typedef as lollipop only to discover an hour later that it's simply at unsigned int :x

if I understand 6.10 direction properly it sounds like when I've simplified it down to being just able to include .lib files as is, which will still require some sort of .h translation for structs, constants, enums and so on anyway, I've thought about it myself from time to time over the years I left it for a more skilled programmer to do as it's quite an involved project which requires a god like understanding of C.
I don't know what Fred's doing yet but I've recently come to the conclusion that trying to import c libs with my hacks doesn't always work which I think is a conflict between the c system headers what gcc expects vs mingw llvm, so we would need a copy of the c headers and c system headers for that to work. I've found a couple of ways to get the required information to do the job but I'm still not 100% decided on which way to go. One needs a llvm install and the other is a stand alone tool based on llvm tools. It's output isn't exactly human friendly to read but it'll be fine in code
Ideally the most perfect path from one perspective is not to need converting anything at all just include use and abuse :shock: :o :D I thought when I heard the news that there was a C backend to PB that was the general goal post PB was aiming at, it'd be nice for it to be the case though as one man or is it 3 now cannot be all things to all people for all features, but being able to drop sdks into PB from whatever source they might come from would be the ideal solution, realizing of course that this would make one of my own projects defunct (RML) but I'd rather that loss and more expandable language. I'm a bit jealous of C/C#/C++ they get all the fun toys but I'm also not willing to put up with the mind numbing headaches those languages would ensue, besides PB is better than those languages :P
Post Reply