janet-lang / janetui

Bindings to libui for janet
29 stars 10 forks source link

made it install via github cleanly at least on my machine #8

Open kamisori opened 4 months ago

kamisori commented 4 months ago

i have changed the build process a little and fixed it into being easily deploy-able, i would like to ask you to have a look over my changes, and if there are no other blockers against that, perhaps add janetui into the jpm package list?

assuming it's not just me that cant just jpm install https://github.com/janet-lang/janetui on these machines?

PS: havent actually run into the need to add --workers=1 when i install from my github repo

alsoalso: i am running this on ubuntu here 6.5.0-28-generic #29 so i guess i am also sheepishly asking for someone to recreate this on windows ^////^

sogaiu commented 4 months ago

I intend to look into trying on Windows soon. (Edit: it's taking a lot longer than expected to get a machine set up -- boggles the mind how long installation + updating can take for Windows...)

In the mean time though...made the following changes to make it work here:

diff --git a/main.c b/main.c
index 83f5d17..f3fb08c 100644
--- a/main.c
+++ b/main.c
@@ -20,7 +20,7 @@
 * IN THE SOFTWARE.
 */

-#include <janet/janet.h>
+#include <janet.h>

 #include <string.h>
 #include <stdlib.h>

Without this change I get:

$ jpm --verbose build
cc -c main.c -DJANET_BUILD_TYPE=release -std=c99 -Ilibui -Ilibui/unix -I/home/user/.local/include/janet -I/home/user/.local/lib/janet -O2 -fPIC -o build/main.o
generating meta file build/janetui.meta.janet...
main.c:23:10: fatal error: janet/janet.h: No such file or directory
   23 | #include <janet/janet.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
error: error: command failed with non-zero exit code 1
  in os/execute [src/core/os.c] on line 1377
  in shell [/home/user/.local/lib/janet/jpm/shutil.janet] (tailcall) on line 143, column 5
  in <anonymous> [/home/user/.local/lib/janet/jpm/rules.janet] on line 20, column 22
error: build fail
  in pdag [/home/user/.local/lib/janet/jpm/dagbuild.janet] (tailcall) on line 79, column 23
  in run-main [boot.janet] on line 3975, column 16
  in cli-main [boot.janet] on line 4128, column 17
sogaiu commented 4 months ago

Sorry, failed to install Windows today.

Will try again tomorrow.

kamisori commented 4 months ago

hm.. your change doesnt seem to break anything, so i wouldnt mind changing that include ^^

sogaiu commented 4 months ago

Haven't succeeded in building on Windows 10, though I've made a few attempts.

After getting cmake to do its thing (on Windows, it looks like it produces libui.lib instead of libui.a), I disabled that part of project.janet and tried to get the rest of the build to proceed.

In the process I got the following sort of output:

> jpm --verbose build
link.exe /OUT:build/janetui.dll build/main.o C:\Users\user\AppData\Local\Apps\Janet\C\\janet.lib /nologo libui/build/out/Debug/libui.lib /DLL
   Creating library build\janetui.lib and object build\janetui.exp
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
libui.lib(init.obj) : error LNK2019: unresolved external symbol __imp_CreateFontIndirectW referenced in function uiInit
libui.lib(init.obj) : error LNK2019: unresolved external symbol __imp_DeleteObject referenced in function uiUninit
libui.lib(image.obj) : error LNK2001: unresolved external symbol __imp_DeleteObject
libui.lib(parent.obj) : error LNK2001: unresolved external symbol __imp_DeleteObject
libui.lib(init.obj) : error LNK2019: unresolved external symbol __imp_GetStockObject referenced in function uiInit
libui.lib(init.obj) : error LNK2019: unresolved external symbol __imp_LoadCursorW referenced in function uiInit
libui.lib(init.obj) : error LNK2019: unresolved external symbol __imp_LoadIconW referenced in function uiInit
libui.lib(init.obj) : error LNK2019: unresolved external symbol __imp_SystemParametersInfoW referenced in function uiInit
libui.lib(areascroll.obj) : error LNK2001: unresolved external symbol __imp_SystemParametersInfoW
libui.lib(init.obj) : error LNK2019: unresolved external symbol __imp_CoUninitialize referenced in function uiUninit
libui.lib(init.obj) : error LNK2019: unresolved external symbol __imp_CoInitialize referenced in function uiInit
libui.lib(init.obj) : error LNK2019: unresolved external symbol __imp_InitCommonControlsEx referenced in function uiInitlibui.lib(image.obj) : error LNK2001: unresolved external symbol __imp__invalid_parameter
libui.lib(events.obj) : error LNK2001: unresolved external symbol __imp__invalid_parameter
libui.lib(radiobuttons.obj) : error LNK2001: unresolved external symbol __imp__invalid_parameter
libui.lib(alloc.obj) : error LNK2001: unresolved external symbol __imp__invalid_parameter
libui.lib(utf16.obj) : error LNK2001: unresolved external symbol __imp__invalid_parameter
libui.lib(draw.obj) : error LNK2001: unresolved external symbol __imp__invalid_parameter
libui.lib(main.obj) : error LNK2001: unresolved external symbol __imp__invalid_parameter
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp__invalid_parameter
libui.lib(box.obj) : error LNK2001: unresolved external symbol __imp__invalid_parameter
libui.lib(tab.obj) : error LNK2001: unresolved external symbol __imp__invalid_parameter
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_GetMessageW referenced in function "int __cdecl waitMessage(struct tagMSG *)" (?waitMessage@@YAHPEAUtagMSG@@@Z)
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_TranslateMessage referenced in function "void __cdecl processMessage(struct tagMSG *)" (?processMessage@@YAXPEAUtagMSG@@@Z)
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_DispatchMessageW referenced in function "void __cdecl processMessage(struct tagMSG *)" (?processMessage@@YAXPEAUtagMSG@@@Z)
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_PeekMessageW referenced in function "int __cdecl peekMessage(struct tagMSG *)" (?peekMessage@@YAHPEAUtagMSG@@@Z)
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_PostMessageW referenced in function uiQueueMain
libui.lib(editablecombo.obj) : error LNK2001: unresolved external symbol __imp_PostMessageW
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_PostQuitMessage referenced in function uiQuit
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_GetActiveWindow referenced in function "void __cdecl processMessage(struct tagMSG *)" (?processMessage@@YAXPEAUtagMSG@@@Z)
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_SetTimer referenced in function uiTimer
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_SetWindowsHookExW referenced in function "int __cdecl registerMessageFilter(void)" (?registerMessageFilter@@YAHXZ)
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_UnhookWindowsHookEx referenced in function "void __cdecl unregisterMessageFilter(void)" (?unregisterMessageFilter@@YAXXZ)
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_CallNextHookEx referenced in function "__int64 __cdecl filterProc(int,unsigned __int64,__int64)" (?filterProc@@YA_JH_K_J@Z)
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_IsDialogMessageW referenced in function "void __cdecl processMessage(struct tagMSG *)" (?processMessage@@YAXPEAUtagMSG@@@Z)
libui.lib(image.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libui.lib(events.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libui.lib(radiobuttons.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libui.lib(alloc.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libui.lib(utf16.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libui.lib(draw.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libui.lib(main.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libui.lib(box.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libui.lib(tab.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libui.lib(tabpage.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(control.cpp.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(text.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(parent.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(events.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(d2dscratch.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(area.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(winutil.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(areaevents.cpp.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(combobox.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(editablecombo.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(radiobuttons.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(multilineentry.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(tab.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(spinbox.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(slider.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(progressbar.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(button.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(checkbox.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(entry.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(area.obj) : error LNK2001: unresolved external symbol __imp_DefWindowProcW
libui.lib(container.obj) : error LNK2001: unresolved external symbol __imp_DefWindowProcW
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_DefWindowProcW
libui.lib(group.obj) : error LNK2001: unresolved external symbol __imp_DefWindowProcW
libui.lib(utilwin.obj) : error LNK2001: unresolved external symbol __imp_DefWindowProcW
libui.lib(d2dscratch.obj) : error LNK2001: unresolved external symbol __imp_DefWindowProcW
libui.lib(container.obj) : error LNK2001: unresolved external symbol __imp_RegisterClassW
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_RegisterClassW
libui.lib(utilwin.obj) : error LNK2001: unresolved external symbol __imp_RegisterClassW
libui.lib(d2dscratch.obj) : error LNK2001: unresolved external symbol __imp_RegisterClassW
libui.lib(area.obj) : error LNK2001: unresolved external symbol __imp_RegisterClassW
libui.lib(container.obj) : error LNK2001: unresolved external symbol __imp_UnregisterClassW
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_UnregisterClassW
libui.lib(utilwin.obj) : error LNK2001: unresolved external symbol __imp_UnregisterClassW
libui.lib(d2dscratch.obj) : error LNK2001: unresolved external symbol __imp_UnregisterClassW
libui.lib(area.obj) : error LNK2001: unresolved external symbol __imp_UnregisterClassW
libui.lib(control.cpp.obj) : error LNK2001: unresolved external symbol __imp_CreateWindowExW
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_CreateWindowExW
libui.lib(spinbox.obj) : error LNK2001: unresolved external symbol __imp_CreateWindowExW
libui.lib(utilwin.obj) : error LNK2001: unresolved external symbol __imp_CreateWindowExW
libui.lib(d2dscratch.obj) : error LNK2001: unresolved external symbol __imp_CreateWindowExW
libui.lib(area.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(tabpage.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(combobox.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(editablecombo.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(radiobuttons.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(multilineentry.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(spinbox.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(slider.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(progressbar.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(separator.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(entry.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(label.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(tab.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(group.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(button.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(box.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(checkbox.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(window.obj) : error LNK2019: unresolved external symbol __imp_SetWindowPos referenced in function uiWindowSetContentSize
libui.lib(winutil.obj) : error LNK2001: unresolved external symbol __imp_SetWindowPos
libui.lib(winpublic.obj) : error LNK2001: unresolved external symbol __imp_SetWindowPos
libui.lib(window.obj) : error LNK2019: unresolved external symbol __imp_GetWindowPlacement referenced in function uiWindowSetFullscreen
libui.lib(window.obj) : error LNK2019: unresolved external symbol __imp_SetWindowPlacement referenced in function uiWindowSetFullscreen
libui.lib(area.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(editablecombo.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(radiobuttons.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(multilineentry.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(utilwin.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(slider.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(progressbar.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(separator.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(combobox.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(label.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(tab.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(group.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(spinbox.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(button.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(checkbox.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(entry.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(window.obj) : error LNK2019: unresolved external symbol __imp_GetSystemMetrics referenced in function "void __cdecl windowMonitorRect(struct HWND__ *,struct tagRECT *)" (?windowMonitorRect@@YAXPEAUHWND__@@PEAUtagRECT@@@Z)
libui.lib(button.obj) : error LNK2001: unresolved external symbol __imp_GetSystemMetrics
libui.lib(areaevents.cpp.obj) : error LNK2001: unresolved external symbol __imp_GetSystemMetrics
libui.lib(window.obj) : error LNK2019: unresolved external symbol __imp_SetMenu referenced in function uiNewWindow
libui.lib(window.obj) : error LNK2019: unresolved external symbol __imp_UpdateWindow referenced in function "void __cdecl uiWindowShow(struct uiControl *)" (?uiWindowShow@@YAXPEAUuiControl@@@Z)
libui.lib(window.obj) : error LNK2019: unresolved external symbol __imp_AdjustWindowRectEx referenced in function "void __cdecl setClientSize(struct uiWindow *,int,int,int,unsigned long,unsigned long)" (?setClientSize@@YAXPEAUuiWindow@@HHHKK@Z)
libui.lib(winutil.obj) : error LNK2001: unresolved external symbol __imp_AdjustWindowRectEx
libui.lib(container.obj) : error LNK2001: unresolved external symbol __imp_GetWindowLongPtrW
libui.lib(winutil.obj) : error LNK2001: unresolved external symbol __imp_GetWindowLongPtrW
libui.lib(tabpage.obj) : error LNK2001: unresolved external symbol __imp_GetWindowLongPtrW
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_GetWindowLongPtrW
libui.lib(editablecombo.obj) : error LNK2001: unresolved external symbol __imp_GetWindowLongPtrW
libui.lib(d2dscratch.obj) : error LNK2001: unresolved external symbol __imp_GetWindowLongPtrW
libui.lib(area.obj) : error LNK2001: unresolved external symbol __imp_GetWindowLongPtrW
libui.lib(winutil.obj) : error LNK2001: unresolved external symbol __imp_SetWindowLongPtrW
libui.lib(winpublic.obj) : error LNK2001: unresolved external symbol __imp_SetWindowLongPtrW
libui.lib(tabpage.obj) : error LNK2001: unresolved external symbol __imp_SetWindowLongPtrW
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_SetWindowLongPtrW
libui.lib(d2dscratch.obj) : error LNK2001: unresolved external symbol __imp_SetWindowLongPtrW
libui.lib(area.obj) : error LNK2001: unresolved external symbol __imp_SetWindowLongPtrW
libui.lib(container.obj) : error LNK2001: unresolved external symbol __imp_SetWindowLongPtrW
libui.lib(window.obj) : error LNK2019: unresolved external symbol __imp_MonitorFromWindow referenced in function "void __cdecl windowMonitorRect(struct HWND__ *,struct tagRECT *)" (?windowMonitorRect@@YAXPEAUHWND__@@PEAUtagRECT@@@Z)
libui.lib(window.obj) : error LNK2019: unresolved external symbol __imp_GetMonitorInfoW referenced in function "void __cdecl windowMonitorRect(struct HWND__ *,struct tagRECT *)" (?windowMonitorRect@@YAXPEAUHWND__@@PEAUtagRECT@@@Z)
libui.lib(entry.obj) : error LNK2019: unresolved external symbol __imp_SetWindowTheme referenced in function uiNewSearchEntry
libui.lib(group.obj) : error LNK2019: unresolved external symbol SetWindowSubclass referenced in function uiNewGroup
libui.lib(d2dscratch.obj) : error LNK2001: unresolved external symbol SetWindowSubclass
libui.lib(group.obj) : error LNK2019: unresolved external symbol RemoveWindowSubclass referenced in function "__int64 __cdecl groupSubProc(struct HWND__ *,unsigned int,unsigned __int64,__int64,unsigned __int64,unsigned __int64)" (?groupSubProc@@YA_JPEAUHWND__@@I_K_J11@Z)
libui.lib(group.obj) : error LNK2019: unresolved external symbol DefSubclassProc referenced in function "__int64 __cdecl groupSubProc(struct HWND__ *,unsigned int,unsigned __int64,__int64,unsigned __int64,unsigned __int64)" (?groupSubProc@@YA_JPEAUHWND__@@I_K_J11@Z)
libui.lib(menu.obj) : error LNK2019: unresolved external symbol __imp_CreateMenu referenced in function "struct HMENU__ * __cdecl makeMenubar(void)" (?makeMenubar@@YAPEAUHMENU__@@XZ)
libui.lib(menu.obj) : error LNK2019: unresolved external symbol __imp_CreatePopupMenu referenced in function "struct HMENU__ * __cdecl makeMenu(struct uiMenu *)" (?makeMenu@@YAPEAUHMENU__@@PEAUuiMenu@@@Z)
libui.lib(menu.obj) : error LNK2019: unresolved external symbol __imp_AppendMenuW referenced in function "struct HMENU__ * __cdecl makeMenubar(void)" (?makeMenubar@@YAPEAUHMENU__@@XZ)
libui.lib(menu.obj) : error LNK2019: unresolved external symbol __imp_GetMenuItemInfoW referenced in function "void __cdecl freeMenubar(struct HMENU__ *)" (?freeMenubar@@YAXPEAUHMENU__@@@Z)
libui.lib(menu.obj) : error LNK2019: unresolved external symbol __imp_SetMenuItemInfoW referenced in function "void __cdecl sync(struct uiMenuItem *)" (?sync@@YAXPEAUuiMenuItem@@@Z)
libui.lib(stddialogs.obj) : error LNK2019: unresolved external symbol __imp_CoCreateInstance referenced in function "char * __cdecl commonItemDialog(struct HWND__ *,struct _GUID const &,struct _GUID const &,unsigned long)" (?commonItemDialog@@YAPEADPEAUHWND__@@AEBU_GUID@@1K@Z)
libui.lib(image.obj) : error LNK2001: unresolved external symbol __imp_CoCreateInstance
libui.lib(stddialogs.obj) : error LNK2019: unresolved external symbol __imp_CoTaskMemFree referenced in function "char * __cdecl commonItemDialog(struct HWND__ *,struct _GUID const &,struct _GUID const &,unsigned long)" (?commonItemDialog@@YAPEADPEAUHWND__@@AEBU_GUID@@1K@Z)
libui.lib(stddialogs.obj) : error LNK2019: unresolved external symbol __imp_TaskDialog referenced in function "void __cdecl msgbox(struct HWND__ *,char const *,char const *,int,wchar_t const *)" (?msgbox@@YAXPEAUHWND__@@PEBD1HPEB_W@Z)
libui.lib(utilwin.obj) : error LNK2019: unresolved external symbol __imp_DestroyWindow referenced in function "void __cdecl uninitUtilWindow(void)" (?uninitUtilWindow@@YAXXZ)
libui.lib(winpublic.obj) : error LNK2001: unresolved external symbol __imp_DestroyWindow
libui.lib(utilwin.obj) : error LNK2019: unresolved external symbol __imp_KillTimer referenced in function "__int64 __cdecl utilWindowWndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?utilWindowWndProc@@YA_JPEAUHWND__@@I_K_J@Z)
libui.lib(d2dscratch.obj) : error LNK2019: unresolved external symbol __imp_ValidateRect referenced in function "__int64 __cdecl d2dScratchWndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?d2dScratchWndProc@@YA_JPEAUHWND__@@I_K_J@Z)
libui.lib(areadraw.obj) : error LNK2001: unresolved external symbol __imp_ValidateRect
libui.lib(d2dscratch.obj) : error LNK2019: unresolved external symbol __imp_GetSysColor referenced in function "long __cdecl d2dScratchDoPaint(struct HWND__ *,struct ID2D1RenderTarget *)" (?d2dScratchDoPaint@@YAJPEAUHWND__@@PEAUID2D1RenderTarget@@@Z)
libui.lib(areadraw.obj) : error LNK2001: unresolved external symbol __imp_GetSysColor
libui.lib(area.obj) : error LNK2019: unresolved external symbol __imp_ReleaseCapture referenced in function uiAreaBeginUserWindowMove
libui.lib(areaevents.cpp.obj) : error LNK2001: unresolved external symbol __imp_ReleaseCapture
libui.lib(container.obj) : error LNK2019: unresolved external symbol __imp_BeginPaint referenced in function "__int64 __cdecl containerWndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?containerWndProc@@YA_JPEAUHWND__@@I_K_J@Z)
libui.lib(container.obj) : error LNK2019: unresolved external symbol __imp_EndPaint referenced in function "__int64 __cdecl containerWndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?containerWndProc@@YA_JPEAUHWND__@@I_K_J@Z)
libui.lib(draw.obj) : error LNK2019: unresolved external symbol __imp_GetDeviceCaps referenced in function "struct ID2D1HwndRenderTarget * __cdecl makeHWNDRenderTarget(struct HWND__ *)" (?makeHWNDRenderTarget@@YAPEAUID2D1HwndRenderTarget@@PEAUHWND__@@@Z)
libui.lib(image.obj) : error LNK2001: unresolved external symbol __imp_GetDeviceCaps
libui.lib(draw.obj) : error LNK2019: unresolved external symbol __imp_GetDC referenced in function "struct ID2D1HwndRenderTarget * __cdecl makeHWNDRenderTarget(struct HWND__ *)" (?makeHWNDRenderTarget@@YAPEAUID2D1HwndRenderTarget@@PEAUHWND__@@@Z)
libui.lib(text.obj) : error LNK2001: unresolved external symbol __imp_GetDC
libui.lib(sizing.obj) : error LNK2001: unresolved external symbol __imp_GetDC
libui.lib(draw.obj) : error LNK2019: unresolved external symbol __imp_ReleaseDC referenced in function "struct ID2D1HwndRenderTarget * __cdecl makeHWNDRenderTarget(struct HWND__ *)" (?makeHWNDRenderTarget@@YAPEAUID2D1HwndRenderTarget@@PEAUHWND__@@@Z)
libui.lib(text.obj) : error LNK2001: unresolved external symbol __imp_ReleaseDC
libui.lib(sizing.obj) : error LNK2001: unresolved external symbol __imp_ReleaseDC
libui.lib(draw.obj) : error LNK2019: unresolved external symbol D2D1CreateFactory referenced in function "long __cdecl initDraw(void)" (?initDraw@@YAJXZ)
libui.lib(image.obj) : error LNK2019: unresolved external symbol __imp_CreateDIBSection referenced in function "long __cdecl uiprivWICToGDI(struct IWICBitmap *,struct HDC__ *,int,int,struct HBITMAP__ * *)" (?uiprivWICToGDI@@YAJPEAUIWICBitmap@@PEAUHDC__@@HHPEAPEAUHBITMAP__@@@Z)
libui.lib(image.obj) : error LNK2019: unresolved external symbol __imp_GetObjectW referenced in function "long __cdecl uiprivWICToGDI(struct IWICBitmap *,struct HDC__ *,int,int,struct HBITMAP__ * *)" (?uiprivWICToGDI@@YAJPEAUIWICBitmap@@PEAUHDC__@@HHPEAPEAUHBITMAP__@@@Z)
libui.lib(image.obj) : error LNK2001: unresolved external symbol IID_IWICImagingFactory
libui.lib(dwrite.obj) : error LNK2019: unresolved external symbol __imp_DWriteCreateFactory referenced in function "long __cdecl uiprivInitDrawText(void)" (?uiprivInitDrawText@@YAJXZ)
libui.lib(winutil.obj) : error LNK2019: unresolved external symbol __imp_GetDlgItem referenced in function "struct HWND__ * __cdecl getDlgItem(struct HWND__ *,int)" (?getDlgItem@@YAPEAUHWND__@@PEAU1@H@Z)
libui.lib(winutil.obj) : error LNK2019: unresolved external symbol __imp_InvalidateRect referenced in function "void __cdecl invalidateRect(struct HWND__ *,struct tagRECT *,int)" (?invalidateRect@@YAXPEAUHWND__@@PEAUtagRECT@@H@Z)
libui.lib(winutil.obj) : error LNK2019: unresolved external symbol __imp_MapWindowPoints referenced in function "void __cdecl mapWindowRect(struct HWND__ *,struct HWND__ *,struct tagRECT *)" (?mapWindowRect@@YAXPEAUHWND__@@0PEAUtagRECT@@@Z)libui.lib(winutil.obj) : error LNK2019: unresolved external symbol __imp_GetClassNameW referenced in function "int __cdecl windowClassOf(struct HWND__ *,...)" (?windowClassOf@@YAHPEAUHWND__@@ZZ)
libui.lib(winutil.obj) : error LNK2019: unresolved external symbol __imp_GetAncestor referenced in function "struct HWND__ * __cdecl parentOf(struct HWND__ *)" (?parentOf@@YAPEAUHWND__@@PEAU1@@Z)
libui.lib(areaevents.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetMessageTime referenced in function "void __cdecl areaMouseEvent(struct uiArea *,int,int,unsigned __int64,__int64)" (?areaMouseEvent@@YAXPEAUuiArea@@HH_K_J@Z)libui.lib(areaevents.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetDoubleClickTime referenced in function "void __cdecl areaMouseEvent(struct uiArea *,int,int,unsigned __int64,__int64)" (?areaMouseEvent@@YAXPEAUuiArea@@HH_K_J@Z)
libui.lib(areaevents.cpp.obj) : error LNK2019: unresolved external symbol __imp_SetFocus referenced in function "int __cdecl areaDoEvents(struct uiArea *,unsigned int,unsigned __int64,__int64,__int64 *)" (?areaDoEvents@@YAHPEAUuiArea@@I_K_JPEA_J@Z)
libui.lib(areaevents.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetKeyState referenced in function "unsigned int __cdecl getModifiers(void)" (?getModifiers@@YAIXZ)
libui.lib(areaevents.cpp.obj) : error LNK2019: unresolved external symbol __imp_SetCapture referenced in function "void __cdecl capture(struct uiArea *,int)" (?capture@@YAXPEAUuiArea@@H@Z)
libui.lib(areaevents.cpp.obj) : error LNK2019: unresolved external symbol __imp_PtInRect referenced in function "void __cdecl areaMouseEvent(struct uiArea *,int,int,unsigned __int64,__int64)" (?areaMouseEvent@@YAXPEAUuiArea@@HH_K_J@Z)
libui.lib(areaevents.cpp.obj) : error LNK2019: unresolved external symbol __imp__TrackMouseEvent referenced in function "void __cdecl track(struct uiArea *,int)" (?track@@YAXPEAUuiArea@@H@Z)
libui.lib(winpublic.obj) : error LNK2019: unresolved external symbol __imp_GetClientRect referenced in function uiWindowsEnsureGetClientRect
libui.lib(winpublic.obj) : error LNK2019: unresolved external symbol __imp_GetWindowRect referenced in function uiWindowsEnsureGetWindowRect
libui.lib(winpublic.obj) : error LNK2019: unresolved external symbol __imp_SetParent referenced in function uiWindowsEnsureSetParentHWND
libui.lib(text.obj) : error LNK2019: unresolved external symbol __imp_GetTextExtentPoint32W referenced in function uiWindowsWindowTextWidth
libui.lib(sizing.obj) : error LNK2001: unresolved external symbol __imp_GetTextExtentPoint32W
libui.lib(text.obj) : error LNK2019: unresolved external symbol __imp_SelectObject referenced in function uiWindowsWindowTextWidth
libui.lib(sizing.obj) : error LNK2001: unresolved external symbol __imp_SelectObject
libui.lib(parent.obj) : error LNK2001: unresolved external symbol __imp_SelectObject
libui.lib(text.obj) : error LNK2019: unresolved external symbol __imp_SetWindowTextW referenced in function "void __cdecl setWindowText(struct HWND__ *,wchar_t *)" (?setWindowText@@YAXPEAUHWND__@@PEA_W@Z)
libui.lib(text.obj) : error LNK2019: unresolved external symbol __imp_GetWindowTextW referenced in function "wchar_t * __cdecl windowTextAndLen(struct HWND__ *,__int64 *)" (?windowTextAndLen@@YAPEA_WPEAUHWND__@@PEA_J@Z)
libui.lib(sizing.obj) : error LNK2019: unresolved external symbol __imp_GetTextMetricsW referenced in function "void __cdecl getSizing(struct HWND__ *,struct uiWindowsSizing *,struct HFONT__ *)" (?getSizing@@YAXPEAUHWND__@@PEAUuiWindowsSizing@@PEAUHFONT__@@@Z)
libui.lib(parent.obj) : error LNK2019: unresolved external symbol __imp_BitBlt referenced in function "void __cdecl paintContainerBackground(struct HWND__ *,struct HDC__ *,struct tagRECT *)" (?paintContainerBackground@@YAXPEAUHWND__@@PEAUHDC__@@PEAUtagRECT@@@Z)
libui.lib(parent.obj) : error LNK2019: unresolved external symbol __imp_CreateCompatibleBitmap referenced in function "long __cdecl parentDraw(struct HDC__ *,struct HWND__ *,struct parentDraw *)" (?parentDraw@@YAJPEAUHDC__@@PEAUHWND__@@PEAU0@@Z)
libui.lib(parent.obj) : error LNK2019: unresolved external symbol __imp_CreateCompatibleDC referenced in function "long __cdecl parentDraw(struct HDC__ *,struct HWND__ *,struct parentDraw *)" (?parentDraw@@YAJPEAUHDC__@@PEAUHWND__@@PEAU0@@Z)
libui.lib(parent.obj) : error LNK2019: unresolved external symbol __imp_CreatePatternBrush referenced in function "struct HBRUSH__ * __cdecl getControlBackgroundBrush(struct HWND__ *,struct HDC__ *)" (?getControlBackgroundBrush@@YAPEAUHBRUSH__@@PEAUHWND__@@PEAUHDC__@@@Z)
libui.lib(parent.obj) : error LNK2019: unresolved external symbol __imp_DeleteDC referenced in function "void __cdecl endParentDraw(struct parentDraw *)" (?endParentDraw@@YAXPEAUparentDraw@@@Z)
libui.lib(parent.obj) : error LNK2019: unresolved external symbol __imp_SetBkMode referenced in function "int __cdecl handleParentMessages(struct HWND__ *,unsigned int,unsigned __int64,__int64,__int64 *)" (?handleParentMessages@@YAHPEAUHWND__@@I_K_JPEA_J@Z)
libui.lib(parent.obj) : error LNK2019: unresolved external symbol __imp_SetBrushOrgEx referenced in function "struct HBRUSH__ * __cdecl getControlBackgroundBrush(struct HWND__ *,struct HDC__ *)" (?getControlBackgroundBrush@@YAPEAUHBRUSH__@@PEAUHWND__@@PEAUHDC__@@@Z)
libui.lib(events.obj) : error LNK2019: unresolved external symbol __imp_IsChild referenced in function "int __cdecl shouldRun(struct HWND__ *,int (__cdecl*)(struct uiControl *,struct HWND__ *,unsigned short,__int64 *))" (??$shouldRun@P6AHPEAUuiControl@@PEAUHWND__@@GPEA_J@Z@@YAHPEAUHWND__@@P6AHPEAUuiControl@@0GPEA_J@Z@Z)
libui.lib(tabpage.obj) : error LNK2019: unresolved external symbol __imp_CreateDialogIndirectParamW referenced in function "struct tabPage * __cdecl newTabPage(struct uiControl *)" (?newTabPage@@YAPEAUtabPage@@PEAUuiControl@@@Z)
libui.lib(tabpage.obj) : error LNK2019: unresolved external symbol __imp_EnableThemeDialogTexture referenced in function "struct tabPage * __cdecl newTabPage(struct uiControl *)" (?newTabPage@@YAPEAUtabPage@@PEAUuiControl@@@Z)
libui.lib(areadraw.obj) : error LNK2019: unresolved external symbol __imp_GetUpdateRect referenced in function "void __cdecl onWM_PAINT(struct uiArea *)" (?onWM_PAINT@@YAXPEAUuiArea@@@Z)
libui.lib(areascroll.obj) : error LNK2019: unresolved external symbol __imp_SetScrollInfo referenced in function "void __cdecl scrollto(struct uiArea *,int,struct scrollParams *,int)" (?scrollto@@YAXPEAUuiArea@@HPEAUscrollParams@@H@Z)
libui.lib(areascroll.obj) : error LNK2019: unresolved external symbol __imp_GetScrollInfo referenced in function "void __cdecl scroll(struct uiArea *,int,struct scrollParams *,unsigned __int64,__int64)" (?scroll@@YAXPEAUuiArea@@HPEAUscrollParams@@_K_J@Z)
libui.lib(drawmatrix.obj) : error LNK2019: unresolved external symbol D2D1MakeRotateMatrix referenced in function "public: static class D2D1::Matrix3x2F __cdecl D2D1::Matrix3x2F::Rotation(float,struct D2D_POINT_2F)" (?Rotation@Matrix3x2F@D2D1@@SA?AV12@MUD2D_POINT_2F@@@Z)
libui.lib(drawmatrix.obj) : error LNK2019: unresolved external symbol D2D1MakeSkewMatrix referenced in function "public: static class D2D1::Matrix3x2F __cdecl D2D1::Matrix3x2F::Skew(float,float,struct D2D_POINT_2F)" (?Skew@Matrix3x2F@D2D1@@SA?AV12@MMUD2D_POINT_2F@@@Z)
libui.lib(drawmatrix.obj) : error LNK2019: unresolved external symbol D2D1IsMatrixInvertible referenced in function uiDrawMatrixInvertible
libui.lib(drawmatrix.obj) : error LNK2019: unresolved external symbol D2D1InvertMatrix referenced in function uiDrawMatrixInvert
build\janetui.dll : fatal error LNK1120: 105 unresolved externals
error: error: command failed with non-zero exit code 1120
  in errorf [boot.janet] on line 159, column 3
  in drop1-shell [C:/Users/user/AppData/Local/Apps/Janet/Library/jpm/shutil.janet] (tailcall) on line 184, column 5
  in  [C:/Users/user/AppData/Local/Apps/Janet/Library/jpm/rules.janet] on line 20, column 22
error: build fail
  in pdag [C:/Users/user/AppData/Local/Apps/Janet/Library/jpm/dagbuild.janet] (tailcall) on line 79, column 23
  in run-main [boot.janet] on line 3975, column 16
  in cli-main [boot.janet] on line 4150, column 17

I tried adding some things to link to (e.g. user32.lib [1]) one by one and got to the point where build\libui.dll gets created.

However, trying to use it from janet yields a dialog that says something like:

The ordinal 344 could not be the located in the dynamic link library C:\Users\user\Desktop\janetui.kamisori\build\janetui.dll.

Not sure what to do at this point (^^;


On a side note, I thought I'd heard of a successor to libui...may be it's this. That uses meson and looks like it is seeing some active development. I think one of the committers (cody271) has shown up on at least one of the janet gitter / matrix channels before. I wonder if it's worth checking that out...


[1] Changed the :flags default portion to be something like:

'[ 
  "libui/build/out/Debug/libui.lib"
   "/NODEFAULTLIB:MSVCRTD"
   "user32.lib"
   "gdi32.lib"
   "Ole32.lib"
   "Comctl32.lib"
   "UxTheme.lib"
   "D2d1.lib"
   "Dwrite.lib"
   "windowscodecs.lib"
   "ucrtd.lib"
  ]
kamisori commented 4 months ago

hm, i tried to compile it under windows, basically have now copied what you sogaiu have and am also banging my head against ordinal 344... seems to be something with manifests and not linking the correct version of comctl32 (needs 6.0, default is 5.8), except the manifest is written correctly as far as i can see, perhaps manifest isnt placed in the correct directory though, compilation runs smooth, just when loading the dll it gives that ordinal 344 error.

https://stackoverflow.com/questions/43426776/the-ordinal-344-could-not-be-located-in-the-dynamic-link-library

i'll try ng next, though i think it will yield similar results for windows..