RobT has asked for the wisdom of the Perl Monks concerning the following question:

This is a great site for Perl information. I wished I would have found it a couple of years ago. At any rate I have a question about building C programs that imbed Perl. The web page has a wealth of information. BUT it is a little Unix oriented... Not that I have anything against Unix (I would rather use it) but I'm on a WinNT development platform. Using Active Perl for WinNT. The current compiler I'm using is DJGPP (WinNT implementation of gcc compiler) and I am trying to build the interpet.c program in the examples. I get the following error:
D:\devsoft\ccode\c>gcc -o interp.exe d:/devsoft/ccode/c/interp.c --ve +rbose -lm -I d:/devsoft/perl /lib/CORE Reading specs from d:/djgpp/lib/gcc-lib/djgpp/2.952/specs gcc version 2.95.2 19991024 (release) d:/djgpp/lib/gcc-lib/djgpp/2.952/cpp.exe -lang-c -v -I d:/devsoft/per +l/lib/CORE -D__GNUC__=2 -D__GN UC_MINOR__=95 -Dunix -Di386 -DGO32 -DDJGPP=2 -DMSDOS -D__unix__ -D__i3 +86__ -D__GO32__ -D__DJGPP__=2 -D__MSDOS__ -D__unix -D__i386 -D__GO32 -D__DJGPP=2 -D__MSDOS -Asystem( +unix) -Asystem(msdos) -Acpu(i3 86) -Amachine(i386) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i3 +86__ -D__tune_pentium__ -imacr os d:/djgpp/lib/../include/sys/version.h -remap d:/devsoft/ccode/c/int +erp.c d:/djgpp/tmp\cc8Kbifp.i GNU CPP version 2.95.2 19991024 (release) (80386, BSD syntax) #include "..." search starts here: #include <...> search starts here: d:/devsoft/perl/lib/CORE d:/djgpp/include d:/djgpp/lib/gcc-lib/djgpp/2.952/include d:/djgpp/include End of search list. The following default directories have been omitted from the search pa +th: $DJDIR/lang/cxx $DJDIR/lib/gcc-lib/djgpp/2.952/../../../../djgpp/include End of omitted list. In file included from d:/devsoft/ccode/c/interp.c:12: d:/devsoft/perl/lib/CORE/perl.h:3317: patchlevel.h: No such file or di +rectory (ENOENT)
From what I see the patchlevel.h file does exist in the perl/lib/CORE path. I know that DJGPP since it is DOS based has strict requirements on long filenames. Anyone ever tried this?? Would it be better to try compilation using M$ Visual C++??

Any help would be greatly appreciated.

RobT

Replies are listed 'Best First'.
Re: Embedding Perl in C Programs
by Asim (Hermit) on Apr 16, 2001 at 18:39 UTC
    Would it be better to try compilation using M$ Visual C++??

    MUCH better -- ActivePerl was built with Visual C++ in mind, and is required to build it correctly, last I heard. If you want to build your own Perl, I recommend either going with MSVC++, or going to the Cyngus site and using their Gnu-on-win32 tools, as I know they regularly compile Perl with those tools (and the compiler's Open Source, too.)

    ----Asim, known to some as Woodrow.