magiblot / tvision

A modern port of Turbo Vision 2.0, the classical framework for text-based user interfaces. Now cross-platform and with Unicode support.
Other
1.99k stars 150 forks source link

build error msys2 mingw64 #157

Closed demosthenesk closed 5 months ago

demosthenesk commented 5 months ago

hello, i got the next error,

demos@asus-laptop MINGW64 ~ $ cd tvision-master/

demos@asus-laptop MINGW64 ~/tvision-master $ cmake . -B ./build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release && cmake --build ./build -- The C compiler identification is GNU 13.2.0 -- The CXX compiler identification is GNU 13.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: C:/msys64/usr/bin/cc.exe -- Check for working C compiler: C:/msys64/usr/bin/cc.exe - works -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Check for working CXX compiler: C:/msys64/usr/bin/c++.exe -- Check for working CXX compiler: C:/msys64/usr/bin/c++.exe - works -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test SUPPORTS_COUNTER_MACRO -- Performing Test SUPPORTS_COUNTER_MACRO - Success -- Install path: C:/Program Files (x86)/tvision -- Build Examples: ON -- Check if the system is big endian -- Searching 16 bit integer -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of unsigned short -- Check size of unsigned short - done -- Searching 16 bit integer - Using unsigned short -- Check if the system is big endian - little endian -- Configuring done (16.0s) -- Generating done (1.7s) -- Build files have been written to: C:/msys64/home/demos/tvision-master/build [ 0%] Building CXX object source/CMakeFiles/tvision.dir/cmake_pch.hxx.gch

: **fatal error: C:/msys64/home/demos/tvision-master/build/source/CMakeFiles/tvision.dir/cmake_pch.hxx: No such file or directory** compilation terminated. mingw32-make.exe[2]: *** [source\CMakeFiles\tvision.dir\build.make:77: source/CMakeFiles/tvision.dir/cmake_pch.hxx.gch] Error 1 mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:280: source/CMakeFiles/tvision.dir/all] Error 2 mingw32-make.exe: *** [Makefile:135: all] Error 2
magiblot commented 5 months ago

Hi @demosthenesk!

I don't understand why you are getting this error, but it looks like you should be able to avoid it by adding the -DTV_OPTIMIZE_BUILD=OFF option to the first CMake invocation.

demosthenesk commented 5 months ago

now i get,

demos@asus-laptop MINGW64 ~ $ cd tvision-master/

demos@asus-laptop MINGW64 ~/tvision-master $ cmake . -B ./build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DTV_OPTIMIZE_BUILD=OFF && cmake --build ./build -- The C compiler identification is GNU 13.2.0 -- The CXX compiler identification is GNU 13.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: C:/msys64/usr/bin/cc.exe -- Check for working C compiler: C:/msys64/usr/bin/cc.exe - works -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Check for working CXX compiler: C:/msys64/usr/bin/c++.exe -- Check for working CXX compiler: C:/msys64/usr/bin/c++.exe - works -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test SUPPORTS_COUNTER_MACRO -- Performing Test SUPPORTS_COUNTER_MACRO - Success -- Install path: C:/Program Files (x86)/tvision -- Build Examples: ON -- Check if the system is big endian -- Searching 16 bit integer -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of unsigned short -- Check size of unsigned short - done -- Searching 16 bit integer - Using unsigned short -- Check if the system is big endian - little endian -- Configuring done (16.5s) -- Generating done (1.8s) -- Build files have been written to: C:/msys64/home/demos/tvision-master/build [ 0%] Building CXX object source/CMakeFiles/tvision.dir/platform/ansidisp.cpp.obj In file included from C:/msys64/home/demos/tvision-master/include/tvision/internal/ansidisp.h:5, from C:\msys64\home\demos\tvision-master\source\platform\ansidisp.cpp:1: C:/msys64/home/demos/tvision-master/include/tvision/tv.h:21: warning: "__cdecl" redefined 21 #define __cdecl
: note: this is the location of the previous definition C:/msys64/home/demos/tvision-master/include/tvision/tv.h:22: warning: "__stdcall" redefined 22 | #define __stdcall | : note: this is the location of the previous definition In file included from C:/msys64/home/demos/tvision-master/include/tvision/tstrview.h:12, from C:/msys64/home/demos/tvision-master/include/tvision/tv.h:669: /usr/include/string.h:130:10: error: conflicting declaration of ‘char* strupr(char*)’ with ‘C’ linkage 130 | char *strupr (char *); | ^~~~~~ In file included from C:/msys64/home/demos/tvision-master/include/tvision/tv.h:666: C:/msys64/home/demos/tvision-master/include/tvision/util.h:106:7: note: previous declaration with ‘C++’ linkage 106 | char *strupr(char *s) noexcept; | ^~~~~~ /usr/include/string.h:130:10: error: declaration of ‘char* strupr(char*)’ has a different exception specifier 130 | char *strupr (char *); | ^~~~~~ C:/msys64/home/demos/tvision-master/include/tvision/util.h:106:7: note: from previous declaration ‘char* strupr(char*) noexcept’ 106 | char *strupr(char *s) noexcept; | ^~~~~~ In file included from /usr/lib/gcc/x86_64-pc-msys/13.2.0/include/c++/cstdlib:79, from /usr/lib/gcc/x86_64-pc-msys/13.2.0/include/c++/stdlib.h:36, from C:\msys64\home\demos\tvision-master\source\platform\ansidisp.cpp:4: /usr/include/stdlib.h:227:9: error: conflicting declaration of ‘char* itoa(int, char*, int)’ with ‘ ’ linkage 227 | char * itoa (int, char *, int); | ^~~~ C:/msys64/home/demos/tvision-master/include/tvision/util.h:107:7: note: previous declaration with ‘C++’ linkage 107 | char *itoa( int value, char *buffer, int radix ) noexcept; | ^~~~ /usr/include/stdlib.h:227:9: error: declaration of ‘char* itoa(int, char*, int)’ has a different exception specifier 227 | char * itoa (int, char *, int); | ^~~~ C:/msys64/home/demos/tvision-master/include/tvision/util.h:107:7: note: from previous declaration ‘char* itoa(int, char*, int) noexcept’ 107 | char *itoa( int value, char *buffer, int radix ) noexcept; | ^~~~ mingw32-make.exe[2]: *** [source\CMakeFiles\tvision.dir\build.make:76: source/CMakeFiles/tvision.dir/platform/ansidisp.cpp.obj] Error 1 mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:280: source/CMakeFiles/tvision.dir/all] Error 2 mingw32-make.exe: *** [Makefile:135: all] Error 2
magiblot commented 5 months ago

