Lua Development Tools error module sockets - lua

I'm using Eclipsse Lua Development Tools to develop Lua aplication but I'm getting an error. I need to add the module Lua Sockets to the Eclipse Lua and when I compile the aplication in the console I'm getting the following error:
Exception in thread "main" com.naef.jnlua.LuaRuntimeException: ...eclipse_lua\workspace\sockets\src\sockets\socket.lua:13: module 'socket.core' not found:
no field package.preload['socket.core']
no file '.\socket\core.lua'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\lua\socket\core.lua'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\lua\socket\core\init.lua'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket\core.lua'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket\core\init.lua'
no file 'C:\eclipse_lua\workspace\sockets\src\socket\core.lua'
no file 'C:\eclipse_lua\workspace\sockets\src\socket\core\init.lua'
no file 'C:\eclipse_lua\workspace\sockets\src\socket\core.luac'
no file 'C:\eclipse_lua\workspace\sockets\src\socket\core\init.luac'
no file 'C:\eclipse_lua\workspace\sockets\src\sockets\socket\core.lua'
no file 'C:\eclipse_lua\workspace\sockets\src\sockets\socket\core\init.lua'
no file 'C:\eclipse_lua\workspace\sockets\src\sockets\socket\core.luac'
no file 'C:\eclipse_lua\workspace\sockets\src\sockets\socket\core\init.luac'
no file '.\socket\core.dll'
no file '.\socket\core51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket\core.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket\core51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\socket\core.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\socket\core51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\loadall.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\loadall.dll'
no file '.\socket.dll'
no file '.\socket51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\socket.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\socket51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\loadall.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\loadall.dll'
at com.naef.jnlua.LuaState.lua_pcall(Native Method)
at com.naef.jnlua.LuaState.call(LuaState.java:555)
at org.eclipse.ldt.support.lua51.internal.interpreter.JNLua51Launcher.run(JNLua51Launcher.java:128)
at org.eclipse.ldt.support.lua51.internal.interpreter.JNLua51Launcher.main(JNLua51Launcher.java:143)
I've downloaded the module scokets in the official lua web page and added this module to the Lua Eclipse. I'm using lua 5.1 in the Eclipse with lua socket 2.0.2 (luasocket-2.0.2-lua-5.1.2-Win32-vc8).
I don't understand what I need to do to solve this error.
Thank you very much

Related

module 'paths' not found:

Problem using torch library on Windows:
SciTE:
lua: init.lua:12: module 'paths' not found:
no field package.preload['paths']
no file '.\paths.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\paths.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\paths\init.lua'
no file 'C:\Program Files (x86)\Lua\5.1\paths.lua'
no file 'C:\Program Files (x86)\Lua\5.1\paths\init.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\paths.luac'
no file '.\paths.dll'
no file '.\paths51.dll'
no file 'C:\Program Files (x86)\Lua\5.1\paths.dll'
no file 'C:\Program Files (x86)\Lua\5.1\paths51.dll'
no file 'C:\Program Files (x86)\Lua\5.1\clibs\paths.dll'
no file 'C:\Program Files (x86)\Lua\5.1\clibs\paths51.dll'
no file 'C:\Program Files (x86)\Lua\5.1\loadall.dll'
no file 'C:\Program Files (x86)\Lua\5.1\clibs\loadall.dll'
stack traceback:
[C]: in function 'require'
init.lua:12: in main chunk
[C]: ?
Exit code: 1
do not write about Linux, I saw: Torch test.sh, /usr/bin/lua: module 'paths' not found
Does anyone have file: paths.lua?
I also got this same error I find a solution from stackoverflow.
By Adding. /torch/install/bin/torch-activate
in your bashrc file and makes the test.sh script run.

Lua cannot find module in C++ api?

I am call lua in C++ applications. I have several lua files to call, like RunAPI_1208.lua , JSON.lua, etc. All the lua file is called by main.lua. While in C++ , I run all the file and finally run main.lua. I met this problem. I am using Cocos2d-x 2.2.6. How can I solve it?
[string "Main.lua"]:9: module 'RunAPI_1208' not found:
no field package.preload['RunAPI_1208']
no file './RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208/init.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208/init.lua'
no file './RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
Cocos2d: [string "Main.lua"]:9: module 'RunAPI_1208' not found:
no field package.preload['RunAPI_1208']
no file './RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208/init.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208/init.lua'
no file './RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
And this is my main.lua:
local run = require("RunAPI_1208")

What I'm doing wrong with relative path? Lua require error

I have tried everything but still can not require file in Lua. I am using LuaEdit 2010 on Windows 8.1
Relative path is still not working. I used these commands, which i have found but I still get the error below. My file is C:\Lua\file.lua, but I need to use relative path.
package.path = package.path .. ";../?.lua"
require ("file.lua") --also require ("file")
My error is:
Runtime Error at line -1: c:\lua\diplomka4.lua:S3: module 'file' not
found:
no field package.preload['file']
no file '.\file.lua'
no file 'C:\Program Files (x86)\LuaEdit 2010\lua\file.lua'
no file 'C:\Program Files (x86)\LuaEdit 2010\lua\file\init.lua'
no file 'C:\Program Files (x86)\LuaEdit 2010\file.lua‘
no file 'C:\Program Files (x86)\LuaEdit 2010\file\init.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\file.luac'
no file '../file.lua'
no file '.\file.dll'
no file 'C:\Program Files (x86)\LuaEdit 2010\file.dll'
no file 'C:\Program Files (x86)\LuaEdit 2010\loadall.dll'

