does not compile

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

does not compile

José María Martínez García

The error:

gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o linit.o linit.c
ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
ranlib liblua.a
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lua.o lua.c
lua.c:82:10: error fatal: readline/readline.h: No such file or directory
 #include <readline/readline.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilación terminada.
make[2]: *** [<integrado>: lua.o] Error 1
make[2]: se sale del directorio '/home/josema/ProyectosSoftware/luatemp/lua-5.3.4/src'
make[1]: *** [Makefile:110: linux] Error 2
make[1]: se sale del directorio '/home/josema/ProyectosSoftware/luatemp/lua-5.3.4/src'
make: *** [Makefile:55: linux] Error 2

Thankyou
--
José María
@itubalibre
http://itubal.github.io/

Reply | Threaded
Open this post in threaded view
|

Re: does not compile

Pierre Chapuis
On Sun, Nov 5, 2017, at 10:44, José María Martínez García wrote:

lua.c:82:10: error fatal: readline/readline.h: No such file or directory
 #include <readline/readline.h>
          ^~~~~~~~~~~~~~~~~~~~~


You need to install the package that contains the readline headers for your distribution, for instance libreadline-dev on Debian-based platforms.

-- 
Pierre Chapuis
Reply | Threaded
Open this post in threaded view
|

Re: does not compile

José María Martínez García
In reply to this post by José María Martínez García
Ok Pierre.
I installed :
1) Lua (last version) from scratch (compiling and installing)
2) Luarocks (last version) from scratch (compiling and installing)
3) realine-devel from dnf pakage manager (Fedora 25)
4) From luarocks i installed rs232

All of them with no errors.
Now i'm trying to use rs232 library.

This is my program:

local rs232 = require "rs232"

local p, e = rs232.port('ttyUSB0',{
  baud         = '_57600';
  data_bits    = '_8';
  parity       = 'NONE';
  stop_bits    = '_1';
  flow_control = 'OFF';
  rts          = 'ON';
})

p:open()
print(p:write('AT\r\n'))

An this is the error. I'm sure tha port ttyUSB0 is in use and ready

Thankyou



--
José María
@itubalibre
http://itubal.github.io/

Reply | Threaded
Open this post in threaded view
|

Re: does not compile

José María Martínez García
Sorry the complete question

The program:

local rs232 = require "rs232"

local p, e = rs232.port('ttyUSB0',{
  baud         = '_57600';
  data_bits    = '_8';
  parity       = 'NONE';
  stop_bits    = '_1';
  flow_control = 'OFF';
  rts          = 'ON';
})


p:open()
print(p:write('AT\r\n'))


The error:

[josema@marengo NanoPlayBoard]$ sudo lua ejemplocom.lua
lua: /usr/share/lua/5.3/rs232.lua:265: attempt to index a nil value (field '_p')
stack traceback:
    /usr/share/lua/5.3/rs232.lua:265: in method 'write'
    ejemplocom.lua:14: in main chunk
    [C]: in ?


2017-11-05 18:57 GMT+01:00 José María Martínez García <[hidden email]>:
Ok Pierre.
I installed :
1) Lua (last version) from scratch (compiling and installing)
2) Luarocks (last version) from scratch (compiling and installing)
3) realine-devel from dnf pakage manager (Fedora 25)
4) From luarocks i installed rs232

All of them with no errors.
Now i'm trying to use rs232 library.

This is my program:

local rs232 = require "rs232"

local p, e = rs232.port('ttyUSB0',{
  baud         = '_57600';
  data_bits    = '_8';
  parity       = 'NONE';
  stop_bits    = '_1';
  flow_control = 'OFF';
  rts          = 'ON';
})

p:open()
print(p:write('AT\r\n'))

An this is the error. I'm sure tha port ttyUSB0 is in use and ready

Thankyou



--
José María
@itubalibre
http://itubal.github.io/




--
José María
@itubalibre
http://itubal.github.io/

Reply | Threaded
Open this post in threaded view
|

Re: does not compile

Sean Conner
In reply to this post by José María Martínez García
It was thus said that the Great José María Martínez García once stated:

> Ok Pierre.
> I installed :
> 1) Lua (last version) from scratch (compiling and installing)
> 2) Luarocks (last version) from scratch (compiling and installing)
> 3) realine-devel from dnf pakage manager (Fedora 25)
> 4) From luarocks i installed rs232
>
> All of them with no errors.
> Now i'm trying to use rs232 library.
>
> This is my program:
>
> local rs232 = require "rs232"
>
> local p, e = rs232.port('ttyUSB0',{
>   baud         = '_57600';
>   data_bits    = '_8';
>   parity       = 'NONE';
>   stop_bits    = '_1';
>   flow_control = 'OFF';
>   rts          = 'ON';
> })

  Try printing both p and e at this point.  

  -spc


Reply | Threaded
Open this post in threaded view
|

Re: does not compile

Philipp Janda
Am 05.11.2017 um 20:07 schröbte Sean Conner:

> It was thus said that the Great José María Martínez García once stated:
>> Ok Pierre.
>> I installed :
>> 1) Lua (last version) from scratch (compiling and installing)
>> 2) Luarocks (last version) from scratch (compiling and installing)
>> 3) realine-devel from dnf pakage manager (Fedora 25)
>> 4) From luarocks i installed rs232
>>
>> All of them with no errors.
>> Now i'm trying to use rs232 library.
>>
>> This is my program:
>>
>> local rs232 = require "rs232"
>>
>> local p, e = rs232.port('ttyUSB0',{
>>    baud         = '_57600';
>>    data_bits    = '_8';
>>    parity       = 'NONE';
>>    stop_bits    = '_1';
>>    flow_control = 'OFF';
>>    rts          = 'ON';
>> })
>
>    Try printing both p and e at this point.

And the return values of p:open().

>
>    -spc
>

Philipp




Reply | Threaded
Open this post in threaded view
|

Re: does not compile

Luiz Henrique de Figueiredo
In reply to this post by José María Martínez García
> lua.c:82:10: error fatal: readline/readline.h: No such file or directory
>  #include <readline/readline.h>
>           ^~~~~~~~~~~~~~~~~~~~~

http://www.lua.org/manual/5.3/readme.html#install says this:
        If you're running Linux and get compilation errors,
        make sure you have installed the readline development
        package (which is probably named libreadline-dev or
        readline-devel).