in reply to XS Library Compilation Problems: Linker Error

Your DLL needs to link with the Perl58.lib. Check if Perl58.lib is included in the list of libraries. Setting the include and lib path is not enough, that will only let you compile to an object file. But to produce the final DLL, you have to link the object file & libraries as well. To link properly, you have to tell the linker to link with Perl58.lib under C:\Perl\lib\CORE.

PS. I see that you are using Visual Studio .NET version of the C compiler, not Visual C++ 6 version. I think the .NET version is quite different to the older non .NET version of the Visual C++ compiler, and produces different codes. The .NET compiler generates Just-In-Time opcodes, while the non .NET compiler generates native Machine code.

Update: forget about the comment on Visual Studio C++ .NET, not relevant to the problem.

  • Comment on Re: XS Library Compilation Problems: Linker Error

Replies are listed 'Best First'.
Re: Re: XS Library Compilation Problems: Linker Error
by talwyn (Monk) on Nov 10, 2003 at 06:19 UTC
    Roger, Thanks for your help. I got it to compile and it works.. sort of. The function call seems to work but the perl test script hangs. Perhaps this is the .Net issue you were talking about? Is there a compatability mode I can set in Visual Studio?

    When only one parameter is passed I get the croak message expected and the script/perl exits properly back to commandline. When both parameters are passed I get the sum printed but either the script, dll, or perl itself hangs and I have to terminate with ^C.

      I think Active Perl 5.8 from ActiveStates was compiled with the non-.NET version of Visual C++ (Visual C++ 6? 7?). Unless you compile your XS with the non-.NET version of Visual C++, it is not going to work properly. 8^(

        Hey Roger, After talking to tachyon I found that at least part of the problem was perl itself. It seems 5.8.0 doesn't work well; 5.6.1 does work better. At least perl doesn't hang anymore. My get filesize routine seems to have some sort of problem with its structure, but AddNumbers works fine. Thought I'd pass the info. --Talwyn