# Have a look at the options perl was built with (we don't need all of them!)...... C:\>perl -MExtUtils::Embed -e ccopts -e ldopts -nologo -nodefaultlib -debug -opt:ref,icf -libpath:"D:\Perl\lib\CORE" -machine:x86 D:\Perl\lib\CORE\perl56.lib D:\Perl\lib\CORE\oldname s.lib D:\Perl\lib\CORE\kernel32.lib D:\Perl\lib\CORE\user32.lib D:\Perl\lib\CORE\gdi32.lib D:\Perl\lib\CORE\winspool.lib D:\Perl\lib\CORE\co mdlg32.lib D:\Perl\lib\CORE\advapi32.lib D:\Perl\lib\CORE\shell32.lib D:\Perl\lib\CORE\ole32.lib D:\Perl\lib\CORE\oleaut32.lib D:\Perl\lib\C ORE\netapi32.lib D:\Perl\lib\CORE\uuid.lib D:\Perl\lib\CORE\wsock32.lib D:\Perl\lib\CORE\mpr.lib D:\Perl\lib\CORE\winmm.lib D:\Perl\lib\CORE \version.lib D:\Perl\lib\CORE\odbc32.lib D:\Perl\lib\CORE\odbccp32.lib D:\Perl\lib\CORE\msvcrt.lib -nologo -O1 -MD -Zi -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_RE ADFIX -I"D:\Perl\lib\CORE" # here is the code C:\>type interp.c #include /* from the Perl distribution */ #include /* from the Perl distribution */ static PerlInterpreter *my_perl; /* The Perl interpreter */ int main(int argc, char **argv, char **env) { my_perl = perl_alloc(); perl_construct(my_perl); perl_parse(my_perl, NULL, argc, argv, (char **)NULL); perl_run(my_perl); perl_destruct(my_perl); perl_free(my_perl); } # Here are the flags that I passed to make it compile # 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 which is # what where the real functions defined in the headers are found and what we # will be linking against........ C:\>cl.exe -nologo -MD -Zi -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX -I"D:\Perl\lib\CORE" D:\Perl\lib\CORE\perl56.lib -o interp.exe interp.c interp.c # no messages, no errors, so let's test it...... C:\>interp.exe print "Hello World! It will work if you try hard enough.....\n"; ^D Hello World! It will work if you try hard enough..... C:\> # the bare minimum I needed to get a compile is this C:\>cl.exe -DWIN32 -I"D:\Perl\lib\CORE" D:\Perl\lib\CORE\perl56.lib -o interp.exe interp.c Microsoft (R) 32-bit C/C++ Standard Compiler Version 13.00.9466 for 80x86 Copyright (C) Microsoft Corporation 1984-2001. All rights reserved. interp.c Microsoft (R) Incremental Linker Version 7.00.9466 Copyright (C) Microsoft Corporation. All rights reserved. /out:interp.exe /out:interp.exe D:\Perl\lib\CORE\perl56.lib interp.obj C:\>interp.exe print "japh!\n"; ^D japh! C:\>