no matching function for call to and other errors in wrapper code
Hi everyone, this is my first post on swig-user.
Running the default swig3.0 as available under ubuntu 16.04LTS with gcc/g++ 5.4.0.
I'm trying to use swift to wrap a C++ SAT solver for java using swig. I have
no control over the c++ code I'm trying to wrap.
I wrote a simple swig configuration file with a few %rename and %ignore and
I've managed to call swig and obtain a cpp file and some java code which
seems to contain every method I need to be wrapped. So far so good.
When trying to compile the generated c++ file using gcc 5.4.0
(remark: -I../.. is added because it is the root of the solver's source
and all includes are relative to this root path, and that the wrapper code
is generated in a directory two subfolders below the root)
I get a few hundreds of errors of different kinds, it seems I'm doing
something wrong but I can't figure out what.
# error kind 1 bad initialization:
sharpCDCL_wrap.cpp: In function ‘jlong
Java_sharpCDCL_sharpCDCLJNI_Solver_1clausesBegin(JNIEnv*, jclass, jlong,
sharpCDCL_wrap.cpp:2243:18: error: no matching function for call to
In file included from ../../minisat/core/Solver.h:16:0,
../../minisat/core/SolverTypes.h:297:5: note: candidate:
ClauseIterator(const ClauseAllocator& _ca, const CRef* _crefs) :
../../minisat/core/SolverTypes.h:297:5: note: candidate expects 2
arguments, 0 provided
The swig generated code that triggers this error is the following:
# private methods used by the swig-generated code:
In file included from ../../minisat/utils/Options.h:30:0,
../../minisat/mtl/Vec.h: In function ‘void
Java_sharpCDCL_sharpCDCLJNI_Solver_1model_1set(JNIEnv*, jclass, jlong,
../../minisat/mtl/Vec.h:48:14: error: ‘Minisat::vec<T>& Minisat::vec<T,
_Size>::operator=(Minisat::vec<T>&) [with T = Minisat::lbool; _Size = int]’
vec<T>& operator=(vec<T>& other);
sharpCDCL_wrap.cpp:2840:8: error: within this context
arg2 = *argp2;
# operator= related errors:
error: non-static reference member ‘const Minisat::ClauseAllocator&
Minisat::ClauseIterator::ca’, can’t use default assignment operator
# namespace erros
sharpCDCL_wrap.cpp:5127:39: error: ‘SimpSolver’ is not a member of ‘Minisat’
*(Minisat::Solver **)&baseptr = *(Minisat::SimpSolver **)&jarg1;
I've double checked and SimpSolver is indeed declared in the
Minisat namespace, and in the swig interface file proper includes have been
added to make sure all
relevant headers are pulled by the wrapper (these are virtually all there is
to know except for some templates that are used internally to the solver.
What am I doing wrong ?
What can I do to fix these issues. ?
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi _______________________________________________
Swig-user mailing list
[hidden email] https://lists.sourceforge.net/lists/listinfo/swig-user