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

Alpha-4 static MSVC2017 doesn't work with cl #412

Open
hanyuone opened this issue Aug 17, 2018 · 8 comments
Open

Alpha-4 static MSVC2017 doesn't work with cl #412

hanyuone opened this issue Aug 17, 2018 · 8 comments
Milestone

Comments

@hanyuone
Copy link

hanyuone commented Aug 17, 2018

I'm using the x64 Native Tools Command Prompt for VS 2017, and I'm trying to convert a .o file generated via Crystal code (code here, the .o file generated using these instructions).

I have the libui.lib from the release file for 64-bit VS 2017, and I've copied it into C:\Crystal, along with other lib files required for Crystal (gc.lib, pcre.lib) and control_gallery.o. However, once I run the cl command, it doesn't work and raises LNK2001 and LNK2019 errors.

Here is my folder structure:

error

Here is the full error log:

C:\Crystal>cl control_gallery.o /Fecontrol_gallery gc.lib pcre.lib libui.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.15.26726 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9024 : unrecognized source file type 'control_gallery.o', object file assumed
Microsoft (R) Incremental Linker Version 14.15.26726.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:control_gallery.exe
control_gallery.o
gc.lib
pcre.lib
libui.lib
   Creating library control_gallery.lib and object control_gallery.exp
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
libui.lib(image.obj) : warning LNK4049: locally defined symbol _invalid_parameter_noinfo_noreturn imported
libui.lib(events.obj) : warning LNK4049: locally defined symbol _invalid_parameter_noinfo_noreturn imported
libui.lib(fontmatch.obj) : warning LNK4217: locally defined symbol _invalid_parameter_noinfo_noreturn imported in function "protected: void __cdecl std::_Tree<class std::_Tmap_traits<unsigned int,enum DWRITE_FONT_STYLE,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,enum DWRITE_FONT_STYLE> >,0> >::_Erase(struct std::_Tree_node<struct std::pair<unsigned int const ,enum DWRITE_FONT_STYLE>,void *> *)" (?_Erase@?$_Tree@V?$_Tmap_traits@IW4DWRITE_FONT_STYLE@@U?$less@I@std@@V?$allocator@U?$pair@$$CBIW4DWRITE_FONT_STYLE@@@std@@@3@$0A@@std@@@std@@IEAAXPEAU?$_Tree_node@U?$pair@$$CBIW4DWRITE_FONT_STYLE@@@std@@PEAX@2@@Z)
libui.lib(colordialog.obj) : warning LNK4217: locally defined symbol _invalid_parameter_noinfo_noreturn imported in function "__int64 __cdecl hSliderSubProc(struct HWND__ *,unsigned int,unsigned __int64,__int64,unsigned __int64,unsigned __int64)" (?hSliderSubProc@@YA_JPEAUHWND__@@I_K_J11@Z)
libui.lib(tab.obj) : warning LNK4049: locally defined symbol _invalid_parameter_noinfo_noreturn imported
libui.lib(alloc.obj) : warning LNK4049: locally defined symbol _invalid_parameter_noinfo_noreturn imported
libui.lib(utf16.obj) : warning LNK4049: locally defined symbol _invalid_parameter_noinfo_noreturn imported
libui.lib(draw.obj) : warning LNK4049: locally defined symbol _invalid_parameter_noinfo_noreturn imported
libui.lib(window.obj) : warning LNK4217: locally defined symbol _invalid_parameter_noinfo_noreturn imported in function "public: void __cdecl std::allocator<struct std::_Tree_node<struct std::pair<struct uiWindow * const,bool>,void *> >::deallocate(struct std::_Tree_node<struct std::pair<struct uiWindow * const,bool>,void *> * const,unsigned __int64)" (?deallocate@?$allocator@U?$_Tree_node@U?$pair@QEAUuiWindow@@_N@std@@PEAX@std@@@std@@QEAAXQEAU?$_Tree_node@U?$pair@QEAUuiWindow@@_N@std@@PEAX@2@_K@Z)
libui.lib(main.obj) : warning LNK4049: locally defined symbol _invalid_parameter_noinfo_noreturn imported
libui.lib(box.obj) : warning LNK4049: locally defined symbol _invalid_parameter_noinfo_noreturn imported
libui.lib(radiobuttons.obj) : warning LNK4049: locally defined symbol _invalid_parameter_noinfo_noreturn imported
libui.lib(utf16.obj) : warning LNK4217: locally defined symbol wcscpy_s imported in function "wchar_t * __cdecl utf16dup(wchar_t const *)" (?utf16dup@@YAPEA_WPEB_W@Z)
libui.lib(utf16.obj) : warning LNK4217: locally defined symbol __stdio_common_vswprintf imported in function "wchar_t * __cdecl strf(wchar_t const *,...)" (?strf@@YAPEA_WPEB_WZZ)
libui.lib(fontdialog.obj) : warning LNK4049: locally defined symbol __stdio_common_vswprintf imported
libui.lib(utf16.obj) : warning LNK4217: locally defined symbol __stdio_common_vswprintf_s imported in function "wchar_t * __cdecl strf(wchar_t const *,...)" (?strf@@YAPEA_WPEB_WZZ)
libui.lib(debug.cpp.obj) : warning LNK4217: locally defined symbol __stdio_common_vsprintf imported in function uiprivRealBug
libui.lib(debug.cpp.obj) : warning LNK4217: locally defined symbol __stdio_common_vsprintf_s imported in function uiprivRealBug
libui.lib(text.obj) : warning LNK4217: locally defined symbol _wcsicmp imported in function uiprivStricmp
libui.lib(winutil.obj) : warning LNK4049: locally defined symbol _wcsicmp imported
libui.lib(colordialog.obj) : warning LNK4217: locally defined symbol _wtoi imported in function "void __cdecl aIntChanged(struct colorDialog *)" (?aIntChanged@@YAXPEAUcolorDialog@@@Z)
control_gallery.o : error LNK2019: unresolved external symbol SystemFunction036 referenced in function .2A.Slice.28.UInt8.29..40.Slice.28.T.29..23.initialize.3C.Pointer.28.UInt8.29..2C..20.Int32.3E..3A.Int32
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 uiInit
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 makeMenubar(void)" (?makeMenubar@@YAPEAUHMENU__@@XZ)
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(tabpage.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(areaevents.cpp.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(events.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(fontdialog.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(colordialog.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(winutil.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(parent.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(radiobuttons.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(tab.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(slider.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(progressbar.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(datetimepicker.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(fontbutton.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(colorbutton.obj) : error LNK2001: unresolved external symbol __imp_SendMessageW
libui.lib(spinbox.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(radiobuttons.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(tab.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(area.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(tabpage.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(combobox.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(editablecombo.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(datetimepicker.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(fontbutton.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(colorbutton.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(spinbox.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(checkbox.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(separator.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(box.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(group.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(button.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
libui.lib(window.obj) : error LNK2019: unresolved external symbol __imp_SetWindowPos referenced in function "void __cdecl ensureMinimumWindowSize(struct uiWindow *)" (?ensureMinimumWindowSize@@YAXPEAUuiWindow@@@Z)
libui.lib(winpublic.obj) : error LNK2001: unresolved external symbol __imp_SetWindowPos
libui.lib(winutil.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(tab.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(utilwin.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(area.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(progressbar.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(combobox.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(fontbutton.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(colorbutton.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(spinbox.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(slider.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(entry.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(label.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(separator.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(datetimepicker.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_EnableWindow
libui.lib(group.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(areaevents.cpp.obj) : error LNK2001: unresolved external symbol __imp_GetSystemMetrics
libui.lib(window.obj) : error LNK2001: unresolved external symbol __imp_GetSystemMetrics
libui.lib(button.obj) : error LNK2001: unresolved external symbol __imp_GetSystemMetrics
libui.lib(fontbutton.obj) : error LNK2001: unresolved external symbol __imp_GetSystemMetrics
libui.lib(colorbutton.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 uiNewWindow
libui.lib(winutil.obj) : error LNK2001: unresolved external symbol __imp_AdjustWindowRectEx
libui.lib(tabpage.obj) : error LNK2001: unresolved external symbol __imp_GetWindowLongPtrW
libui.lib(container.obj) : error LNK2001: unresolved external symbol __imp_GetWindowLongPtrW
libui.lib(winutil.obj) : error LNK2001: unresolved external symbol __imp_GetWindowLongPtrW
libui.lib(fontdialog.obj) : error LNK2001: unresolved external symbol __imp_GetWindowLongPtrW
libui.lib(colordialog.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(tabpage.obj) : error LNK2001: unresolved external symbol __imp_SetWindowLongPtrW
libui.lib(winpublic.obj) : error LNK2001: unresolved external symbol __imp_SetWindowLongPtrW
libui.lib(winutil.obj) : error LNK2001: unresolved external symbol __imp_SetWindowLongPtrW
libui.lib(fontdialog.obj) : error LNK2001: unresolved external symbol __imp_SetWindowLongPtrW
libui.lib(colordialog.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 uiWindowSetFullscreen
libui.lib(window.obj) : error LNK2019: unresolved external symbol __imp_GetMonitorInfoW referenced in function uiWindowSetFullscreen
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_GetMessageW referenced in function uiMain
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_TranslateMessage referenced in function uiMain
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_DispatchMessageW referenced in function uiMain
libui.lib(main.obj) : error LNK2019: unresolved external symbol __imp_PeekMessageW referenced in function uiMainStep
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 uiMain
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 uiMain
libui.lib(group.obj) : error LNK2019: unresolved external symbol SetWindowSubclass referenced in function uiNewGroup
libui.lib(datetimepicker.obj) : error LNK2001: unresolved external symbol SetWindowSubclass
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(datetimepicker.obj) : error LNK2001: unresolved external symbol RemoveWindowSubclass
libui.lib(fontdialog.obj) : error LNK2001: unresolved external symbol RemoveWindowSubclass
libui.lib(colordialog.obj) : error LNK2001: unresolved external symbol RemoveWindowSubclass
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(datetimepicker.obj) : error LNK2001: unresolved external symbol DefSubclassProc
libui.lib(fontdialog.obj) : error LNK2001: unresolved external symbol DefSubclassProc
libui.lib(colordialog.obj) : error LNK2001: unresolved external symbol DefSubclassProc
libui.lib(entry.obj) : error LNK2019: unresolved external symbol __imp_SetWindowTheme referenced in function uiNewSearchEntry
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 ID2D1DCRenderTarget * __cdecl makeHDCRenderTarget(struct HDC__ *,struct tagRECT *)" (?makeHDCRenderTarget@@YAPEAUID2D1DCRenderTarget@@PEAUHDC__@@PEAUtagRECT@@@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 LNK2019: unresolved external symbol __imp_CoCreateInstance referenced in function "long __cdecl uiprivInitImage(void)" (?uiprivInitImage@@YAJXZ)
libui.lib(image.obj) : error LNK2019: unresolved external symbol IID_IWICImagingFactory referenced in function "long __cdecl uiprivInitImage(void)" (?uiprivInitImage@@YAJXZ)
libui.lib(dwrite.obj) : error LNK2019: unresolved external symbol __imp_DWriteCreateFactory referenced in function "long __cdecl uiprivInitDrawText(void)" (?uiprivInitDrawText@@YAJXZ)
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 windowText(struct HWND__ *)" (?windowText@@YAPEA_WPEAUHWND__@@@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(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(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 "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_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 "int __cdecl handleParentMessages(struct HWND__ *,unsigned int,unsigned __int64,__int64,__int64 *)" (?handleParentMessages@@YAHPEAUHWND__@@I_K_JPEA_J@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 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_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 "int __cdecl areaDoEvents(struct uiArea *,unsigned int,unsigned __int64,__int64,__int64 *)" (?areaDoEvents@@YAHPEAUuiArea@@I_K_JPEA_J@Z)
libui.lib(events.obj) : error LNK2019: unresolved external symbol __imp_IsChild referenced in function "int __cdecl runWM_COMMAND(unsigned __int64,__int64,__int64 *)" (?runWM_COMMAND@@YAH_K_JPEA_J@Z)
libui.lib(fontdialog.obj) : error LNK2019: unresolved external symbol __imp_DialogBoxIndirectParamW referenced in function "int __cdecl uiprivShowFontDialog(struct HWND__ *,struct fontDialogParams *)" (?uiprivShowFontDialog@@YAHPEAUHWND__@@PEAUfontDialogParams@@@Z)
libui.lib(colordialog.obj) : error LNK2001: unresolved external symbol __imp_DialogBoxIndirectParamW
libui.lib(fontdialog.obj) : error LNK2019: unresolved external symbol __imp_EndDialog referenced in function "void __cdecl endFontDialog(struct fontDialog *,__int64)" (?endFontDialog@@YAXPEAUfontDialog@@_J@Z)
libui.lib(colordialog.obj) : error LNK2001: unresolved external symbol __imp_EndDialog
libui.lib(fontdialog.obj) : error LNK2019: unresolved external symbol __imp_wcstod referenced in function "struct fontDialog * __cdecl beginFontDialog(struct HWND__ *,__int64)" (?beginFontDialog@@YAPEAUfontDialog@@PEAUHWND__@@_J@Z)
libui.lib(colordialog.obj) : error LNK2019: unresolved external symbol __imp__wtof referenced in function "void __cdecl aDoubleChanged(struct colorDialog *)" (?aDoubleChanged@@YAXPEAUcolorDialog@@@Z)
libui.lib(colordialog.obj) : error LNK2019: unresolved external symbol D2D1MakeRotateMatrix referenced in function "void __cdecl drawArrow(struct ID2D1RenderTarget *,struct D2D_POINT_2F,double)" (?drawArrow@@YAXPEAUID2D1RenderTarget@@UD2D_POINT_2F@@N@Z)
libui.lib(drawmatrix.obj) : error LNK2001: unresolved external symbol D2D1MakeRotateMatrix
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 "int __cdecl areaDoDraw(struct uiArea *,unsigned int,unsigned __int64,__int64,__int64 *)" (?areaDoDraw@@YAHPEAUuiArea@@I_K_JPEA_J@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 D2D1MakeSkewMatrix referenced in function uiDrawMatrixSkew
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
control_gallery.exe : fatal error LNK1120: 106 unresolved externals
@andlabs
Copy link
Owner

andlabs commented Aug 17, 2018

When statically linking, you'll need to include the list of libraries libui links against, which is, for alpha 4:

user32 kernel32 gdi32 comctl32 uxtheme msimg32 comdlg32 d2d1 dwrite ole32 oleaut32 oleacc uuid windowscodecs

So you'll need to add this to the linker flags:

user32.lib kernel32.lib gdi32.lib comctl32.lib uxtheme.lib msimg32.lib comdlg32.lib d2d1.lib dwrite.lib ole32.lib oleaut32.lib oleacc.lib uuid.lib windowscodecs.lib

If you're using cl without calling the linker, prefix all that with a /LINK (or -LINK or maybe even -link I forget now). I'm not sure if uuid.lib is needed, though.

@hanyuone
Copy link
Author

Thanks for the quick reply. I still have two more errors:

libui.lib(fontdialog.obj) : error LNK2019: unresolved external symbol __imp_wcstod referenced in function "struct fontDialog * __cdecl beginFontDialog(struct HWND__ *,__int64)" (?beginFontDialog@@YAPEAUfontDialog@@PEAUHWND__@@_J@Z)
libui.lib(colordialog.obj) : error LNK2019: unresolved external symbol __imp__wtof referenced in function "void __cdecl aDoubleChanged(struct colorDialog *)" (?aDoubleChanged@@YAXPEAUcolorDialog@@@Z)

Not sure how to fix those.

Should there be instructions to include those libraries in README.md when using cl?

@andlabs
Copy link
Owner

andlabs commented Aug 17, 2018

Oh right, you'll also need the proper msvcrt. I forget what version VS2017 belongs to.

@code2828
Copy link

code2828 commented May 14, 2020

I got this error message: 无法定位序数334于动态链接库D:\libui-test\main.exe上。I have done my best to translate it: Cannot locate serial number 334 on the dynamically linked library D:\libui-test\main.exe. The source is EXACTLY same with examples/controlgallery/main.c, only that I changed line 4 to #include<ui.h>. Command invoked to compile was: cl main.c libui.lib /link user32.lib kernel32.lib gdi32.lib comctl32.lib uxtheme.lib msimg32.lib comdlg32.lib d2d1.lib dwrite.lib ole32.lib oleaut32.lib oleacc.lib uuid.lib windowscodecs.lib msvcrt.lib Command line name: x64 Native Tools Command Prompt for VS 2019 Preview.
Full command output:

Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28720.3 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

main.c
D:\libui-test\ui.h(686): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
Microsoft (R) Incremental Linker Version 14.26.28720.3
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:main.exe
user32.lib
kernel32.lib
gdi32.lib
comctl32.lib
uxtheme.lib
msimg32.lib
comdlg32.lib
d2d1.lib
dwrite.lib
ole32.lib
oleaut32.lib
oleacc.lib
uuid.lib
windowscodecs.lib
msvcrt.lib
main.obj
libui.lib
   Creating library main.lib and object main.exp
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

@code2828
Copy link

code2828 commented May 14, 2020

Note: I am using Visual Studio 2019, 16.0.0-pre2.0 NOT 2017. Is that the problem?

Output of dir command:

D:\libui-test>dir
 驱动器 D 中的卷是 新加卷
 卷的序列号是 AC43-D221

 D:\libui-test 的目录

2020/05/14  21:43    <DIR>          .
2020/05/14  21:43    <DIR>          ..
2020/03/05  20:03         1,671,521 libui-alpha4.1-windows-amd64-msvc2017-static.zip
2018/09/02  09:14         6,148,802 libui.lib
2020/05/14  21:33            12,596 main.c
2020/05/14  21:37           211,968 main.exe
2020/05/14  21:37            30,847 main.exp
2020/05/14  21:33            50,822 main.lib
2020/05/14  21:37            13,146 main.obj
2018/09/02  09:12            63,382 ui.h
2018/09/02  09:12            10,137 ui_windows.h
               9 个文件      8,213,221 字节
               2 个目录 838,636,240,896 可用字节

See attachment for a picture.
屏幕截图(5)

@andlabs
Copy link
Owner

andlabs commented May 15, 2020

It seems like the /M options need to match as well, hmmm. Try adding /MD or /MT before /ilnk. I don't know which one is correct off the top of my head; sorry.

@code2828
Copy link

Thanks for your reply. I'm currently not on that computer, but I wil try that as soon as I can.

@kojix2
Copy link
Contributor

kojix2 commented Sep 6, 2024

I am not very familiar with Windows, but I have mostly identified the cause. The problem occurs when calling MsgBox, which is implemented with TaskDialog. TaskDialog needs comctl32 version 6, but the default is version 5. To fix this, you need to specify version 6, for example, by creating a manifest file in the same folder as the executable.

While this may be a bit inconvenient for a portable library like libui, it is a workable solution.

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

4 participants