Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The specified module could not be found Error #11

Open
Caue-Aron opened this issue Apr 2, 2023 · 6 comments
Open

The specified module could not be found Error #11

Caue-Aron opened this issue Apr 2, 2023 · 6 comments

Comments

@Caue-Aron
Copy link

I have moonglfw and moongl in the same directory as the ran script, tho when i execute the example code on the repo i get this error:

-- Script: hello.lua

gl = require("moongl")
glfw = require("moonglfw")

glfw.window_hint('context version major', 3)
glfw.window_hint('context version minor', 3)
glfw.window_hint('opengl profile', 'core')

window = glfw.create_window(600, 400, "Hello, World!")
glfw.make_context_current(window)
gl.init() -- this is actually glewInit()

function reshape(_, w, h) 
   print("window reshaped to "..w.."x"..h)
   gl.viewport(0, 0, w, h)
end

glfw.set_window_size_callback(window, reshape)

while not glfw.window_should_close(window) do
   glfw.poll_events()
   -- ... rendering code goes here ...
   gl.clear_color(1.0, 0.5, 0.2, 1.0) -- GLFW orange
   gl.clear("color", "depth")
   glfw.swap_buffers(window)
end
lua5.1: error loading module 'moongl' from file '.\moongl.dll':
        NÒo foi possÝvel encontrar o m¾dulo especificado.

stack traceback:
        [C]: ?
        [C]: in function 'require'
        test.lua:3: in main chunk
        [C]: ?

image

@stetre
Copy link
Owner

stetre commented Apr 3, 2023

Is there any good reason not to stick to the installation instructions?

@stetre
Copy link
Owner

stetre commented Apr 4, 2023

Are you using MSYS2/MinGW on Windows?

By the way, I see that you are using Lua 5.1. As stated in the README, this library and its companions require Lua >= 5.3. Some of them may work with previous versions but this is not guaranteed.

This shouldn't be the cause for this particular error you get, though. When you get a 'module not found' error from Lua it means that the required module is not in one of the paths specified in the variable package.cpath (for C modules) or package.path (for .lua modules). Try adding the following commands at the very top of the example script, before the require, and copy here the output you get:

print(package.cpath)
print(package.path)

@Caue-Aron
Copy link
Author

I wanted to use those libs in luajit, thats why i built for lua 5.1. that didnt work, but building it for lua 5.4 worked just fine. I wanted to use it in luajit bc of imgui, i couldnt install the imgui_lua_bindings for standard lua.

@Antonygamergod
Copy link

me too

lua: error loading module 'moongl' from file '.\moongl.dll':
N�o foi poss�vel encontrar o m�dulo especificado.

stack traceback:
[C]: in ?
[C]: in function 'require'
c:\lua\opengl\opengl.lua:1: in main chunk
[C]: in ?

@Antonygamergod
Copy link

but im not using lua 5.1 or luajit, im using 5.4

@Antonygamergod
Copy link

it runs the moonglfw perfectly, but don't run the moongl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants