- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good to know that. It'll be great if you can mark it as solution for better future reference.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page