@echo off setlocal call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" >nul cd /d G:\Robot_v2\DCU\tools\ecat if not exist build_native mkdir build_native if not exist build_native\wpcap.lib ( dumpbin /exports C:\Windows\System32\Npcap\wpcap.dll > build_native\exports.txt venv\Scripts\python.exe exports2def.py build_native\exports.txt build_native\wpcap.def wpcap lib /def:build_native\wpcap.def /machine:X64 /out:build_native\wpcap.lib if errorlevel 1 exit /b 1 ) cl /nologo /O2 /W3 /utf-8 /D_CRT_SECURE_NO_WARNINGS /DWIN32 /I soem-src\soem /I soem-src\osal /I soem-src\osal\win32 /I soem-src\oshw\win32 /I soem-src\oshw\win32\wpcap\Include /Fo:build_native\ ecat_native.c soem-src\soem\ethercatbase.c soem-src\soem\ethercatcoe.c soem-src\soem\ethercatconfig.c soem-src\soem\ethercatdc.c soem-src\soem\ethercateoe.c soem-src\soem\ethercatfoe.c soem-src\soem\ethercatmain.c soem-src\soem\ethercatprint.c soem-src\soem\ethercatsoe.c soem-src\osal\win32\osal.c soem-src\oshw\win32\nicdrv.c soem-src\oshw\win32\oshw.c /link /OUT:build_native\ecat_native.exe build_native\wpcap.lib ws2_32.lib winmm.lib if errorlevel 1 exit /b 1 echo [OK] build_native\ecat_native.exe