Page 1 of 1

Errors while building from source

Posted: Fri Jul 27, 2018 1:15 pm
by idhamari
Dear all,
Today I downloaded openSim 4.0 source code and tried to build it in my Windows 10 using VS2015. The first step (building the dependencies) works. When I tried to build openSim I got errors related to Future sandbox sub project. Is this a bug? here are the errors:

Code: Select all

11>  futureStatesTrajectoryUsage.cpp
11>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureStatesTrajectoryUsage.cpp(33): error C2440: 'initializing': cannot convert from 'SimTK::State' to 'OpenSim::StatesTrajectory'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(135): error C3083: 'RigidContactForce': the symbol to the left of a '::' must be a type
11>  D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureStatesTrajectoryUsage.cpp(33): note: No constructor could take the source type, or constructor overload resolution was ambiguous
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(135): error C2039: 'ContactParameters': is not a member of 'OpenSim'
10>  d:\sw\opensim\srcopensim\opensim\tools\CorrectionController.h(34): note: see declaration of 'OpenSim'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(135): error C2061: syntax error: identifier 'ContactParameters'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(136): error C3536: 'contactParams': cannot be used before it is initialized
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(136): error C2227: left of '->addGeometry' must point to class/struct/union/generic type
10>  D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(136): note: type is 'int'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(137): error C2227: left of '->addGeometry' must point to class/struct/union/generic type
10>  D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(137): note: type is 'int'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(138): error C2039: 'RigidContactForce': is not a member of 'OpenSim'
10>  d:\sw\opensim\srcopensim\opensim\tools\CorrectionController.h(34): note: see declaration of 'OpenSim'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(138): error C2061: syntax error: identifier 'RigidContactForce'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(147): error C2371: 'contactParams': redefinition; different basic types
10>  D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(135): note: see declaration of 'contactParams'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(148): error C2227: left of '->addGeometry' must point to class/struct/union/generic type
10>  D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(148): note: type is 'int'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(149): error C2227: left of '->addGeometry' must point to class/struct/union/generic type
10>  D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(149): note: type is 'int'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(150): error C2374: 'contact': redefinition; multiple initialization
10>  D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(138): note: see declaration of 'contact'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(153): error C3536: 'contact': cannot be used before it is initialized
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(166): error C2039: 'setInitialTime': is not a member of 'OpenSim::Manager'
10>  d:\sw\opensim\srcopensim\opensim\tools\ForwardTool.h(40): note: see declaration of 'OpenSim::Manager'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(174): error C2039: 'setFinalTime': is not a member of 'OpenSim::Manager'
10>  d:\sw\opensim\srcopensim\opensim\tools\ForwardTool.h(40): note: see declaration of 'OpenSim::Manager'
10>D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(175): error C2664: 'const SimTK::State &OpenSim::Manager::integrate(double)': cannot convert argument 1 from 'SimTK::State' to 'double'
10>  D:\sw\openSim\SrcOpenSim\OpenSim\Sandbox\futureRigidContact.cpp(175): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
========== Build: 2 succeeded, 2 failed, 118 up-to-date, 8 skipped ==========
For now, I removed the files futureRigidContact.cpp and futureStatesTrajectoryUsage.cpp , the build works.

I also had some errors when tried to build openSim 4.0 Gui using Netbeans 8.2. All the error was related to C3DFileAdapter.java. I removed the file and the build works, I put it back and rebuild, no more errors. Here are the errors:

Code: Select all

