I divide my perl code and C++ code into two files, then All is correct. I think that Perl maybe has some bug when it build the Makefile.PL.

perl code:
--------------------------------
use warnings;
use Inline CPP => Config =>
INC =>'-I/opt/ems/scada/src/dbUtil/include -I/opt/ems/scada/src/sesUtil/include -I/opt/ems/scada/src/dbAPI/include',
LIBS =>'-L/opt/ems/scada/lib  -lcmdl  -lDbUtil -lSesUtil -lDbAPI',
BUILD_NOISY => 1;

use Inline CPP ;


__END__

__CPP__

using namespace std;
#include "dbAPI.H"
using namespace cmdl;
#include "ntst.h"

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


the C++ code (ntst.h)
---------------------------------------
class dbTool
{
public:
        dbTool();
        ~dbTool();
private:
        dbAPI *db;
        sesDbg *dbg;
        sesLogErr *eLog;
};

dbTool::dbTool()
{
        const char*     _funcName="Net Status Perl";

        db=NULL;
        dbg=NULL;
        eLog=NULL;

        db=new  dbAPI();
        dbg  = new sesDbg(_funcName,0 , NULL);
        eLog = new sesLogErr(_funcName,NULL);
}

dbTool::~dbTool()
{
        if (db!=NULL)
                delete db;

        if (dbg!=NULL)
                delete dbg;

        if (eLog!=NULL)
                delete eLog;
}

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


if you put them together, you maybe meet some strange information while make it.


Cheer

Wumh

邬明辉  ( Minghui Wu )


From: "Sisyphus" <[EMAIL PROTECTED]>
To: 邬 明辉 <[EMAIL PROTECTED]>, <inline@perl.org>
Subject: Re: Inline::CPP build wrong about 'MODULE'
Date: Tue, 22 Aug 2006 21:22:44 +1000


----- Original Message -----
From: "邬 明辉" <[EMAIL PROTECTED]>
To: <inline@perl.org>
Sent: Tuesday, August 22, 2006 5:34 PM
Subject: Re: Inline::CPP build wrong about 'MODULE'


> The problem  is still  exist.  I  do not know  why the INC  Config is
> wrong!
>

I don't know either :-)

What happens when you run the following Inline::C script:

-----------------------------
use warnings;
use Inline CPP => Config =>
    INC => '-I/some/rubbish -I/some/more/rubbish',
    BUILD_NOISY => 1;

use Inline CPP => <<'EOC';

void greet() {
     printf("Hello World\n");
}

EOC

greet();
-----------------------------

Does the script compile (and output "Hello World" followed by a newline) ?

Do you see (during the "make" stage) that "/some/rubbish" and
"/some/more/rubbish" have been added to the includes path ?

(For me, the answer to both of those questions is "yes").

Cheers,
Rob


_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn

Reply via email to