Quantcast

More Lua related questions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

More Lua related questions

Ervin Hegedüs
Hi there,

there is a library, written in C, and it has several bindings which compiled through Swig (Python, Perl and Tcl).

I'ld like to add Lua support, but there are several errors in generated wrapper source code:

- there included the "<string>" header, instead of "<string.h>"; here is the context:

#define SWIG_exception(a,b)\
{ lua_pushfstring(L,"%s:%s",#a,b);SWIG_fail; }


#include <string>

typedef union {
  struct {
    float min;                      
    float max;                      
    float step;            
  } n;                                     
  struct {
    const char *combostr[8];                     
  } c;                                   
} confparams_u;


- there are several undefined types in wrapper, the context:

#ifdef __cplusplus
extern "C" {
#endif
static int _wrap_std_set(lua_State* L) {
  int SWIG_arg = 0;
  namespace arg1 ;
  namespace *argp1 ;
 
  SWIG_check_num_args("std",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("std",1,"namespace");
 
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_namespace,0))){
    SWIG_fail_ptr("std_set",1,SWIGTYPE_p_namespace);
  }
  arg1 = *argp1;
 
  std = arg1;
 
  return SWIG_arg;
 
  if(0) SWIG_fail;
 
fail:
  lua_error(L);
  return SWIG_arg;
}

The "namespace" and "std" types are unknown.

Could anybody helps me to explain these errors?


Many thanks:

a.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: More Lua related questions

Ervin Hegedüs
Hi again,

looks like all of my problem solved.

On Sun, Oct 23, 2016 at 12:21:13PM +0200, Ervin Hegedüs wrote:

> Hi there,
>
> there is a library, written in C, and it has several bindings which
> compiled through Swig (Python, Perl and Tcl).
>
> I'ld like to add Lua support, but there are several errors in generated
> wrapper source code:
>
> - there included the "<string>" header, instead of "<string.h>"; here is
> the context:

I've removed the

%include lua/std_string.i, and problem solved
 
> static int _wrap_std_set(lua_State* L) {
>   int SWIG_arg = 0;
>   namespace arg1 ;
>   namespace *argp1 ;
>
[...]

>
>   std = arg1;
>
>   return SWIG_arg;
>
>   if(0) SWIG_fail;
>
> fail:
>   lua_error(L);
>   return SWIG_arg;
> }
>
> The "namespace" and "std" types are unknown.

Also removed lua/typemaps.i, and it solved.

Looks like the standard Lua swig files works with C++ code (this
is just an idea...)


Now I have the C wrapper file.


Thanks,


a.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Loading...