Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16606 Discussions

Questa Sim on Windows - linking to external LIB

AlexBarry
Beginner
1,239 Views

I have been trying to use Questa (from Quartus Lite 21.1) on Windows to link to the Winsock2 library, without success.  I have a minimal test case attached.  I can't get it to load into the simulator.  I compile with the command:

  vlog -sv -dpiheader dpiheader.h test.v test.c

That succeeds.  Then, I try to start the simulator using the command:

  vsim -c DPI_test

That fails with an error:

# ** Fatal: (vsim-3828) Could not link 'vsim_auto_compile.dll': cmd = 'D:/intelFPGA_lite/21.1/questa_fse\gcc-7.4.0-mingw64vc15\bin\g++.exe -shared -o "C:/Users/barralem/AppData/Local/Temp\barralem@BHI4TNR6H2_dpi_32868\win64_gcc-7.4.0\vsim_auto_compile.dll" C:/work/embedded/test/work\_dpi\auto_compile@\win64_gcc-7.4.0\test.o -Wl,-Bsymbolic -L"D:/intelFPGA_lite/21.1/questa_fse/win64" -lmtipli'
# (vsim-50) A call to system(D:/intelFPGA_lite/21.1/questa_fse\gcc-7.4.0-mingw64vc15\bin\g++.exe -shared -o "C:/Users/barralem/AppData/Local/Temp\barralem@BHI4TNR6H2_dpi_32868\win64_gcc-7.4.0\vsim_auto_compile.dll" C:/work/embedded/test/work\_dpi\auto_compile@\win64_gcc-7.4.0\test.o -Wl,-Bsymbolic -L"D:/intelFPGA_lite/21.1/questa_fse/win64" -lmtipli) returned error code '1'.
# No such file or directory. (errno = ENOENT)
#

I have tried removing the "#pragma comment(lib, "ws2_32.lib")" line, with no change.  I have also tried specifying the library on the command line with -sclib.  I have tried copying the LIB to the project directory, with no help.

0 Kudos
1 Solution
AlexBarry
Beginner
1,204 Views

I believe we have figured it out.  We needed to add the -64 parameter, and -ldflags to pass parameters to gcc.  This appears to work:

    vsim -c DPI_test -ldflags "-lws2_32" -64

View solution in original post

0 Kudos
3 Replies
ShengN_Intel
Employee
1,220 Views

Seems like some compatibility issue there. Winsock library is 32-bit version but questa gcc is 64-bit version. Try to use modelsim instead of questa in order to match bit version.

0 Kudos
AlexBarry
Beginner
1,205 Views

I believe we have figured it out.  We needed to add the -64 parameter, and -ldflags to pass parameters to gcc.  This appears to work:

    vsim -c DPI_test -ldflags "-lws2_32" -64

0 Kudos
ShengN_Intel
Employee
1,198 Views

Good to know that. It'll be great if you can mark it as solution for better future reference.

0 Kudos
Reply