1 Reply Latest reply on Dec 18, 2015 1:09 AM by spektra_th

    ModelSim PLI question

    baev_al

      Hello friends.

      I try to test PLI.

      I have ModelSim PE Student Edition 10.4a installed as well as MinGW.

      Here is a c file:

      #include "D:\Modeltech_pe_edu_10.4a\include\veriuser.h"

      static PLI_INT32 hello()

      {

      io_printf("Hi there\n");

      return 0;

      }

      s_tfcell veriusertfs[] = {

      {usertask, 0, 0, 0, hello, 0, "$hello"},

      {0} /* last entry must be 0 */

      };

       

      The object file is achieved as following:

      g++ -c hello.c

       

      On the stage of dll I achieve an error:

      g++ -shared -o hello.dll hello.o

      undefined reference to '_imp__io_printf'

       

      What is my mistake?

      Thanks!

        • 1. Re: ModelSim PLI question
          spektra_th

          Hello Alexander Baev,

           

          its very likely that you have to include the pli library into your dll build.

           

          Somthing like:

          g++ -shared -o hello.dll hello.o mtipli.dll

           

          At least mtipli.dll contains this io_printf function. This dll usually resides in

          <modelsim dir>\win32aloem\mtipli.dll

           

          Best regards.