MineBill / Engin3

MIT License
7 stars 0 forks source link

`task run` fails on windows #1

Open dezashibi opened 4 months ago

dezashibi commented 4 months ago

Problem

I've installed Task through winget, cloned the repo, running task run give me the following error:

image

this error was related to out/debug/ path not being created automatically it seems, I've created that and then task run continued to work until failed again with the following errors:

task: [build-meta] odin build engine/meta \
-build-mode:exe \
-show-timings \
-out:out/debug/meta.exe \
-o:none \
-use-separate-modules \

Total Time        -   323.927 ms - 100.00%
initialization    -     7.593 ms -   2.34%
parse files       -     9.709 ms -   2.99%
type check        -    66.471 ms -  20.52%
LLVM API Code Gen -   191.810 ms -  59.21%
msvc-link         -    48.339 ms -  14.92%
task: [run-meta] ./out/debug/meta.exe engine
task: [build] odin build engine \
-build-mode:exe -define:VALIDATION=true \
-show-timings \
-out:out/debug/engin3.exe \
-o:none \
-debug \
-use-separate-modules \
-collection:packages=packages \
-define:TRACY_ENABLE=true  \
-ignore-unknown-attributes

engin3-engine.obj : error LNK2019: unresolved external symbol nk_rect referenced in function engine.set_texture_data
engin3-engine.obj : error LNK2019: unresolved external symbol nk_begin referenced in function engine.set_texture_data
engin3-engine.obj : error LNK2019: unresolved external symbol nk_layout_row_dynamic referenced in function engine.set_texture_data
engin3-engine.obj : error LNK2019: unresolved external symbol nk_end referenced in function engine.set_texture_data
engin3-engine.obj : error LNK2019: unresolved external symbol nk_buffer_init_default referenced in function engine.nk_device_create
engin3-engine.obj : error LNK2019: unresolved external symbol nk_buffer_init_fixed referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_convert referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk__draw_begin referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk__draw_next referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_clear referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_buffer_clear referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_init_default referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_font_atlas_init_default referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_font_atlas_begin referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_font_atlas_bake referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_handle_id referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_font_atlas_end referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_style_set_font referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_input_begin referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_input_unicode referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_input_key referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_input_motion referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_input_button referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_input_scroll referenced in function engine.nk_lock_buffer
engin3-engine.obj : error LNK2019: unresolved external symbol nk_input_end referenced in function engine.nk_lock_buffer
engin3-tracy.obj : error LNK2019: unresolved external symbol ___tracy_emit_memory_alloc_callstack referenced in function tracy.EmitAlloc-1931
engin3-tracy.obj : error LNK2019: unresolved external symbol ___tracy_emit_memory_alloc referenced in function tracy.EmitAlloc-1931
engin3-tracy.obj : error LNK2019: unresolved external symbol ___tracy_emit_memory_free_callstack referenced in function tracy.EmitFree-1950
engin3-tracy.obj : error LNK2019: unresolved external symbol ___tracy_emit_memory_free referenced in function tracy.EmitFree-1950
engin3-tracy.obj : error LNK2019: unresolved external symbol ___tracy_emit_zone_name referenced in function tracy.ZoneName
engin3-tracy.obj : error LNK2019: unresolved external symbol ___tracy_alloc_srcloc referenced in function tracy.ZoneName
engin3-tracy.obj : error LNK2019: unresolved external symbol ___tracy_emit_zone_begin_alloc_callstack referenced in function tracy.ZoneName
engin3-tracy.obj : error LNK2019: unresolved external symbol ___tracy_emit_zone_end referenced in function tracy.ZoneEnd
engin3-tracy.obj : error LNK2019: unresolved external symbol ___tracy_emit_frame_mark referenced in function tracy.FrameMark
engin3-tracy.obj : error LNK2019: unresolved external symbol ___tracy_set_thread_name referenced in function tracy.SetThreadName
engin3-nuklear.obj : error LNK2019: unresolved external symbol nk_button_text referenced in function nuklear.button_string
engin3-nuklear.obj : error LNK2019: unresolved external symbol nk_label referenced in function nuklear.label_string
d:\projects\odin\engin3\packages\odin-tracy\tracy.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
d:\projects\odin\engin3\packages\odin-nuklear\nuklear_windows_amd64.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
D:\Projects\odin\Engin3\out\debug\engin3.exe : fatal error LNK1120: 37 unresolved externals
exit status 96