1>   [nb-javac] Compiling 565 source files to D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\build\classes
1>CUSTOMBUILD : [nb-javac] warning : [options] bootstrap class path not set in conjunction with -source 1.5
1>CUSTOMBUILD : [nb-javac] warning : [options] source value 1.5 is obsolete and will be removed in a future release
1>CUSTOMBUILD : [nb-javac] warning : [options] target value 1.5 is obsolete and will be removed in a future release
1>CUSTOMBUILD : [nb-javac] warning : [options] To suppress warnings about obsolete options, use -Xlint:-options.
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:16: error: cannot find symbol
1>   [nb-javac]     super(opensimCommonJNI.C3DFileAdapter_SWIGSmartPtrUpcast(cPtr), true);
1>   [nb-javac]                           ^
1>   [nb-javac]   symbol:   method C3DFileAdapter_SWIGSmartPtrUpcast(long)
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:33: error: cannot find symbol
1>   [nb-javac]         opensimCommonJNI.delete_C3DFileAdapter(swigCPtr);
1>   [nb-javac]                         ^
1>   [nb-javac]   symbol:   method delete_C3DFileAdapter(long)
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:41: error: cannot find symbol
1>   [nb-javac]     this(opensimCommonJNI.new_C3DFileAdapter__SWIG_0(), true);
1>   [nb-javac]                          ^
1>   [nb-javac]   symbol:   method new_C3DFileAdapter__SWIG_0()
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:45: error: cannot find symbol
1>   [nb-javac]     this(opensimCommonJNI.new_C3DFileAdapter__SWIG_1(C3DFileAdapter.getCPtr(arg0), arg0), true);
1>   [nb-javac]                          ^
1>   [nb-javac]   symbol:   method new_C3DFileAdapter__SWIG_1(long,C3DFileAdapter)
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:49: error: cannot find symbol
1>   [nb-javac]     long cPtr = opensimCommonJNI.C3DFileAdapter_clone(swigCPtr, this);
1>   [nb-javac]                                 ^
1>   [nb-javac]   symbol:   method C3DFileAdapter_clone(long,C3DFileAdapter)
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:54: error: cannot find symbol
1>   [nb-javac]     opensimCommonJNI.C3DFileAdapter_setLocationForForceExpression(swigCPtr, this, location.swigValue());
1>   [nb-javac]                     ^
1>   [nb-javac]   symbol:   method C3DFileAdapter_setLocationForForceExpression(long,C3DFileAdapter,int)
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:58: error: cannot find symbol
1>   [nb-javac]     return C3DFileAdapter.ForceLocation.swigToEnum(opensimCommonJNI.C3DFileAdapter_getLocationForForceExpression(swigCPtr, this));
1>   [nb-javac]                                                                    ^
1>   [nb-javac]   symbol:   method C3DFileAdapter_getLocationForForceExpression(long,C3DFileAdapter)
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:62: error: cannot find symbol
1>   [nb-javac]     return new StdMapStringTimeSeriesTableVec3(opensimCommonJNI.C3DFileAdapter_read__SWIG_0(fileName, wrt.swigValue()), true);
1>   [nb-javac]                                                                ^
1>   [nb-javac]   symbol:   method C3DFileAdapter_read__SWIG_0(String,int)
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:66: error: cannot find symbol
1>   [nb-javac]     return new StdMapStringTimeSeriesTableVec3(opensimCommonJNI.C3DFileAdapter_read__SWIG_1(fileName), true);
1>   [nb-javac]                                                                ^
1>   [nb-javac]   symbol:   method C3DFileAdapter_read__SWIG_1(String)
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:70: error: cannot find symbol
1>   [nb-javac]     opensimCommonJNI.C3DFileAdapter_write(StdMapStringTimeSeriesTableVec3.getCPtr(markerTable), markerTable, fileName);
1>   [nb-javac]                     ^
1>   [nb-javac]   symbol:   method C3DFileAdapter_write(long,StdMapStringTimeSeriesTableVec3,String)
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:74: error: cannot find symbol
1>   [nb-javac]     return opensimCommonJNI.C3DFileAdapter__markers_get();
1>   [nb-javac]                            ^
1>   [nb-javac]   symbol:   method C3DFileAdapter__markers_get()
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:78: error: cannot find symbol
1>   [nb-javac]     return opensimCommonJNI.C3DFileAdapter__forces_get();
1>   [nb-javac]                            ^
1>   [nb-javac]   symbol:   method C3DFileAdapter__forces_get()
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:82: error: cannot find symbol
1>   [nb-javac]     return new StdMapStringTimeSeriesTableVec3(opensimCommonJNI.C3DFileAdapter_read__SWIG_2(swigCPtr, this, fileName, wrt), true);
1>   [nb-javac]                                                                ^
1>   [nb-javac]   symbol:   method C3DFileAdapter_read__SWIG_2(long,C3DFileAdapter,String,long)
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:86: error: cannot find symbol
1>   [nb-javac]     public final static C3DFileAdapter.ForceLocation OriginOfForcePlate = new C3DFileAdapter.ForceLocation("OriginOfForcePlate", opensimCommonJNI.C3DFileAdapter_ForceLocation_OriginOfForcePlate_get());
1>   [nb-javac]                                                                                                                                                  ^
1>   [nb-javac]   symbol:   method C3DFileAdapter_ForceLocation_OriginOfForcePlate_get()
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:87: error: cannot find symbol
1>   [nb-javac]     public final static C3DFileAdapter.ForceLocation CenterOfPressure = new C3DFileAdapter.ForceLocation("CenterOfPressure", opensimCommonJNI.C3DFileAdapter_ForceLocation_CenterOfPressure_get());
1>   [nb-javac]                                                                                                                                              ^
1>   [nb-javac]   symbol:   method C3DFileAdapter_ForceLocation_CenterOfPressure_get()
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] D:\sw\openSim\SrcOpenSimGui\Gui\opensim\modeling\src\org\opensim\modeling\C3DFileAdapter.java:88: error: cannot find symbol
1>   [nb-javac]     public final static C3DFileAdapter.ForceLocation PointOfWrenchApplication = new C3DFileAdapter.ForceLocation("PointOfWrenchApplication", opensimCommonJNI.C3DFileAdapter_ForceLocation_PointOfWrenchApplication_get());
1>   [nb-javac]                                                                                                                                                              ^
1>   [nb-javac]   symbol:   method C3DFileAdapter_ForceLocation_PointOfWrenchApplication_get()
1>   [nb-javac]   location: class opensimCommonJNI
1>   [nb-javac] 16 errors
1>   [nb-javac] 4 warnings
1>
1>  BUILD FAILED
1>  C:\Program Files\NetBeans 8.2\harness\suite.xml:187: The following error occurred while executing this line:
1>  C:\Program Files\NetBeans 8.2\harness\common.xml:225: Compile failed; see the compiler error output for details.
As I understood, the visual studio projects copy some files, isn't it much easier to use a simple script to do so e.g. .bat for windows and .sh for Linux?