Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

RE: Using Inline C - under windows. Urgent

Posted on 2004-03-31
5
Medium Priority
?
432 Views
Last Modified: 2008-02-01
Hi there,

I have a fairly simple C function which I need to itegrate into a perl script. I have looked around and Inline (http://search.cpan.org/~ingy/Inline-0.43/C/C.pod) seems to be the simplest way to acheive this.

First  I needed nmake for Visual Studio 6.0 C++. I found this file here http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe installed it and set a path variable so it could be found.  

After installing Inline and nmake I am still unable to run simple hello world c progs or any other type either. I always get this message.

Had problems bootstrapping Inline module 'hello_pl_b1a6'

Can't locate loadable object for module hello_pl_b1a6 in @INC (@INC contains: C:\_Inline\lib C:/Perl/lib C:/Perl/site/li
b .) at C:/Perl/site/lib/Inline.pm line 500

 at C:\hello.pl line 0
INIT failed--call queue aborted.



This is a very urgent problem and help would be appreciated greatly. Am really wracking my brain to work out what might be going wrong. Could it be that my version of Perl was not compiled with nmake (i'm using 5.8 with windows XP)?

Here is the program giving the error message

use Inline C;
    greet('Ingy');
    greet(42);
    __END__    
    __C__
    void greet(char* name) {
      printf("Hello %s!\n", name);
    }


This is from the inline cook book and all other program fail aswell (in the same way).


0
Comment
Question by:SketchySteve
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 1

Author Comment

by:SketchySteve
ID: 10727642
Sorry just found a problem with Nmake. Have solved it and the error message given is now


Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

        C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils/xsubpp  -typemap C:\Perl\lib\ExtUtils\typemap  hello_pl_b1a688f821f707
19.xs > hello_pl_b1a688f821f70719.xsc && C:\Perl\bin\perl.exe -MExtUtils::Command -e mv hello_pl_b1a688f821f70719.xsc he
llo_pl_b1a688f821f70719.c
        cl -c  -IC:/  -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SE
ED -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1    -DVERSION=\"0.
00\"  -DXS_VERSION=\"0.00\"  "-IC:\Perl\lib\CORE"   hello_pl_b1a688f821f70719.c
'cl' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x1'
Stop.

A problem was encountered while attempting to compile and install your Inline
C code. The command that failed was:
  nmake > out.make 2>&1

The build directory was:
C:\_Inline\build\hello_pl_b1a688f821f70719

To debug the problem, cd to the build directory, and inspect the output files.
0
 
LVL 18

Expert Comment

by:kandura
ID: 10728189
do you also have the visual c++ compiler and linker installed? To use Inline::C, you need a compiler.
0
 
LVL 1

Author Comment

by:SketchySteve
ID: 10728354
I have just installed Visual Studio 6.0 and am still getting the same error message. It is ther german version - should this make a difference. What settings to i need to adjust?

Thanks


Steve  
0
 
LVL 18

Accepted Solution

by:
kandura earned 1280 total points
ID: 10728449
The error you got from nmake was this: "'cl' is not recognized as an internal or external command, operable program or batch file."
That means either the linker isn't installed (but since you just installed visual studio it should be), or it is not in your PATH.

Check your path environment to see if the directory where the compiler and linker are is included in your path. (In a command prompt,
type 'path'. The output should probably contain something like this:
C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;
C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;
C:\Program Files\Microsoft Visual Studio\Common\Tools;
C:\Program Files\Microsoft Visual Studio\VC98\bin

If I'm not mistaken, there should be a batch file called vcvars.bat somewhere in the visual studio directory tree that sets this up correctly.
You would need to open a new command prompt before this takes effect (or a reboot, that always does the trick ;)
0
 
LVL 1

Author Comment

by:SketchySteve
ID: 10728541
Cheers dude - sorted :)

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question