Environment

Windows 11 Pro tested on Powershell, CMD, Developer CMD vs2022

MineBill commented 4 months ago

Hmm that's weird. library machine type 'x86' conflicts with target machine type 'x64' seems to be the reason but i don't get that on my machine, running windows 11 pro also. Maybe the way i'm compiling the libraries is not compatible with other machines? If you don't mind running packages/build.bat, that will compile the libraries again, just keep in mind it calls vcvarsall x64 so you either need that in path or run the bat script from a developer cmd.

Also, how did you find out about this? I never shared the link to this project, so i'm curious. And thanks for at taking some time to open an issue!

dezashibi commented 4 months ago

Hey man, yes I did packages/build.bat it worked and the error actually is after running that, I did compiled both packages and the app on regular powershell and VS developer shell nothing has been changed.

I'm new to Odin, I've been checking Odin discord, you've shared screenshots of this editor and I saw your github link on your discord profile and it helped me to see the repo.

I'm a Rust programmer but I'm thinking to port a few of my projects to a new language that reusing it it wasm and other languages is easier than rust, I'm thinking about Odin for now.

UPDATE: I was using x86_x86 cross tools for vs 2022 but this time I used explicitly x64 native tools command prompt and I rebuilt and then run the tasks and it worked. the program meta.exe ran and finished with message main.odin(29:29) Index 1 is out of range 0..<1

the task says leak detected:

task: Task "build-meta" is up to date
task: [run-meta] ./out/debug/meta.exe engine
task: [build] odin build engine \
-build-mode:exe -define:VALIDATION=true \
-show-timings \
-out:out/debug/engin3.exe \
-o:none \
-debug \
-use-separate-modules \
-collection:packages=packages \
-define:TRACY_ENABLE=true  \
-ignore-unknown-attributes

Total Time        -  1067.711 ms - 100.00%
initialization    -     9.043 ms -   0.84%
parse files       -    30.256 ms -   2.83%
type check        -   249.130 ms -  23.33%
LLVM API Code Gen -   563.210 ms -  52.74%
msvc-link         -   216.064 ms -  20.23%
task: [run] ./out/debug/engin3.exe
[INFO ] --- [engine] Vendor NVIDIA Corporation
[INFO ] --- [engine]    Using NVIDIA GeForce RTX 3070 Ti Laptop GPU/PCIe/SSE2
[INFO ] --- [engine]    Version 4.6.0 NVIDIA 551.86
[DEBUG] --- [engine] Max texture anistotropy: 16
[DEBUG] --- [shader.odin:151:process_shader_source()] [engine] Processing file:  D:\Projects\odin\Engin3/assets/shaders/triangle.vert.glsl
[DEBUG] --- [shader.odin:151:process_shader_source()] [engine] Processing file:  D:\Projects\odin\Engin3/assets/shaders/common.glsl
[DEBUG] --- [shader.odin:151:process_shader_source()] [engine] Processing file:  D:\Projects\odin\Engin3/assets/shaders/lighting.glsl
[DEBUG] --- [shader.odin:151:process_shader_source()] [engine] Processing file:  D:\Projects\odin\Engin3/assets/shaders/pbr.frag.glsl
[DEBUG] --- [shader.odin:151:process_shader_source()] [engine] Processing file:  D:\Projects\odin\Engin3/assets/shaders/common.glsl
[DEBUG] --- [shader.odin:151:process_shader_source()] [engine] Processing file:  D:\Projects\odin\Engin3/assets/shaders/lighting.glsl
[DEBUG] --- [shader.odin:151:process_shader_source()] [engine] Processing file:  D:\Projects\odin\Engin3/assets/shaders/editor.glsl
[WARN ] --- [engine] OpenGL Debug Messenger:
[WARN ] --- [engine]    Source: API
[WARN ] --- [engine]    Type: Other
[WARN ] --- [engine]    Severity: low
[WARN ] --- [engine]    Message: Program/shader state info: GLSL program 3 failed to link
[ERROR] --- [shader.odin:42:shader_load_from_file()] [engine] Error linking shader program:
Link info
---------
error: Block "VS_IN" not declared as an output from the previous stage

