Results 1 to 8 of 8

Thread: C++ also available in Delphi?

  1. #1

    C++ also available in Delphi?

    I read somewhere that Borland C++ Builder comes with the Delphi compiler included, allowing developers to use Object Pascal code in their C++ Builder projects. Does it work the other way too? If there's a library that's written in C++ that I'd like to use in my project, but I'd like to compile it directly into the executable and gain the benefits of smart-linking and of not having to rely on an external DLL, could I do that?

    Mason

  2. #2

    C++ also available in Delphi?

    I think it can't be done :?
    From brazil (:

    Pascal pownz!

  3. #3

    C++ also available in Delphi?

    [pascal]
    function TExCrate: TDelphi; stdcall; external 'C++Builder';
    [/pascal]

    I heard there is special external reference string 'C++Builder'.

    example code
    http://www.mediafire.com/?3hczvvkcshd
    What you see is what you do.
    <br />
    <br />Sorry, I'm not English well.

  4. #4
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    C++ also available in Delphi?

    Yeah, Borland already did this with it's older versions of the development studio. First with Kylix 2 and/or 3 [size=9px](I know 3 had it, but unsure of it started wth 2 or not)[/size] then somewhere after doing that with Kylix they thought a 'do everything, super suite' under the title Delphi was such a wonderful idea they had to try to mix the two languages into one tool.

    Unfortunately it turned out to be less productive than originally visioned/advertised [size=9px](as I always understood the idea; you could code some forms with OP and others with C++ and it would somehow allow C++ and Object Pascal coders to work together on the exact same application. Interesting idea in theory.)[/size]

    I forget which versions of Delphi actually allow you to compile C++ code, but I know Delphi 7 has combined documentation for both the Object Pascal and C++ function syntax.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  5. #5

    C++ also available in Delphi?

    Well, considering that the only difference in the early versions of Delphi and C Builder was the tokenizer you could easily switch between languages from Delphi 2 to Delphi 7. When they performed the full migration to .NET (remember D7 could build .NET compatible applications but was not a .NET compiler in any sense of the word) in Delphi8+ this "feature" was lost within the actual compiler itself.

    The thing is, you don't need Delphi to do this if your using the .NET platform. You can simply bind the C/C++, C#, VB.NET, etc... extensions directly within your code. Just include the namespace and go. Of course, the problem in most cases is that the older C/C++ code won't build under the new .NET platform without a few minor tweaks.

  6. #6

    C++ also available in Delphi?

    Quote Originally Posted by jdarling
    The thing is, you don't need Delphi to do this if your using the .NET platform. You can simply bind the C/C++, C#, VB.NET, etc... extensions
    How is this possible? How does .NET know what C++ compiler I use?

  7. #7

    C++ also available in Delphi?

    step 1: compile c++ code into ".obj" files
    step 2: link it into the delphi app directly.
    step 3: profit!
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  8. #8

    Re: C++ also available in Delphi?

    [quote="masonwheeler"]I read somewhere that Borland C++ Builder comes with the Delphi compiler included, allowing developers to use Object Pascal code in their C++ Builder projects. Does it work the other way too? If there's a library that's written in C++ that I'd like to use in my project, but I'd like to compile it directly into the executable and gain the benefits of smart-]

    Afaik, yes, but only BCB in exactly the corresponding version (so not any C++ or even any BCB), and only when the C++ is specially crafted so that the interface doesn't use elements Delphi doesn't know (templates, operators maybe) and the classes are marked with the pureclass directive.

    Which often for non trivial cases means: No. (since rework is too complicated and/or creates a separate codebase)

    IIRC Rudy Velthuis homepage had some info on how to do this.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •