mantielero / occt.nim

OpenCascade nim wrapper
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

Bottle.nim doesn't compile #1

Closed grd closed 1 year ago

grd commented 1 year ago

This is the error message:

/home/user/.cache/nim/bottle_d/@mbottle.nim.cpp: In function ‘void main__bottle_3()’:
/home/user/.cache/nim/bottle_d/@mbottle.nim.cpp:336:41: error: no matching function for call to ‘BRepOffsetAPI_MakeThickSolid::MakeThickSolidByJoin(TopoDS_Shape&, TY__GYcrNLfg2mugiSUU7L2tyA&, NF, double, tyEnum_BRepOffset_Mode__Xm2Lugv8wC5Qu8DdfizkYw, bool, bool, GeomAbs_JoinType, bool, Message_ProgressRange&)’
  336 |         aSolidMaker.MakeThickSolidByJoin(myBody, facesToRemove, ((NF)(-(myThickness)) / (NF)(50.0)), 0.001, ((tyEnum_BRepOffset_Mode__Xm2Lugv8wC5Qu8DdfizkYw)0), NIM_FALSE, NIM_FALSE, ((GeomAbs_JoinType)0), NIM_FALSE, T29_);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/user/.cache/nim/bottle_d/@mbottle.nim.cpp:48:
/usr/include/opencascade/BRepOffsetAPI_MakeThickSolid.hxx:117:24: note: candidate: ‘void BRepOffsetAPI_MakeThickSolid::MakeThickSolidByJoin(const TopoDS_Shape&, const TopTools_ListOfShape&, Standard_Real, Standard_Real, BRepOffset_Mode, Standard_Boolean, Standard_Boolean, GeomAbs_JoinType, Standard_Boolean)’
  117 |   Standard_EXPORT void MakeThickSolidByJoin(const TopoDS_Shape& S,
      |                        ^~~~~~~~~~~~~~~~~~~~
/usr/include/opencascade/BRepOffsetAPI_MakeThickSolid.hxx:117:24: note:   candidate expects 9 arguments, 10 provided
/home/user/.cache/nim/bottle_d/@mbottle.nim.cpp:356:73: error: no match for call to ‘(gp_Ax2d) (float)’
  356 |         TY__RkXz1PGFjIpHLx0HtSizJg anEllipse1((new Geom2d_Ellipse(anAx2d((float) (aMajor))((float) (aMinor))NIM_TRUE)));
      |                                                                   ~~~~~~^~~~~~~~~~~~~~~~~~
/home/user/.cache/nim/bottle_d/@mbottle.nim.cpp:358:73: error: no match for call to ‘(gp_Ax2d) (float)’
  358 |         TY__RkXz1PGFjIpHLx0HtSizJg anEllipse2((new Geom2d_Ellipse(anAx2d((float) (aMajor))((float) (((NF)(aMinor) / (NF)(4.0f))))NIM_TRUE)));
      |                                                                   ~~~~~~^~~~~~~~~~~~~~~~~~
compilation terminated due to -fmax-errors=3.
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/usr/import/opencascade/   -I'/home/user/.choosenim/toolchains/nim-#devel/lib' -I/home/user/occt.nim-main/examples -o /home/user/.cache/nim/bottle_d/@mbottle.nim.cpp.o /home/user/.cache/nim/bottle_d/@mbottle.nim.cpp' failed with exit code: 1

I can compile fillet01.nim

mantielero commented 1 year ago

What OpenCascade version do you have installed?

grd commented 1 year ago

That is a good question. ATM I use xubuntu and I think that I have the latest release but I found this: https://packages.ubuntu.com/source/kinetic/opencascade

grd commented 1 year ago

After a git pull I got this error message from compiling nim cpp -r bottle.nim

/home/user/.cache/nim/bottle_d/@mbottle.nim.cpp: In function ‘void main__bottle_3()’:
/home/user/.cache/nim/bottle_d/@mbottle.nim.cpp:350:41: error: no matching function for call to ‘BRepOffsetAPI_MakeThickSolid::MakeThickSolidByJoin(TopoDS_Shape&, TY__GIqsjlKJHsTq0jbUI9bnu9aw&, float, float, BRepOffset_Mode, bool, bool, GeomAbs_JoinType, bool, Message_ProgressRange&)’
  350 |         aSolidMaker.MakeThickSolidByJoin(myBody, facesToRemove, ((float) (((NF)(-(myThickness)) / (NF)(50.0)))), 0.001f, ((BRepOffset_Mode) 0), NIM_FALSE, NIM_FALSE, ((GeomAbs_JoinType) 0), NIM_FALSE, T31_);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/user/.cache/nim/bottle_d/@mbottle.nim.cpp:48:
/usr/include/opencascade/BRepOffsetAPI_MakeThickSolid.hxx:117:24: note: candidate: ‘void BRepOffsetAPI_MakeThickSolid::MakeThickSolidByJoin(const TopoDS_Shape&, const TopTools_ListOfShape&, Standard_Real, Standard_Real, BRepOffset_Mode, Standard_Boolean, Standard_Boolean, GeomAbs_JoinType, Standard_Boolean)’
  117 |   Standard_EXPORT void MakeThickSolidByJoin(const TopoDS_Shape& S,
      |                        ^~~~~~~~~~~~~~~~~~~~
/usr/include/opencascade/BRepOffsetAPI_MakeThickSolid.hxx:117:24: note:   candidate expects 9 arguments, 10 provided
Error: execution of an external compiler program 'g++ -c -std=gnu++14 -funsigned-char  -w -fmax-errors=3 -fpermissive -I/usr/include/opencascade/ -I/usr/import/opencascade/   -I/home/user/.choosenim/toolchains/nim-1.6.10/lib -I/home/user/occt.nim/examples -o /home/user/.cache/nim/bottle_d/@mbottle.nim.cpp.o /home/user/.cache/nim/bottle_d/@mbottle.nim.cpp' failed with exit code: 1

Which AFAIK means that it can't find the right function parameters.

But now I also can't compile fillet01.nim and also not step01.niim but in both accounts the error is different than from bottle01.nim. This error is like this:

/home/user/occt.nim/examples/step01.nim(4, 13) Error: undeclared identifier: 'newBRepPrimAPI_MakeBox'
candidates (edit distance, scope distance); see '--spellSuggest': 
 (3, 4): 'brepprimapi_makebox' [module declared in /home/user/occt.nim/src/wrapper/tkprim/brepprimapi/brepprimapi_includes.nim(6, 8)]
mantielero commented 1 year ago

It looks like the signature of your /usr/include/opencascade/BRepOffsetAPI_MakeThickSolid.hxx:

void BRepOffsetAPI_MakeThickSolid::MakeThickSolidByJoin(
  const TopoDS_Shape&, 
  const TopTools_ListOfShape&, 
  Standard_Real, 
  Standard_Real, 
  BRepOffset_Mode, 
  Standard_Boolean, 
  Standard_Boolean, 
  GeomAbs_JoinType, 
  Standard_Boolean)

in my system:

Standard_EXPORT void MakeThickSolidByJoin(
  const TopoDS_Shape& S,
  const TopTools_ListOfShape& ClosingFaces,
  const Standard_Real Offset,
  const Standard_Real Tol,
  const BRepOffset_Mode Mode = BRepOffset_Skin,
  const Standard_Boolean Intersection = Standard_False,
  const Standard_Boolean SelfInter = Standard_False,
  const GeomAbs_JoinType Join = GeomAbs_Arc,
  const Standard_Boolean RemoveIntEdges = Standard_False,
  const Message_ProgressRange& theRange = Message_ProgressRange());  #<-- It looks like this is missing

Right now I am not targetting a fixed OpenCascade version. I am working with what I get in ArchLinux. I would suggest to try to use a git version for opencascade in Ubuntu. I don't know if that is possible.

The API shows here that the Message_ProgressRange is part of the API.

grd commented 1 year ago

I agree and I am gonna close this issue.