[SCIHOME\atoms\x64\mingw\10.3.1] link…failed: dia and ref are not equal
013/015 - [SCIHOME\atoms\x64\mingw\10.3.1] links…failed: Slave Scilab exited with error code -1.074D+09
TEST : [SCIHOME\atoms\x64\mingw\10.3.1] link
failed: dia and ref are not equal
Compare the following files:
To me, using atomsTest to debug your issue is not the best approach. First, tell us more about your setup. If I am right, you are using Scilab 2023.1. Can you verify that mingw works fine in a more general context, for example, can you test some of the ilib_build or ilib_for_link examples ? You can also try with a more recent version of Scilab (e.g. 2024.1.0), or uninstall the mingw toolbox and install Visual Studio community edition instead.
I’ve tried all vers. (6.1.1, 23, 24), all compilers (mingw, msvc), diff. paths, diff. arch (32, 64). Functions like haveacompiler and findmsvc works fine (No errors). But Demos from xcos-Electrical returns error “c_pass1: build the modelica meta-block failed”. And If I try to make my own electrical model I get ““Undefined variable ‘model’ in function ‘build_modelica_block’.””
When I try ex. from demos “call a C func (using C/c++ ctand libs” I get:
Calling a C function from Scilab.
“#include <math.h>”
“void bar(double *a,double *b,double *c)”
“{ *c = expm1(*a * log1p(*b)); }”
Calling C function. Z = (1+Y)**X - 1
with X = 5
with Y = 7
Z = bar(X, Y);
Result Z = 32766
Looks like it works:
Calling ilib_for_link to build a Fortran subroutine.
Generate a loader file
Generate a Makefile
Running the Makefile
Compilation of foof.obj
Building shared library (be patient)
Generate a cleaner file
Shared archive loaded.
Link done.
Running ilib_build func:
Generate a gateway file
Generate a loader file
Generate a Makefile
Running the makefile
Compilation of build_c.obj
Compilation of build_c.obj
Compilation of build_c.obj
Compilation of fun1.obj
Compilation of fun2.obj
Compilation of sci_fun1.obj
Building shared library (be patient)
Generate a cleaner file
Shared archive loaded.
Link done.
Can you quit Scilab, completely remove your Scilab user settings folder (something like C:\Users\id\AppData\Roaming\Scilab), then retry the demo by using latest Scilab version (2025.0.0) ? If possible, leave only one compiler on your machine, e.g. Visual Studio 2019.
Made simple c++ program and compiled/run it to be sure msvc is working
Installed Sci (the last one)
call findmsvc func. (Returns “Visual Studio Community 2022”)
Restarted PC
All in vain. All the errors are the same. Nothing’s changed. I think something wrong with /bin/modelicat.exe file. When I try to run this file I got an error: “The application was unable to start correctly (0xc000007b)”
And all that examples with lib_for_link doesn’t work anymore. The error is: “Invalid index” So, MinGW is better.
Actually, the problem you are facing is not related to your compiler (MinGW) but is probably due to a missing DLL (which is mandatory for modelicat.exe) on your system.
vincent, I’ve installed it. So, Now I try to use Sci 2025. when I try to run xcos-demos-Electrical I got error from modelicat.exe (The app was unable to start correctly) Something wrong with modelicat.exe under W11. modelicat.exe is not working from Sci25, 23 and 611.
I’ve noticed the Bat file in \AppData\Local\Temp\SCI_TMP_12904_14610 using wrong modelicat.exe path in all Sci versions. It’s
“C:\PROGRA~1\SCILAB~1.1\bin\modelicat.exe”
Can you try to run modelicat.exe with administrator rights to see if it fixes the problem? (Right-click on modelicat.exe and then select “Run as Administrator”)