Program compiles fine in the IDE but does not compile on the command line

I'm having some trouble with one of my builds. I'm using Jenkins to build a builderXE project but I'm getting the following errors.
C:\Program Files\Embarcadero\RAD Studio\8.0\Bin\CodeGear.Cpp.Targets(2341,5): error : Error: Unresolved external '__fastcall Sqlexpr::TSQLQuery::~TSQLQuery()' referenced from C:\JENKINS\WORKSPACE\project\STRINGLOOKUPFRMCODE.OBJ
C:\Program Files\Embarcadero\RAD Studio\8.0\Bin\CodeGear.Cpp.Targets(2341,5): error : Error: Unresolved external '__fastcall Sqlexpr::TCustomSQLDataSet::~TCustomSQLDataSet()' referenced from C:\JENKINS\WORKSPACE\project\STRINGLOOKUPFRMCODE.OBJ
C:\Program Files\Embarcadero\RAD Studio\8.0\Bin\CodeGear.Cpp.Targets(2341,5): error : Error: Unresolved external '__fastcall Sqlexpr::TCustomSQLDataSet::ParamByName(const System::UnicodeString)' referenced from C:\JENKINS\WORKSPACE\project\STRINGLOOKUPFRMCODE.OBJ
C:\Program Files\Embarcadero\RAD Studio\8.0\Bin\CodeGear.Cpp.Targets(2341,5): error : Error: Unable to perform link
I read that paths could be fixed by using rsvars.bat but when I tried that nothing happens. This is what I tried.
"C:\Program Files\Embarcadero\RAD Studio\8.0\bin\rsvars.bat" MSBuild "/t:Clean;Build" "/p:config=Release" "C:\jenkins\workspace\project\myProject.cbproj"
The project compiles with no problems in builderXE but when I uses Jenkins, or just the command line I get these errors. What do I need to do to get this to work again.
UPDATE: I have updated my post with the script I'm using.
set PATH="C:\Program Files\Embarcadero\RAD Studio\8.0\lib\win32\release;C:\Program Files\Embarcadero\RAD Studio\8.0\bin;C:\Documents and Settings\All Users\Documents\RAD Studio\8.0\Bpl;C:\Program Files\Embarcadero\RAD Studio\7.0\bin;C:\Documents and Settings\All Users\Documents\RAD Studio\7.0\Bpl;C:\PROGRA~1\Serena\vm\win32\bin;C:\PROGRA~1\Serena\vm\common\bin\win32;C:\PROGRA~1\Borland\CBUILD~1\Projects\Bpl;C:\PROGRA~1\Borland\CBUILD~1\Bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Wave Systems Corp\Dell Preboot Manager\Access Client\v5\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\tmssoftware\TMS Component Pack\bpl\;C:\Program Files\SmartBear\Automated Build Studio\bin;C:\Program Files\Mercurial;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\borland\CBuilder5\Bin;C:\Program Files\Embarcadero\RAD Studio\8.0\bin;C:\Program Files\Embarcadero\RAD Studio\7.0\bin;%IMPLIB%;%ADV%\x86;C:\Program Files\TortoiseHg\;C:\Python26;C:\Program Files\Embarcadero\RAD Studio\8.0\lib\win32\debug;"
call "C:\Program Files\Embarcadero\RAD Studio\8.0\bin\rsvars.bat"
MSBuild "C:\jenkins\workspace\project\myProject.cbproj" "/t:Clean;Build" "/p:config=Release"
In Jenkins, are you using the "Execute Windows Batch Command" to make these calls?
If so, try this:
call "C:\Program Files\Embarcadero\RAD Studio\8.0\bin\rsvars.bat"
MSBuild "/t:Clean;Build" "/p:config=Release" "C:\jenkins\workspace\project\myProject.cbproj"
The call command will run the batch file and set all the environment variables in the current session. These will then be available to your MSBuild call.
Also make sure that any dlls you need are in the current %PATH%. You can do this by:
set PATH=<your_dll_path_here>;%PATH%
This should be done right in the beginning.

Blackberry JDE 6.0 VERIFIER ERROR And KXML 2

I am trying to import kxml2, what I did is I downloaded the lib, went to Project Explorer -> Properties -> Build Path -> Libraries, I include the kxml2-2.3.0.jar. I run compile and get this error
JAR file creation failed with error -1
The preverified classes if any are in tmp25754. See jar log of errors in C:\Users\sgil\AppData\Local\Temp\rapc_1296da5f.dir\jarlog.txt
Error!: Error: preverifier failed: C:\Program Files (x86)\Eclipse-Blackberry\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.30\components ...
Packaging project ** failed (took 0.795 seconds)
Error!: Error: preverifier failed: C:\Program Files (x86)\Eclipse-Blackberry\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.30\components ...
Packaging project ** failed (took 0.795 seconds)
I tried running the preverifier and I got this:
preverify -classpath "C:\Program Files (x86)\Eclipse-B
lackberry\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.30\components\lib\net_ri
m_api.jar" "C:\Users\sgil\Desktop\Projects\Blackberry****\lib\kxml2-2.3.0.
jar"
I get this error:
JAR file creation failed with error -1
The preverified classes if any are in tmp25503. See jar log of errors in output\
jarlog.txt
Any advice?
The solution to this is to put the correct PATH variable in the "Enviromental Variables" of the System(right click in My PC->Enviromental Variables).
If "PATH" already exists you need to add the path of the BIN of the JDK installed on the Computer.
The carpet you should add this is the bin:
for example: C:\PATH_TO_THE_INSTALLED_JDK\bin

Resources