Hi,
parallely trying to use Inline::CPP also but not successfull.
Inline.Test.pl
#!/usr/bin/perl
use strict;
use warnings;
use Inline CPP => Config =>
AUTO_INCLUDE => '#include "stdafx.h"',
LIBS => ' -L/D:\Documents and Settings\M1009280\My Documents\Visual Studio
2005\Projects\Test\Test -lTest.lib',
INC => '-I D:\Documents and Settings\M1009280\My Documents\Visual Studio
2005\Projects\Test\Test\Test.h',
INC => '-I C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE',
PREFIX => 'Test',
ENABLE => 'STD_IOSTREAM',
BUILD_NOISY =>1;
use Inline CPP => <<'EOC';
#include <Test.h>
int test(int a){
a *= 2;
return a;
}
EOC
my $result = int test(2);
print "$result\n";
Executing the above script following error appears
C:\Perl\bin>perl Inline.Test.pl
Starting Build Preprocess Stage
Finished Build Preprocess Stage
Starting Build Compile Stage
Starting "perl Makefile.PL" Stage
Note (probably harmless): No library found for y
Note (probably harmless): No library found for and
Note (probably harmless): No library found for
Settings/M1009280/My
Note (probably harmless): No library found for Documents/Visual
Note (probably harmless): No library found for Studio
Note (probably harmless): No library found for 2005/Projects/Test/Test
Note (probably harmless): No library found for -lTest.lib
Writing Makefile for Inline_Test_pl_89e7
Finished "perl Makefile.PL" Stage
Starting "make" Stage
Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils\xsubpp -typemap C:\Perl\lib\E
xtUtils\typemap Inline_Test_pl_89e7.xs > Inline_Test_pl_89e7.xsc && C:\Perl\bin
\perl.exe -MExtUtils::Command -e mv Inline_Test_pl_89e7.xsc Inline_Test_pl_89e7.
c
cl -TP -c -IC:/Perl/bin -I C:\Program Files\Microsoft Visual Studio 8\V
C\ATLMFC\INCLUDE -nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_S
TRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICI
T_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBU
G -O1 -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" "-IC:\Perl\lib\CORE" Inlin
e_Test_pl_89e7.c
Microsoft
c1xx : fatal error C1083: Cannot open source file: 'Files\Microsoft': No such fi
le or directory
Visual
c1xx : fatal error C1083: Cannot open source file: 'Visual': No such file or dir
ectory
Studio
c1xx : fatal error C1083: Cannot open source file: 'Studio': No such file or dir
ectory
INCLUDE
c1xx : fatal error C1083: Cannot open source file: '8\VC\ATLMFC\INCLUDE': No such file or directory
Inline_Test_pl_89e7.c
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\xlocale(326) : warning C45
30: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\xlocale(341) : warning C45
30: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\xlocale(358) : warning C45
30: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\istream(1075) : warning C4
530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE\afx.h(24) : fatal error C1189: #error : Building MFC application with /MD
d (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD
dGenerating Code...
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
A problem was encountered while attempting to compile and install your Inline
CPP code. The command that failed was:
nmake
The build directory was:
C:\Perl\bin\_Inline\build\Inline_Test_pl_89e7
To debug the problem, cd to the build directory, and inspect the output files.
at Inline.Test.pl line 16
BEGIN failed--compilation aborted at Inline.Test.pl line 24.
Since i had problem while linking the VCC++ Header files i had to go for Win32::API approach
Please let me know if my approach wirting the above Inline_Test.pl script if correct?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.