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

Can`t assemble from src in msvs win #650

Closed
sevstels opened this issue Jun 14, 2024 · 2 comments
Closed

Can`t assemble from src in msvs win #650

sevstels opened this issue Jun 14, 2024 · 2 comments

Comments

@sevstels
Copy link

sevstels commented Jun 14, 2024

Nuklear\src\nuklear_property.c(178): warning C4013: 'NK_DTOA' undefined; assuming extern returning int
Nuklear\src\nuklear_page_element.c(25): warning C4116: unnamed type definition in parentheses
Nuklear\src\nuklear_draw.c(39): warning C4116: unnamed type definition in parentheses
error LNK2019: unresolved external symbol NK_DTOA referenced in function nk_do_property

Something is wrong in the "nuklear_util.c" file. The compiler cannot build it.
The same happens with next functions.
They have to be redefined, and only in this case the build is successful
#define NK_MEMCPY memcpy
#define NK_MEMSET memset

Nuklear\src\nuklear_page_element.c(25): warning C4116: unnamed type definition in parentheses
Nuklear\src\nuklear_draw.c(39): warning C4116: unnamed type definition in parentheses

nuklear_glfw_gl3.h(48): error C2079: 'nk_glfw::atlas' uses undefined struct 'nk_font_atlas'

@sevstels
Copy link
Author

Incorrectly made "nuklear.h" header!
It is impossible to compile C code in a C++ project. Because an array of errors occurs:

1>gui.obj : error LNK2019: unresolved external symbol nk_buffer_init_default referenced in function nk_glfw3_device_create
1>gui.obj : error LNK2019: unresolved external symbol nk__draw_next referenced in function nk_glfw3_render
1>gui.obj : error LNK2019: unresolved external symbol nk__draw_begin referenced in function nk_glfw3_render
1>gui.obj : error LNK2019: unresolved external symbol nk_convert referenced in function nk_glfw3_render
1>gui.obj : error LNK2019: unresolved external symbol nk_init_default referenced in function nk_glfw3_init
1>gui.obj : error LNK2019: unresolved external symbol nk_font_atlas_begin referenced in function nk_glfw3_font_stash_begin
1>gui.obj : error LNK2019: unresolved external symbol nk_font_atlas_init_default referenced in function nk_glfw3_font_stash_begin
1>gui.obj : error LNK2019: unresolved external symbol nk_font_atlas_end referenced in function nk_glfw3_font_stash_end
1>gui.obj : error LNK2019: unresolved external symbol nk_font_atlas_bake referenced in function nk_glfw3_font_stash_end
1>gui.obj : error LNK2019: unresolved external symbol nk_font_atlas_clear referenced in function nk_glfw3_shutdown
1>fatal error LNK1120: 10 unresolved externals

The compiler cannot build the application if you do not declare: extern "C" { #include "nuklear.h"}
But in this case other errors occur.
Because templates are included in the header and this is not a C language, but C++

nuklear.h(5595): error C2894: templates cannot be declared to have 'C' linkage
nuklear.h(5596): error C2894: templates cannot be declared to have 'C' linkage
nuklear.h(5597): error C2894: templates cannot be declared to have 'C' linkage
nuklear.h(5598): error C2894: templates cannot be declared to have 'C' linkage

The extern "C" directive does not allow to compile such a header. As a result, we have an unsolvable situation....

@RobLoach
Copy link
Contributor

I think this is fixed with the latest rebuild.

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

2 participants