Announcement

Collapse
No announcement yet.

Statically Link with a C LIB

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Statically Link with a C LIB

    I have a client who wants to make his product available for use with PowerBASIC for Windows. The outstanding question is can PowerBASIC statically link with a C LIB?

    Thanks,

    Rich


    ------------------
    _____________________________________________________________________________________
    It's hard when you're up to your armpits in alligators to remember you came here to drain the swamp.
    President Reagan
    February 10, 1982

  • #2
    No, LIB files are not a 100% standardized file format. For example, Microsoft C and Borland C use different, non-compatible LIB files.

    You'd need to use the header file (usually *.H) not the LIB file, and convert the header syntax to PowerBASIC. It's usually not hard, and you can get help on this BBS.

    -- Eric


    ------------------
    Perfect Sync Development Tools
    Perfect Sync Web Site
    Contact Us: mailto:[email protected][email protected]</A>

    [This message has been edited by Eric Pearson (edited October 12, 2001).]
    "Not my circus, not my monkeys."

    Comment


    • #3
      As Eric says, there is no standard .LIB format. In general, the only
      thing you can use a .LIB with is the exact same compiler as produced
      it, which is probably going to be a C compiler, as other languages
      tend not to support .LIBs these days.

      The standard library format these days is the .DLL, or dynamic link
      library. Like virtually every other Windows language, the PowerBASIC
      for Windows compilers do provide support for DLLs.


      ------------------
      Tom Hanlin
      PowerBASIC Staff

      Comment


      • #4
        Originally posted by Eric Pearson:
        No, LIB files are not a 100% standardized file format. For example, Microsoft C and Borland C use different, non-compatible LIB files.

        You'd need to use the header file (usually *.H) not the LIB file, and convert the header syntax to PowerBASIC. It's usually not hard, and you can get help on this BBS.

        -- Eric

        Yes, since I use both C++ Builder and "Visual" C++, I am well aware they are not standardized. I was wondering if PowerBASIC supported any format.

        Rich

        ------------------


        [This message has been edited by Rich Brockway (edited October 13, 2001).]
        _____________________________________________________________________________________
        It's hard when you're up to your armpits in alligators to remember you came here to drain the swamp.
        President Reagan
        February 10, 1982

        Comment


        • #5
          Originally posted by Tom Hanlin:
          [...]is probably going to be a C compiler, as other languages
          tend not to support .LIBs these days.[...]
          What about Assembly? MASM for example does support lib's.

          What I'd love to see, is a Format, wich let me get rid of dll's. lib support or a new PowerBASIC format (.pib ) would be really nice. Just imagine: an ezgui App w/out ezgui dll...

          ------------------
          Sven Blumenstein
          IT-Trainee at DECOMA Exterior Systems, Germany
          E-Mail: mailto:[email protected][NOSPAM]cycos.net[email protected][NOSPAM]cycos.net</A>
          Programming with: PB/DLL, MASM, VB, VC++, LCC, VBA, WML

          [This message has been edited by Sven Blumenstein (edited October 13, 2001).]

          Comment


          • #6
            Real Men and Real Programmers use DLLs.

            MCM
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              Rick,

              The problem is that PowerBASIC uses a wider range of data types
              than C/C++ so compatibility would be a problem even if PowerBASIC
              did support libraries.

              The DLL route would bve the easiest way to approach the problem
              and your customer could make a useful multilanguage DLL that could
              be used in any language that supports the industry standard DLL
              format.

              The last choice would be to rewrite the library module in PowerBASIC
              but this may not suit your customer's requirements.

              Regards,

              [email protected]

              PS : Michael,

              I thought REAL men coded in HEX.

              ------------------
              hutch at movsd dot com
              The MASM Forum

              www.masm32.com

              Comment


              • #8
                Real men use PowerBASIC. End of story.

                ------------------
                Lance
                PowerBASIC Support
                mailto:[email protected][email protected]</A>
                Lance
                mailto:[email protected]

                Comment


                • #9
                  I thought REAL men coded in HEX
                  That's true only under MS-DOS.

                  MCM
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment


                  • #10
                    Michael,

                    Code:
                    ; D:\MASM32\THEGUN\SETTINGS\Gunstub.exe  96 bytes
                      
                    00000000: 4D 5A 90 00 03 00 00 00 - 04 00 00 00 FF FF 00 00
                    00000010: B8 00 00 00 00 00 00 00 - 40 00 00 00 00 00 00 00
                    00000020: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
                    00000030: 01 00 00 00 00 00 00 00 - 00 00 00 00 B8 00 00 00
                    00000040: 0E 1F BA 0E 00 B4 09 CD - 21 B8 01 4C CD 21 54 68
                    00000050: 65 47 75 6E 20 69 73 20 - 77 69 6E 33 32 0D 0A 24
                    00000060:
                    I still write DOS stub files for 32 bit PE programs in HEX if I
                    need to run something non standard.

                    I go half way with Lance with the view that REAL programmers
                    write in PowerBASIC.

                    Regards,

                    [email protected]

                    ------------------
                    hutch at movsd dot com
                    The MASM Forum

                    www.masm32.com

                    Comment


                    • #11
                      Would love to see possibility to use some sort of encrypted include files
                      in the future. Would enable us to write "commercial" code for PB developers,
                      without having to use DLL way. "One code - one EXE" is nice, IMHO. Could
                      mean a whole new industry growing up around PowerBasic compilers..

                      Hm, so what do real women use..?


                      ------------------

                      Comment


                      • #12
                        Hm, so what do real women use..?
                        Mostly they use Real Men.
                        Michael Mattias
                        Tal Systems (retired)
                        Port Washington WI USA
                        [email protected]
                        http://www.talsystems.com

                        Comment


                        • #13
                          Hmmm.... what an interesting side-effect.

                          ------------------
                          Lance
                          PowerBASIC Support
                          mailto:[email protected][email protected]</A>
                          Lance
                          mailto:[email protected]

                          Comment


                          • #14
                            Logically this means that Real Women Basically like Power, half the time.

                            Peter.


                            ------------------
                            [email protected]
                            [email protected]

                            Comment

                            Working...
                            X