http://qs321.pair.com?node_id=385373


in reply to Re: Perl & borland 5.5 C/C++ Compiler
in thread Perl & borland 5.5 C/C++ Compiler

With all due respect the question was not related to cl.exe or using Microsoft Visual Studio tools it was about compiling an exe with a perl interpreter embedded with the Borland C++ Free Command Line tools. It may work with cl.exe but not all of us have access to Visual Studio.

In order to help I went and downloaded Perl 5.8.5 stable.tar.gz and compiled it with the Borland C++ Free Command Line tools with the help of the documentation in README.win32. That was mostly ok except the reliance on rcl.exe was not mentioned in README.win32 as far as I can tell. This tool can be obtained in the MS Platform SDK and seems to be in Visual Studio.NET and Microsoft VB 6 (98)

When I went to compile the authors code I still had problems. Even making sure that I checked the build options with

C:\>perl -MExtUtils::Embed -e ccopts -e ldopts -tWD -L"c:\perl\lib\CORE" -L"C:\borland\bcc55\lib" -Gn C:\perl\lib\ +CORE\perl5 8.lib C:\borland\bcc55\lib\import32.lib C:\borland\bcc55\lib\cw32mti.l +ib -O2 -D_RTLDLL -DWIN32 -DHAVE_DES_FCRYPT -D_MT -D__USELOCALES__ -D_WIN +32_WINNT=0 x0410 -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -I"C:\perl\lib\CORE +" C:\>

Now the -Gn option gives an error so I removed that but I get the following still when I compile

C:\>bcc32 -tWD -Ic:\perl\lib\core -L"c:\perl\lib\CORE" -L"C:\borland +\bcc55\lib " C:\perl\lib\CORE\perl58.lib C:\borland\bcc55\lib\import32.lib C:\bo +rland\bcc5 5\lib\cw32mti.lib perl_inc.c Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland perl_inc.c: Error E2303 c:\perl\lib\core\win32.h 312: Type name expected Error E2293 c:\perl\lib\core\win32.h 411: ) expected Error E2293 c:\perl\lib\core\perlio.h 105: ) expected Error E2293 c:\perl\lib\core\perlio.h 106: ) expected Error E2293 c:\perl\lib\core\perlio.h 108: ) expected Error E2293 c:\perl\lib\core\perlio.h 110: ) expected Error E2141 c:\perl\lib\core\perlio.h 111: Declaration syntax error Error E2293 c:\perl\lib\core\perlio.h 112: ) expected Error E2293 c:\perl\lib\core\perlio.h 214: ) expected Error E2293 c:\perl\lib\core\perlio.h 227: ) expected Error E2303 c:\perl\lib\core\perlio.h 339: Type name expected Error E2303 c:\perl\lib\core\perlio.h 342: Type name expected Error E2293 c:\perl\lib\core\perlio.h 345: ) expected Error E2293 c:\perl\lib\core\perlio.h 354: ) expected Error E2293 c:\perl\lib\core\perlio.h 358: ) expected Error E2293 c:\perl\lib\core\perlio.h 365: ) expected Error E2293 c:\perl\lib\core\perlio.h 370: ) expected Error E2303 c:\perl\lib\core\win32iop.h 73: Type name expected Error E2303 c:\perl\lib\core\win32iop.h 74: Type name expected Error E2303 c:\perl\lib\core\win32iop.h 77: Type name expected Error E2303 c:\perl\lib\core\win32iop.h 133: Type name expected Error E2238 c:\perl\lib\core\perl.h 1775: Multiple declaration for 'AV +' Warning W8017 c:\perl\lib\core\dosish.h 142: Redefinition of 'Stat' is + not identical Error E2257 c:\perl\lib\core\perl.h 2074: , expected Error E2257 c:\perl\lib\core\perl.h 2075: , expected Error E2257 c:\perl\lib\core\perl.h 2076: , expected Error E2228 c:\perl\lib\core\perl.h 2076: Too many error or warning me +ssages *** 26 errors in Compile ***

Now I am tired but I cursory look into 'c:\perl\lib\core\win32.h' didn't reveal anything blatantly erroneous but I could be wrong. I also know that the authors code should work because you have tested it with Visual Studio and I tested it on FreeBSD 4.8-STABLE with perl 5.8.3. So maybe there is breakage in building with Borland bcc32.exe? I beleive bcc32.exe is a compiler that "is supported" for building perl.

You will note however that the errors that I get are very similar if not the same as what Nalina was getting

Replies are listed 'Best First'.
Re^3: Perl & borland 5.5 C/C++ Compiler
by tachyon (Chancellor) on Aug 24, 2004 at 12:31 UTC

    Actually my suggestion to use cl.exe is possibly valid, but simply based on the fact that IMHO it works better so I use it. With cl.exe come the header and library files you need to link apps under windows. These are of course the M$ versions. When you get BCC you get Borlands take on these files, which IME have issues. Windows has issues period, but you get less using the M$ native compiler, headers and libs.

    *However* if you had read my post properly you would have noted that the minimum flags case includes -DWIN32 which you fail to do......if I leave it out it chokes as we will be trying to compile non win32 code (well skipping the kludges - or whatever). The errors are slightly different but I suggest it might work if you add that define.

      I DID read your post

      Thanks :-) now I know -DWIN32 is important

      C:\>bcc32 -tWD -DWIN32 -I"c:\perl\lib\CORE" -L"C:\borland\bcc55\lib" + C:\perl\ lib\CORE\perl58.lib C:\borland\bcc55\lib\import32.lib C:\borland\bcc55 +\lib\cw32m ti.lib perl_inc.c Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland perl_inc.c: Warning W8070 perl_inc.c 14: Function should return a value in functio +n main Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland C:\>
      But you didnt say anywhere in your post that this was a problem you just added it silently ;-)
      # Essentially we pass all the same -D defines that perl was built with + plus # the include dir to find the perl headers and the perl56.lib binary w +hich is # what where the real functions defined in the headers are found and w +hat we # will be linking against........
      And this is what I did. There is no -DWIN32 in: perl -MExtUtils::Embed -e ccopts -e ldopts Which is what everyone was saying Nalina use. I personally dont think that it is possible for everyone to use cl.exe

      ps Please stop down voting me now. I was only trying to help. There was no malice.

        First I actually gave you a ++ as your point was perfectly valid and I was far to lazy to try to get Borland to work (been there before). Someone downvoted every post on this node for whatever reason (just noted on update). Not my malice I'm afraid. But just to pick nits about the define. It is there, and must be there in your Borland compile. I have resorted to syntax highlighing ;-)

        C:\>perl -MExtUtils::Embed -e ccopts -e ldopts
        -tWD  -L"c:\perl\lib\CORE"  -L"C:\borland\bcc55\lib" -Gn  C:\perl\lib\CORE\perl58.lib 
        C:\borland\bcc55\lib\import32.lib C:\borland\bcc55\lib\cw32mti.lib
        -O2 -D_RTLDLL -DWIN32 -DHAVE_DES_FCRYPT -D_MT -D__USELOCALES__ -D_WIN32_WINNT=0
        x0410 -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS  -I"C:\perl\lib\CORE"
        C:\>
        
        

        cheers

        tachyon