[ERROR] --- [engine] Error initializing engine: Shader
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    57 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    1088 bytes at D:/Apps/Odin/core/strings/builder.odin(486:2)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    52 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    38 bytes at D:/Apps/Odin/core/os/dir_windows.odin(16:11)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    52 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    30 bytes at D:/Apps/Odin/core/path/filepath/path.odin(544:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    37 bytes at D:/Apps/Odin/core/os/dir_windows.odin(16:11)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    1088 bytes at D:/Apps/Odin/core/strings/builder.odin(486:2)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    39 bytes at D:/Apps/Odin/core/os/dir_windows.odin(16:11)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    50 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    7956 bytes at D:/Apps/Odin/core/strings/builder.odin(486:2)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    576 bytes at D:/Projects/odin/Engin3/engine/editor.odin(1711:5)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    68 bytes at D:/Projects/odin/Engin3/engine/editor.odin(1711:56)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    7200 bytes at D:/Apps/Odin/core/os/dir_windows.odin(77:9)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    96 bytes at D:/Projects/odin/Engin3/engine/editor.odin(1677:23)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    70 bytes at D:/Projects/odin/Engin3/engine/editor.odin(1711:56)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    37 bytes at D:/Apps/Odin/core/os/dir_windows.odin(16:11)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    604 bytes at D:/Apps/Odin/core/strings/builder.odin(486:2)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    106 bytes at D:/Apps/Odin/core/strings/builder.odin(486:2)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    604 bytes at D:/Apps/Odin/core/strings/builder.odin(486:2)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    70 bytes at D:/Projects/odin/Engin3/engine/editor.odin(1711:56)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    68 bytes at D:/Projects/odin/Engin3/engine/editor.odin(1711:56)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    52 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    70 bytes at D:/Projects/odin/Engin3/engine/editor.odin(1711:56)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    50 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    52 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    50 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    122 bytes at D:/Projects/odin/Engin3/engine/editor.odin(1711:56)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    37 bytes at D:/Apps/Odin/core/os/dir_windows.odin(16:11)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    52 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    3327 bytes at D:/Apps/Odin/core/strings/builder.odin(486:2)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    50 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    36 bytes at D:/Apps/Odin/core/os/dir_windows.odin(16:11)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    68 bytes at D:/Projects/odin/Engin3/engine/editor.odin(1711:56)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    75 bytes at D:/Projects/odin/Engin3/engine/editor.odin(1711:56)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    50 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
[WARN ] --- [engine] Leak detected!
[WARN ] --- [engine]    50 bytes at D:/Apps/Odin/core/path/slashpath/path.odin(233:10)
MineBill commented 4 months ago

Lol, i've written this message multiple times as you kept updating the post xD. Ok, so the meta program should be run automatically with engine as an argument, so i'm not sure why it wouldn't get it, make sure you don't run it manually. About the shader thing, it looks like the good 'ol different behavior on different vendors. I'm using different names for the input/output structs but use the same location and it looks like AMD allows this but NVIDIA does not. If you would like to fix this yourself for now you can rename all instances of VS_IN and IN to VS_OUT and OUT in all shaders. I'm planning to add shaderc to this project so i can compile the shaders to SPIR-V and produce binary opengl shaders that should be compatible with all vendors.

PS: The leaks are just stuff that i don't free at shutdown and are mostly one offs. Per-frame memory is managed using the temp allocator.

dezashibi commented 4 months ago

😅😅😅 oh sorry about that. Thanks for pointing that out, yes I will give it a go.

On Sun, Mar 31, 2024, 12:20 MineBill @.***> wrote:

Lol, i've written this message multiple times as you kept updating the post xD. Ok, so the meta program should be run automatically with engine as an argument, so i'm not sure why it wouldn't get it, make sure you don't run it manually. About the shader thing, it looks like the good 'ol different behavior on different vendors. I'm using different names for the input/output structs but use the same location and it looks like AMD allows this but NVIDIA is not. If you would like to fix this yourself for now you can rename all instances of VS_IN and IN to VS_OUT and OUT in all shaders. I'm planning to add shaderc to this project so i can compile the shaders to SPIR-V and produce binary opengl shaders that should be compatible with all vendors.

— Reply to this email directly, view it on GitHub https://github.com/MineBill/Engin3/issues/1#issuecomment-2028598105, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANVCKEA6QGBSLKRH2MSQZI3Y27BODAVCNFSM6AAAAABFQCKLYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYGU4TQMJQGU . You are receiving this because you authored the thread.Message ID: @.***>