I was checking my repo occt.nim and some examples that used to work (or that is what I believe), now they stopped working.
For instance: gp_06_ax1.nim when compiled and run:
$ nim cpp -r gp_06_ax1
...
/home/jose/.cache/nim/gp_06_ax1_d/@mgp_06_ax1.nim.cpp:52:48: error: 'T1_' was not declared in this scope
52 | N_LIB_PRIVATE gp_Ax1 axis1__gp95485495ax49_u38(T1_, T2_);
| ^~~
/home/jose/.cache/nim/gp_06_ax1_d/@mgp_06_ax1.nim.cpp:52:53: error: 'T2_' was not declared in this scope
52 | N_LIB_PRIVATE gp_Ax1 axis1__gp95485495ax49_u38(T1_, T2_);
| ^~~
Error: execution of an external compiler program 'g++ -c -std=gnu++17 -funsigned-char -w -fmax-errors=3 -fpermissive -pthread -I/usr/include/opencascade/ -I/home/jose/.choosenim/toolchains/nim-2.0.2/lib -I'/home/jose/Descargas/occt/occt.nim-main/examples/01 Foundation' -o /home/jose/.cache/nim/gp_06_ax1_d/@mgp_06_ax1.nim.cpp.o /home/jose/.cache/nim/gp_06_ax1_d/@mgp_06_ax1.nim.cpp' failed with exit code: 1
where:
In fact, I am having some extrange behaviours with constructors. For example:
1. geom_01_cartesian_point.nim
$ nim cpp -r geom_01_cartesian_point.nim
...
/home/jose/.cache/nim/geom_02_cartesian_point_d/@m..@s..@ssrc@slib@sgeom@scartesian_point.nim.cpp:154:116: error: expression cannot be used as a function
154 | nimln_(22); result = opencascade::handle<Geom_CartesianPoint>((new Geom_CartesianPoint(((float) (x_p0))((float) (y_p1))((float) (z_p2)))));
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
Error: execution of an external compiler program 'g++ -c -std=gnu++17 -funsigned-char -w -fmax-errors=3 -fpermissive -pthread -I/usr/include/opencascade/ -I/home/jose/.choosenim/toolchains/nim-2.0.2/lib -I'/home/jose/Descargas/occt/occt.nim-main/examples/02 Modeling Data' -o /home/jose/.cache/nim/geom_02_cartesian_point_d/@m..@s..@ssrc@slib@sgeom@scartesian_point.nim.cpp.o /home/jose/.cache/nim/geom_02_cartesian_point_d/@m..@s..@ssrc@slib@sgeom@scartesian_point.nim.cpp' failed with exit code: 1
with:
2. geom_02_cartesian_point.nim
$ nim cpp -r geom_02_cartesian_point
...
/home/jose/.cache/nim/geom_02_cartesian_point_d/@m..@s..@ssrc@slib@sgeom@scartesian_point.nim.cpp: In function 'TY__A0iXJcRd9c6f9bJrwkHu9cprg newPnt__geom95485095cartesian95point_u3(NI, NF, NI)':
/home/jose/.cache/nim/geom_02_cartesian_point_d/@m..@s..@ssrc@slib@sgeom@scartesian_point.nim.cpp:154:116: error: expression cannot be used as a function
154 | nimln_(22); result = opencascade::handle<Geom_CartesianPoint>((new Geom_CartesianPoint(((float) (x_p0))((float) (y_p1))((float) (z_p2)))));
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
Error: execution of an external compiler program 'g++ -c -std=gnu++17 -funsigned-char -w -fmax-errors=3 -fpermissive -pthread -I/usr/include/opencascade/ -I/home/jose/.choosenim/toolchains/nim-2.0.2/lib -I'/home/jose/Descargas/occt/occt.nim-main/examples/02 Modeling Data' -o /home/jose/.cache/nim/geom_02_cartesian_point_d/@m..@s..@ssrc@slib@sgeom@scartesian_point.nim.cpp.o /home/jose/.cache/nim/geom_02_cartesian_point_d/@m..@s..@ssrc@slib@sgeom@scartesian_point.nim.cpp' failed with exit code: 1
It looks like the commas were missing in the constructor.
I am on ArchLinux using Nim v2.0.2.
I think it worked before because it wasnt generating the right codegen. I recall fixing a bug related to mixing globals and constructor.
Please, fix an issue with a small repro and I will try to take a look at it soon.
https://github.com/nim-lang/Nim/issues/23656
https://github.com/nim-lang/Nim/issues/23657
Sorry about not providing a simple C++ repro. I don't know C++.