Like you point that
I changed _tmain to main.
it works very well. :-)

thank you.

sorry for waste your time.

BR,
ChangMin


2007/8/15, Sisyphus <[EMAIL PROTECTED]>:
>
>
> ----- Original Message -----
> From: "Chang Min Jeon" <[EMAIL PROTECTED]>
> To: <perl-win32-users@listserv.ActiveState.com>
> Sent: Wednesday, August 15, 2007 11:32 PM
> Subject: what means "Can't open perl script "s": No such file or
> directory"
>
>
> There are some things you have doen that I don't understand.
>
> >
> >    #include <EXTERN.h>               /* from the Perl distribution
> */
> >    #include <perl.h>                 /* from the Perl distribution
> */
> >
> >    static PerlInterpreter *my_perl;  /***    The Perl
> interpreter    ***/
> >
> > int _tmain(int argc, char * argv[])
>
> The perlembed documentation has the above line as:
>
> int main(int argc, char **argv, char **env)
>
> Why have you changed it ?
>
> > {
> >   PERL_SYS_INIT3(&argc,&argv,&env);
> >        my_perl = perl_alloc();
> >        perl_construct(my_perl);
> >        PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
> >        perl_parse(my_perl, NULL, argc, argv, (char **)NULL);
> >
> >        call_argv("showtime", G_DISCARD | G_NOARGS, NULL);
> >        perl_destruct(my_perl);
> >        perl_free(my_perl);
> >        PERL_SYS_TERM();
> >
> >    return 0;
> > }
> >
> > and then finish build succesfully.
> >
>
> How did you build it ?
> First up, you need to run:
>
> perl -MExtUtils::Embed -e ccopts -e ldopts
>
> and save the output.
>
> Then you would build with:
>
> cl showtime.c X
>
> where X is the output of 'perl -MExtUtils::Embed -e ccopts -e ldopts'.
>
> Then you run:
>
> showtime.exe showtime.pl
>
> and it should work.
>
> > showtime.pl have following source code.
> >
> > sub showtime {
> > print time;
> > }
> >
> > \debug>test showtime.pl
>
> What is "test" ?
>
> I don't have Visual C compiler - I use MinGW (gcc). For me,
> 'perl -MExtUtils::Embed -e ccopts -e ldopts' produces:
>
> ------------------------------
> Note (probably harmless): No library found for -lmsvcrt
> Note (probably harmless): No library found for -lmoldname
> Note (probably harmless): No library found for -lkernel32
> Note (probably harmless): No library found for -luser32
> Note (probably harmless): No library found for -lgdi32
> Note (probably harmless): No library found for -lwinspool
> Note (probably harmless): No library found for -lcomdlg32
> Note (probably harmless): No library found for -ladvapi32
> Note (probably harmless): No library found for -lshell32
> Note (probably harmless): No library found for -lole32
> Note (probably harmless): No library found for -loleaut32
> Note (probably harmless): No library found for -lnetapi32
> Note (probably harmless): No library found for -luuid
> Note (probably harmless): No library found for -lws2_32
> Note (probably harmless): No library found for -lmpr
> Note (probably harmless): No library found for -lwinmm
> Note (probably harmless): No library found for -lversion
> Note (probably harmless): No library found for -lodbc32
> Note (probably harmless): No library found for -lodbccp32
>   -s -L"c:\perl58_M\lib\CORE" -L"C:\MinGW\lib"
> C:\perl58_M\lib\CORE\libperl58.a
>
>   -s -O2 -DWIN32 -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT
> -DPERL_IMPLICIT_SYS
> -fno-strict-aliasing -DPERL_MSVCRT_READFIX  -I"C:\perl58_M\lib\CORE"
> ------------------------------
>
> So, I save that as (all on the one line):
>
> ------------------------------
> -s -L"c:\perl58_M\lib\CORE" -L"C:\MinGW\lib"
> C:\perl58_M\lib\CORE\libperl58.a  -s -O2 -DWIN32
> -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT
> -DPERL_IMPLICIT_SYS -fno-strict-aliasing
> -DPERL_MSVCRT_READFIX  -I"C:\perl58_M\lib\CORE"
> ------------------------------
>
> My showtime.c (slightly modified from the perlembed docs to be more like
> your version) looks like:
>
> ------------------------------
> #include <EXTERN.h>
> #include <perl.h>
>
> static PerlInterpreter *my_perl;
>
> int main(int argc, char **argv, char **env)
> {
>     PERL_SYS_INIT3(&argc,&argv,&env);
>     my_perl = perl_alloc();
>     perl_construct(my_perl);
>
>     perl_parse(my_perl, NULL, argc, argv, NULL);
>     PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
>
>     call_argv("showtime", G_DISCARD | G_NOARGS, NULL);
>
>     perl_destruct(my_perl);
>     perl_free(my_perl);
>     PERL_SYS_TERM();
> }
> ------------------------------
>
> And my showtime.pl looks like:
>
> ------------------------------
> sub showtime {
>      print time;
> }
> ------------------------------
>
> I run:
>
> -----------------------------
> C:\_32\C>gcc -o showtime.exe
> showtime.c  -s -L"c:\perl58_M\lib\CORE" -L"C:\MinGW\lib"
> C:\perl58_M\lib\CORE\libperl58.a  -s -O2 -DWIN32
> -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT
> -DPERL_IMPLICIT_SYS -fno-strict-aliasing
> -DPERL_MSVCRT_READFIX  -I"C:\perl58_M\lib\CORE"
>
> C:\_32\C>showtime.exe showtime.pl
> 1187185924
> -----------------------------
>
> It should be the same for you, except that your 'perl -MExtUtils::Embed -e
> ccopts -e ldopts' output will be different.
>
> Cheers,
> Rob
>
>


-- 
CashFlow
To be rich.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to