Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Issues with vendor/glfw

Open nico-barbas opened this issue 4 years ago • 3 comments

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Operating System: Windows x64
  • Please paste odin version output: odin version dev-2021-09-nightly:daccfca1

Current Behavior

What is the current behavior?

Failing compile a project after switching to GLFW in vendor. After changing the import path to "../lib/glfw3.lib" in vendor/glfw/bindings/bindings.odin, I am still unable to compile due to unresolved external symbols and defaultlib conflicts. However, I am able to compile if I use glfw3_mt.lib provided by vendor

Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Before changing vendor/glfw/bindings/bindings.odin: LINK : fatal error LNK1181: cannot open input file 'C:\Program Files\Odin\vendor\glfw\bindings\lib\glfw3.lib After changing "lib/glfw3.lib" to "../lib/glfw3.lib" in vendor/glfw/bindings/bindings.odin: LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library.

nico-barbas avatar Sep 20 '21 00:09 nico-barbas

I'm also experiencing this, though glfw3_mt may not be a good workaround on my system, as I'm unable to load GL functions.

    OpenGL.load_up_to(3, 2, glfw.gl_set_proc_address)
    gl_context: sdl2.GLContext = sdl2.GL_CreateContext(Window);
    fmt.println(rawptr(OpenGL.impl_ClearColor)) // prints 0x0
    OpenGL.impl_ClearColor(0,0,0,1);
    // Crash

EDIT: It looks like ClearColor is not nil, and impl_ClearColor is not, so maybe things are fine and I simply am not integrating with SDL correctly. I'll try just replacing it entirely with GLFW.

EDIT: ClearColor is still crashing my process when invoked, using only GLFW now.

leecommamichael avatar Nov 04 '21 04:11 leecommamichael

I'm also experiencing this, though glfw3_mt may not be a good workaround on my system, as I'm unable to load GL functions.

    OpenGL.load_up_to(3, 2, glfw.gl_set_proc_address)
    gl_context: sdl2.GLContext = sdl2.GL_CreateContext(Window);
    fmt.println(rawptr(OpenGL.impl_ClearColor)) // prints 0x0
    OpenGL.impl_ClearColor(0,0,0,1);
    // Crash

EDIT: It looks like ClearColor is not nil, and impl_ClearColor is not, so maybe things are fine and I simply am not integrating with SDL correctly. I'll try just replacing it entirely with GLFW.

EDIT: ClearColor is still crashing my process when invoked, using only GLFW now.

You need an OpenGL context active before you load the OpenGL procedures.

gingerBill avatar Nov 04 '21 09:11 gingerBill

Hello!

I am marking this issue as stale as it has not received any engagement from the community or maintainers 120 days. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan on resolving the issue.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone..

github-actions[bot] avatar Jul 24 '22 21:07 github-actions[bot]