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

Failed to build on MSYS2 MINGW64 #303

Open
ghost opened this issue Jun 17, 2023 · 1 comment
Open

Failed to build on MSYS2 MINGW64 #303

ghost opened this issue Jun 17, 2023 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 17, 2023

I cloned the default branch.

I used the autogen.sh script to generate configure script. This is the result of configure script:

$ ./configure
configure: loading site script /etc/config.site
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking target system type... x86_64-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gawk... (cached) gawk
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /mingw64/bin/nm -B
checking the name lister (/mingw64/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-w64-mingw32 file names to x86_64-w64-mingw32 format... func_convert_file_msys_to_w32
checking how to convert x86_64-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
checking for C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /mingw64/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... no
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (C:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether ln -s works... no, using cp -pR
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... (cached) ranlib
checking for main in -lm... yes
checking how to run the C preprocessor... gcc -E
checking for X... no
checking for limits.h... yes
checking for locale.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for wchar.h... yes
checking for _Bool... yes
checking for stdbool.h that conforms to C99... yes
checking for inline... inline
checking for int32_t... yes
checking for int64_t... yes
checking for size_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for GNU libc compatible malloc... yes
checking for GNU libc compatible realloc... yes
checking for gettimeofday... yes
checking for memset... yes
checking for pow... yes
checking for select... no
checking for sqrt... yes
checking for strcasecmp... yes
checking for strstr... yes
checking whether make supports nested variables... (cached) yes
checking whether to build with code coverage support... no
checking whether gcc is Clang... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for gcc option to support OpenMP... -fopenmp
checking for libxml/parser.h... no
checking for pkg-config... /mingw64/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FREETYPE... yes
checking for fontconfig/fontconfig.h... no
checking for linux/fb.h... no
checking for X11/Xlib.h... yes
checking for XOpenDisplay in -lX11... no
checking for png.h... yes
checking for png_sig_cmp in -lpng... yes
checking for jpeglib.h... yes
checking for jpeg_start_decompress in -ljpeg... yes
checking for setjmp.h... yes
checking for jpeg_start_decompress in -ljpeg... (cached) yes
checking whether to enable debugging... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating lcui2.pc
config.status: creating Makefile
config.status: creating build/Makefile
config.status: creating include/Makefile
config.status: creating include/LCUI/Makefile
config.status: creating include/LCUI/font/Makefile
config.status: creating include/LCUI/draw/Makefile
config.status: creating include/LCUI/gui/widget/Makefile
config.status: creating include/LCUI/gui/Makefile
config.status: creating include/LCUI/util/Makefile
config.status: creating src/Makefile
config.status: creating src/font/Makefile
config.status: creating src/font/in-core/Makefile
config.status: creating src/draw/Makefile
config.status: creating src/thread/Makefile
config.status: creating src/image/Makefile
config.status: creating src/util/Makefile
config.status: creating src/gui/Makefile
config.status: creating src/platform/Makefile
config.status: creating test/Makefile
config.status: creating include/config.h
config.status: executing depfiles commands
config.status: executing libtool commands


Build with lcui-builder support .... : no
Build with libpng support .......... : yes
Build with libjpeg support ......... : yes
Build with font-engine support ..... : freetype2
Build with fontconfig support ...... : no
Build with thread support .......... : pthread
Build with OpenMP support .......... : yes
Build with video support ........... : none

This is the error message when building:

$ make
Making all in src
make[1]: Entering directory '/home/Administrator/LCUI/src'
Making all in image
make[2]: Entering directory '/home/Administrator/LCUI/src/image'
  CC       bmp.lo
  CC       jpeg.lo
  CC       png.lo
  CC       reader.lo
  CCLD     libimage.la
make[2]: Leaving directory '/home/Administrator/LCUI/src/image'
Making all in util
make[2]: Entering directory '/home/Administrator/LCUI/src/util'
  CC       rbtree.lo
  CC       dict.lo
  CC       linkedlist.lo
  CC       time.lo
  CC       event.lo
  CC       rect.lo
  CC       string.lo
  CC       strlist.lo
  CC       strpool.lo
  CC       dirent.lo
  CC       parse.lo
  CC       steptimer.lo
  CC       logger.lo
  CC       math.lo
  CC       task.lo
  CC       uri.lo
uri.c:38: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
   38 | #pragma warning(disable:4091)
      |
  CC       charset.lo
charset.c: In function 'utf8_to_ucs2':
charset.c:115:27: warning: overflow in conversion from 'int' to 'wchar_t' {aka 'short unsigned int'} changes value from '(int)buf[0] << 18 & 1835008' to '0' [-Woverflow]
  115 |                 unicode = (wchar_t)(buf[0] & 0x07) << 18;
      |                           ^
  CC       object.lo
  CCLD     libutil.la
make[2]: Leaving directory '/home/Administrator/LCUI/src/util'
Making all in draw
make[2]: Entering directory '/home/Administrator/LCUI/src/draw'
  CC       background.lo
  CC       border.lo
  CC       boxshadow.lo
  CC       line.lo
  CCLD     libdraw.la
make[2]: Leaving directory '/home/Administrator/LCUI/src/draw'
Making all in font
make[2]: Entering directory '/home/Administrator/LCUI/src/font'
Making all in in-core
make[3]: Entering directory '/home/Administrator/LCUI/src/font/in-core'
  CC       font_inconsolata.lo
  CCLD     libfont_incore.la
make[3]: Leaving directory '/home/Administrator/LCUI/src/font/in-core'
make[3]: Entering directory '/home/Administrator/LCUI/src/font'
  CC       fontlibrary.lo
  CC       freetype.lo
  CC       fontconfig.lo
  CC       textstyle.lo
  CC       textlayer.lo
textlayer.c: In function 'TextLayer_SetCaretPosByPixelPos':
textlayer.c:479:39: warning: 'ins_y' may be used uninitialized [-Wmaybe-uninitialized]
  479 |         txtrow = layer->text_rows.rows[ins_y];
      |                                       ^
textlayer.c:461:34: note: 'ins_y' was declared here
  461 |         int i, pixel_pos, ins_x, ins_y;
      |                                  ^~~~~
  CC       in_core_font.lo
  CCLD     libfont.la
make[3]: Leaving directory '/home/Administrator/LCUI/src/font'
make[2]: Leaving directory '/home/Administrator/LCUI/src/font'
Making all in thread
make[2]: Entering directory '/home/Administrator/LCUI/src/thread'
  CC       pthread/thread.lo
pthread/thread.c: In function 'LCUIThread_Run':
pthread/thread.c:60:9: warning: implicit declaration of function 'pthread_exit'; did you mean 'LCUIThread_Exit'? [-Wimplicit-function-declaration]
   60 |         pthread_exit(NULL);
      |         ^~~~~~~~~~~~
      |         LCUIThread_Exit
pthread/thread.c:61:1: warning: no return statement in function returning non-void [-Wreturn-type]
   61 | }
      | ^
pthread/thread.c: In function 'LCUIThread_Create':
pthread/thread.c:104:15: warning: implicit declaration of function 'pthread_create'; did you mean 'LCUIThread_Create'? [-Wimplicit-function-declaration]
  104 |         ret = pthread_create(&ctx->tid, NULL, LCUIThread_Run, ctx);
      |               ^~~~~~~~~~~~~~
      |               LCUIThread_Create
pthread/thread.c: In function 'LCUIThread_SelfID':
pthread/thread.c:118:16: warning: implicit declaration of function 'pthread_self' [-Wimplicit-function-declaration]
  118 |         return pthread_self();
      |                ^~~~~~~~~~~~
pthread/thread.c: In function 'LCUIThread_Cancel':
pthread/thread.c:138:9: warning: implicit declaration of function 'pthread_kill' [-Wimplicit-function-declaration]
  138 |         pthread_kill(thread, SIGKILL);
      |         ^~~~~~~~~~~~
pthread/thread.c:138:30: error: 'SIGKILL' undeclared (first use in this function)
  138 |         pthread_kill(thread, SIGKILL);
      |                              ^~~~~~~
pthread/thread.c:138:30: note: each undeclared identifier is reported only once for each function it appears in
pthread/thread.c: In function 'LCUIThread_Join':
pthread/thread.c:144:16: warning: implicit declaration of function 'pthread_join'; did you mean 'LCUIThread_Join'? [-Wimplicit-function-declaration]
  144 |         return pthread_join(thread, retval);
      |                ^~~~~~~~~~~~
      |                LCUIThread_Join
make[2]: *** [Makefile:443: pthread/thread.lo] Error 1
make[2]: Leaving directory '/home/Administrator/LCUI/src/thread'
make[1]: *** [Makefile:550: all-recursive] Error 1
make[1]: Leaving directory '/home/Administrator/LCUI/src'
make: *** [Makefile:541: all-recursive] Error 1
@lc-soft
Copy link
Owner

lc-soft commented Jun 20, 2023

The configure script is only used for use on Linux system. If you want to build on Windows system, please use Visual Studio to open the build/windows/LCUI.sln file or use the msbuild command to build. For details, please refer to the build commands in this build script:

windows_build:
strategy:
fail-fast: false
matrix:
os: ['windows-2016']
include:
- os: 'windows-2016'
triplet: 'x64-windows'
runs-on: ${{ matrix.os }}
name: "Builds binaries on ${{ matrix.os }}"
steps:
- uses: actions/checkout@master
# vcpkg cache bug fix
# NOTE: needs further investigation
# https://github.com/lukka/run-vcpkg/issues/61
- name: "vcpkg fix"
run: attrib -r "c:\vcpkg\.git\*.*" /s
# VCPKG
- name: Run vcpkg
uses: lukka/run-vcpkg@main
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg/
vcpkgTriplet: ${{ matrix.triplet }}
vcpkgGitCommitId: 7db401cb1ef1fc559ec9f9ce814d064c328fd767
setupOnly: true
appendedCacheKey: ${{ hashFiles('lcpkg.json') }}
additionalCachedPaths: ./lcpkg/
- name: "Display versions"
run: |
node -v
npm -va
vcpkg version
- name: Cache lcpkg dependencies
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/vcpkg/
key: ${{ matrix.os }}
- name: "Install lcpkg"
run: |
npm install -g lcpkg
lcpkg config vcpkg.root ${{ github.workspace }}/vcpkg/
lcpkg install
lcpkg install --arch x64
lcpkg install --platform uwp
lcpkg install --platform uwp --arch x64
- name: Cache windows build tools
uses: actions/cache@v2
with:
path: ~/.windows-build-tools
key: ${{ matrix.os }}
- name: "Setup windows-build-tools"
run: npm install --global --production windows-build-tools --vs2015
- name: "Setup msbuild"
uses: microsoft/setup-msbuild@v1.0.2
- name: "Use config"
run: copy .\include\config.win32.h.in .\include\config.h
- name: "Build"
run: |
msbuild build/windows/LCUI.sln /p:Configuration=Debug /p:Platform=x86 /verbosity:minimal
msbuild build/windows/LCUI.sln /p:Configuration=Debug /p:Platform=x64 /verbosity:minimal
msbuild build/windows/LCUI.sln /p:Configuration=Release /p:Platform=x86 /verbosity:minimal
msbuild build/windows/LCUI.sln /p:Configuration=Release /p:Platform=x64 /verbosity:minimal
- name: "Run tests"
continue-on-error: true
run: |
msbuild build\windows\LCUI-Demo.sln /p:Configuration=Debug /p:Platform=x64 /verbosity:minimal
cd test
..\bin\x64-windows\Debug\LCUITest.exe

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

1 participant