Xiao Yafeng
2012-07-22 11:28:42 UTC
I have to use #import to import typed library , but seems Inline::CPP
doesn't know this and complain many errors:
use Inline CPP=>Config=>
CC => 'cl.exe',
BUILD_NOISY => 1;
use Inline CPP=><<'EOF';
#import "C:\Program Files\Common Files\Microsoft Shared\office11\mso.dll"
rename("DocumentProperties", "DocumentPropertiesXL") rename("RGB", "RBGXL")
#import "C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\vbe6ext.olb"
#import "C:\Program Files\Microsoft Office\Office11\EXCEL.EXE"
rename("DialogBox", "DialogBoxXL") rename("RGB", "RBGXL")
rename("DocumentProperties", "DocumentPropertiesXL") rename("ReplaceText",
"ReplaceTextXL") rename("CopyFile", "CopyFileXL") no_dual_interfaces
using namespace std;
void test(){
printf("hello world\n");
}
EOF
test();
Error messages:
C:\Perl\bin\perl.exe C:\Perl\site\lib\ExtUtils\xsubpp -typemap
"C:\Perl
\lib\ExtUtils\typemap" test_cpp_pl_57db.xs > test_cpp_pl_57db.xsc &&
C:\Perl\bi
n\perl.exe -MExtUtils::Command -e mv -- test_cpp_pl_57db.xsc
test_cpp_pl_57db.c
cl.exe -c -I"C:/" -nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32
-D_CONS
OLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE
-DPERL_IMPLICIT_CONTEXT -D
PERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T -DPERL_MSVCRT_READFIX
-MD -Zi
-DNDEBUG -O1 -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\"
"-IC:\Perl\lib\CORE"
test_cpp_pl_57db.c
test_cpp_pl_57db.c
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(39) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(39) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(45) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(45) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(45) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(45) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(45) : error
C2143
: syntax error : missing '{' before ':'
..........
.........
Any ideas?
doesn't know this and complain many errors:
use Inline CPP=>Config=>
CC => 'cl.exe',
BUILD_NOISY => 1;
use Inline CPP=><<'EOF';
#import "C:\Program Files\Common Files\Microsoft Shared\office11\mso.dll"
rename("DocumentProperties", "DocumentPropertiesXL") rename("RGB", "RBGXL")
#import "C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\vbe6ext.olb"
#import "C:\Program Files\Microsoft Office\Office11\EXCEL.EXE"
rename("DialogBox", "DialogBoxXL") rename("RGB", "RBGXL")
rename("DocumentProperties", "DocumentPropertiesXL") rename("ReplaceText",
"ReplaceTextXL") rename("CopyFile", "CopyFileXL") no_dual_interfaces
using namespace std;
void test(){
printf("hello world\n");
}
EOF
test();
Error messages:
C:\Perl\bin\perl.exe C:\Perl\site\lib\ExtUtils\xsubpp -typemap
"C:\Perl
\lib\ExtUtils\typemap" test_cpp_pl_57db.xs > test_cpp_pl_57db.xsc &&
C:\Perl\bi
n\perl.exe -MExtUtils::Command -e mv -- test_cpp_pl_57db.xsc
test_cpp_pl_57db.c
cl.exe -c -I"C:/" -nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32
-D_CONS
OLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE
-DPERL_IMPLICIT_CONTEXT -D
PERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T -DPERL_MSVCRT_READFIX
-MD -Zi
-DNDEBUG -O1 -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\"
"-IC:\Perl\lib\CORE"
test_cpp_pl_57db.c
test_cpp_pl_57db.c
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(39) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(39) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(41) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(42) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(43) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(44) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(45) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(45) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(45) : error
C2143
: syntax error : missing '{' before ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(45) : error
C2059
: syntax error : ':'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\cstdio(45) : error
C2143
: syntax error : missing '{' before ':'
..........
.........
Any ideas?