It looks like you are using MSYS2's GCC, which apparently mimics Cygwin's GCC in the sense that it makes the code believe that it is being compiled for a Unix-like platform (https://github.com/msys2/MSYS2-packages/issues/2718#issuecomment-985239585).

I have never tried it, so I don't know if this project can be built using this compiler. But there are a few things you can try before giving up:

demosthenesk commented 5 months ago

it worked but i get direct.h error

emos@asus-laptop MINGW64 ~/tvision-master $ cmake . -B ./build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DTV_OPTIMIZE_BUILD=OFF -DCMAKE_CXX_FLAGS=-D_WIN32 && cmake --build ./build -- The C compiler identification is GNU 13.2.0 -- The CXX compiler identification is GNU 13.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: C:/msys64/usr/bin/cc.exe -- Check for working C compiler: C:/msys64/usr/bin/cc.exe - works -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Check for working CXX compiler: C:/msys64/usr/bin/c++.exe -- Check for working CXX compiler: C:/msys64/usr/bin/c++.exe - works -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test SUPPORTS_COUNTER_MACRO -- Performing Test SUPPORTS_COUNTER_MACRO - Success -- Install path: C:/Program Files (x86)/tvision -- Build Examples: ON -- Check if the system is big endian -- Searching 16 bit integer -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of unsigned short -- Check size of unsigned short - done -- Searching 16 bit integer - Using unsigned short -- Check if the system is big endian - little endian -- Configuring done (16.2s) -- Generating done (1.7s) -- Build files have been written to: C:/msys64/home/demos/tvision-master/build [ 0%] Building CXX object source/CMakeFiles/tvision.dir/platform/ansidisp.cpp.obj [ 1%] Building CXX object source/CMakeFiles/tvision.dir/platform/base64.cpp.obj [ 1%] Building CXX object source/CMakeFiles/tvision.dir/platform/buffdisp.cpp.obj [ 1%] Building CXX object source/CMakeFiles/tvision.dir/platform/codepage.cpp.obj [ 2%] Building CXX object source/CMakeFiles/tvision.dir/platform/colors.cpp.obj [ 2%] Building CXX object source/CMakeFiles/tvision.dir/platform/cursor.cpp.obj [ 3%] Building CXX object source/CMakeFiles/tvision.dir/platform/dir.cpp.obj In file included from C:\msys64\home\demos\tvision-master\source\platform\dir.cpp:7: C:/msys64/home/demos/tvision-master/include/tvision/compat/borland/dir.h:24:10: fatal error: direct.h: No such file or directory 24 | #include | ^~~~~~ compilation terminated. mingw32-make.exe[2]: [source\CMakeFiles\tvision.dir\build.make:166: source/CMakeFiles/tvision.dir/platform/dir.cpp.obj] Error 1 mingw32-make.exe[1]: [CMakeFiles\Makefile2:280: source/CMakeFiles/tvision.dir/all] Error 2 mingw32-make.exe: *** [Makefile:135: all] Error 2

demosthenesk commented 5 months ago

well i manage to compile tvision with msys2. i had to remove completely the msys2 installation and reinstall it. i used mingw64 only enviroment.

i installed the next packages...

mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-cross-toolchain

and compile with cmake . -B ./build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DTV_OPTIMIZE_BUILD=OFF && cmake --build ./build

thanks for your time !