Open WinFutureX opened 1 year ago
Looks like MINGW can't find _fileno
.
I suggest to change devices/serial/chario.cpp
like this:
#ifdef _WIN32
#include <fcntl.h>
#include <io.h>
#include <stdio.h> // <----- add this one
#include <windows.h>
Then recompile the project. Did it work?
The error is now gone, but the linker stage fails:
[ 1%] Building C object thirdparty/cubeb/CMakeFiles/speex.dir/src/speex/resample.c.obj
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/speex/resample.c: In function 'update_filter':
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/speex/resample.c:674:20: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
674 | for (j=0;j<st->filt_len;j++)
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/speex/resample.c: In function 'speex_resampler_process_float':
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/speex/resample.c:946:21: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
946 | for(j=0;j<ichunk;++j)
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/speex/resample.c:949:20: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
949 | for(j=0;j<ichunk;++j)
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/speex/resample.c: In function 'speex_resampler_process_int':
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/speex/resample.c:1002:19: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
1002 | for(j=0;j<ichunk;++j)
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/speex/resample.c:1009:19: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
1009 | for(j=0;j<ichunk;++j)
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/speex/resample.c:1019:16: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
1019 | for (j=0;j<ochunk+omagic;++j)
| ^
[ 1%] Built target speex
[ 3%] Building C object thirdparty/cubeb/CMakeFiles/cubeb.dir/src/cubeb.c.obj
[ 4%] Building CXX object thirdparty/cubeb/CMakeFiles/cubeb.dir/src/cubeb_mixer.cpp.obj
[ 6%] Building CXX object thirdparty/cubeb/CMakeFiles/cubeb.dir/src/cubeb_resampler.cpp.obj
In file included from C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:36,
from C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler.cpp:13:
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h: In member function 'T* cubeb_resampler_speex_one_way<T>::output(size_t, size_t*)':
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:50:28: warning: unknown conversion type character 'z' in format [-Wformat=]
50 | g_cubeb_log_callback("%s:%d: " fmt "\n", __FILENAME__, __LINE__, \
| ^~~~~~~~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:44:24: note: in expansion of macro 'LOG_INTERNAL'
44 | #define LOGV(msg, ...) LOG_INTERNAL(CUBEB_LOG_VERBOSE, msg, ##__VA_ARGS__)
| ^~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:248:7: note: in expansion of macro 'LOGV'
248 | LOGV("underrun during resampling: got %u frames, expected %zu",
| ^~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:248:66: note: format string is defined here
248 | LOGV("underrun during resampling: got %u frames, expected %zu",
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:50:28: warning: too many arguments for format [-Wformat-extra-args]
50 | g_cubeb_log_callback("%s:%d: " fmt "\n", __FILENAME__, __LINE__, \
| ^~~~~~~~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:44:24: note: in expansion of macro 'LOG_INTERNAL'
44 | #define LOGV(msg, ...) LOG_INTERNAL(CUBEB_LOG_VERBOSE, msg, ##__VA_ARGS__)
| ^~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:248:7: note: in expansion of macro 'LOGV'
248 | LOGV("underrun during resampling: got %u frames, expected %zu",
| ^~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h: In instantiation of 'T* cubeb_resampler_speex_one_way<T>::output(size_t, size_t*) [with T = short int; size_t = long long unsigned int]':
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler.cpp:288:46: required from 'long int cubeb_resampler_speex<T, InputProcessing, OutputProcessing>::fill_internal_duplex(T*, long int*, T*, long int) [with T = short int; InputProcessing = cubeb_resampler_speex_one_way<short int>; OutputProcessing = cubeb_resampler_speex_one_way<short int>]'
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler.cpp:139:21: required from 'cubeb_resampler_speex<T, InputProcessing, OutputProcessing>::cubeb_resampler_speex(InputProcessor*, OutputProcessor*, cubeb_stream*, cubeb_data_callback, void*) [with T = short int; InputProcessing = cubeb_resampler_speex_one_way<short int>; OutputProcessing = cubeb_resampler_speex_one_way<short int>; cubeb_stream = cubeb_stream; cubeb_data_callback = long int (*)(cubeb_stream*, void*, const void*, void*, long int)]'
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:566:12: required from 'cubeb_resampler* cubeb_resampler_create_internal(cubeb_stream*, cubeb_stream_params*, cubeb_stream_params*, unsigned int, cubeb_data_callback, void*, cubeb_resampler_quality) [with T = short int; cubeb_resampler = cubeb_resampler; cubeb_stream = cubeb_stream; cubeb_data_callback = long int (*)(cubeb_stream*, void*, const void*, void*, long int)]'
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler.cpp:340:50: required from here
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:50:28: warning: unknown conversion type character 'z' in format [-Wformat=]
50 | g_cubeb_log_callback("%s:%d: " fmt "\n", __FILENAME__, __LINE__, \
| ^~~~~~~~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:44:24: note: in expansion of macro 'LOG_INTERNAL'
44 | #define LOGV(msg, ...) LOG_INTERNAL(CUBEB_LOG_VERBOSE, msg, ##__VA_ARGS__)
| ^~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:248:7: note: in expansion of macro 'LOGV'
248 | LOGV("underrun during resampling: got %u frames, expected %zu",
| ^~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:578:63: note: format string is defined here
578 | LOG("Resampling output (%dHz) to target and input rate of %dHz",
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:50:28: warning: too many arguments for format [-Wformat-extra-args]
50 | g_cubeb_log_callback("%s:%d: " fmt "\n", __FILENAME__, __LINE__, \
| ^~~~~~~~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:44:24: note: in expansion of macro 'LOG_INTERNAL'
44 | #define LOGV(msg, ...) LOG_INTERNAL(CUBEB_LOG_VERBOSE, msg, ##__VA_ARGS__)
| ^~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:248:7: note: in expansion of macro 'LOGV'
248 | LOGV("underrun during resampling: got %u frames, expected %zu",
| ^~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h: In instantiation of 'T* cubeb_resampler_speex_one_way<T>::output(size_t, size_t*) [with T = float; size_t = long long unsigned int]':
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler.cpp:288:46: required from 'long int cubeb_resampler_speex<T, InputProcessing, OutputProcessing>::fill_internal_duplex(T*, long int*, T*, long int) [with T = float; InputProcessing = cubeb_resampler_speex_one_way<float>; OutputProcessing = cubeb_resampler_speex_one_way<float>]'
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler.cpp:139:21: required from 'cubeb_resampler_speex<T, InputProcessing, OutputProcessing>::cubeb_resampler_speex(InputProcessor*, OutputProcessor*, cubeb_stream*, cubeb_data_callback, void*) [with T = float; InputProcessing = cubeb_resampler_speex_one_way<float>; OutputProcessing = cubeb_resampler_speex_one_way<float>; cubeb_stream = cubeb_stream; cubeb_data_callback = long int (*)(cubeb_stream*, void*, const void*, void*, long int)]'
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:566:12: required from 'cubeb_resampler* cubeb_resampler_create_internal(cubeb_stream*, cubeb_stream_params*, cubeb_stream_params*, unsigned int, cubeb_data_callback, void*, cubeb_resampler_quality) [with T = float; cubeb_resampler = cubeb_resampler; cubeb_stream = cubeb_stream; cubeb_data_callback = long int (*)(cubeb_stream*, void*, const void*, void*, long int)]'
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler.cpp:344:50: required from here
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:50:28: warning: unknown conversion type character 'z' in format [-Wformat=]
50 | g_cubeb_log_callback("%s:%d: " fmt "\n", __FILENAME__, __LINE__, \
| ^~~~~~~~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:44:24: note: in expansion of macro 'LOG_INTERNAL'
44 | #define LOGV(msg, ...) LOG_INTERNAL(CUBEB_LOG_VERBOSE, msg, ##__VA_ARGS__)
| ^~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:248:7: note: in expansion of macro 'LOGV'
248 | LOGV("underrun during resampling: got %u frames, expected %zu",
| ^~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:578:63: note: format string is defined here
578 | LOG("Resampling output (%dHz) to target and input rate of %dHz",
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:50:28: warning: too many arguments for format [-Wformat-extra-args]
50 | g_cubeb_log_callback("%s:%d: " fmt "\n", __FILENAME__, __LINE__, \
| ^~~~~~~~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_log.h:44:24: note: in expansion of macro 'LOG_INTERNAL'
44 | #define LOGV(msg, ...) LOG_INTERNAL(CUBEB_LOG_VERBOSE, msg, ##__VA_ARGS__)
| ^~~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_resampler_internal.h:248:7: note: in expansion of macro 'LOGV'
248 | LOGV("underrun during resampling: got %u frames, expected %zu",
| ^~~~
[ 7%] Building CXX object thirdparty/cubeb/CMakeFiles/cubeb.dir/src/cubeb_log.cpp.obj
[ 9%] Building C object thirdparty/cubeb/CMakeFiles/cubeb.dir/src/cubeb_strings.c.obj
[ 10%] Building CXX object thirdparty/cubeb/CMakeFiles/cubeb.dir/src/cubeb_utils.cpp.obj
[ 12%] Building CXX object thirdparty/cubeb/CMakeFiles/cubeb.dir/src/cubeb_wasapi.cpp.obj
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_wasapi.cpp: In function 'bool {anonymous}::initialize_iaudioclient2(com_ptr<IAudioClient>&)':
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_wasapi.cpp:1900:40: warning: missing initializer for member 'AudioClientProperties::bIsOffload' [-Wmissing-field-initializers]
1900 | AudioClientProperties properties = {0};
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_wasapi.cpp:1900:40: warning: missing initializer for member 'AudioClientProperties::eCategory' [-Wmissing-field-initializers]
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_wasapi.cpp:1900:40: warning: missing initializer for member 'AudioClientProperties::Options' [-Wmissing-field-initializers]
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_wasapi.cpp:1908:12: warning: enum constant in boolean context [-Wint-in-bool-context]
1908 | return CUBEB_ERROR;
| ^~~~~~~~~~~
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_wasapi.cpp: At global scope:
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_wasapi.cpp:1915:1: warning: 'bool {anonymous}::initialize_iaudioclient3(com_ptr<IAudioClient>&, cubeb_stream*, com_heap_ptr<tWAVEFORMATEX>&, DWORD, EDataFlow)' defined but not used [-Wunused-function]
1915 | initialize_iaudioclient3(com_ptr<IAudioClient> & audio_client,
| ^~~~~~~~~~~~~~~~~~~~~~~~
[ 13%] Building C object thirdparty/cubeb/CMakeFiles/cubeb.dir/src/cubeb_winmm.c.obj
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_winmm.c: In function 'winmm_create_device_from_outcaps2':
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_winmm.c:965:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
965 | ret->devid = (cubeb_devid)devid;
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_winmm.c: In function 'winmm_create_device_from_outcaps':
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_winmm.c:990:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
990 | ret->devid = (cubeb_devid)devid;
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_winmm.c: In function 'winmm_create_device_from_incaps2':
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_winmm.c:1036:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1036 | ret->devid = (cubeb_devid)devid;
| ^
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_winmm.c: In function 'winmm_create_device_from_incaps':
C:/msys64/home/Kelsey/dingusppc/thirdparty/cubeb/src/cubeb_winmm.c:1061:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1061 | ret->devid = (cubeb_devid)devid;
| ^
[ 15%] Linking CXX static library ../../lib/libcubeb.a
[ 15%] Built target cubeb
[ 16%] Building CXX object core/CMakeFiles/core.dir/timermanager.cpp.obj
[ 16%] Built target core
[ 18%] Building CXX object cpu/ppc/CMakeFiles/cpu_ppc.dir/poweropcodes.cpp.obj
[ 19%] Building CXX object cpu/ppc/CMakeFiles/cpu_ppc.dir/ppcdisasm.cpp.obj
[ 21%] Building CXX object cpu/ppc/CMakeFiles/cpu_ppc.dir/ppcexceptions.cpp.obj
[ 22%] Building CXX object cpu/ppc/CMakeFiles/cpu_ppc.dir/ppcexec.cpp.obj
[ 24%] Building CXX object cpu/ppc/CMakeFiles/cpu_ppc.dir/ppcfpopcodes.cpp.obj
[ 25%] Building CXX object cpu/ppc/CMakeFiles/cpu_ppc.dir/ppcmmu.cpp.obj
[ 27%] Building CXX object cpu/ppc/CMakeFiles/cpu_ppc.dir/ppcopcodes.cpp.obj
[ 27%] Built target cpu_ppc
[ 28%] Building CXX object devices/CMakeFiles/devices.dir/common/adb/adb.cpp.obj
[ 30%] Building CXX object devices/CMakeFiles/devices.dir/common/dbdma.cpp.obj
[ 31%] Building CXX object devices/CMakeFiles/devices.dir/common/i2c/athens.cpp.obj
[ 33%] Building CXX object devices/CMakeFiles/devices.dir/common/i2c/i2cprom.cpp.obj
[ 34%] Building CXX object devices/CMakeFiles/devices.dir/common/nvram.cpp.obj
[ 36%] Building CXX object devices/CMakeFiles/devices.dir/common/ofnvram.cpp.obj
[ 37%] Building CXX object devices/CMakeFiles/devices.dir/common/pci/bandit.cpp.obj
[ 39%] Building CXX object devices/CMakeFiles/devices.dir/common/pci/pcidevice.cpp.obj
[ 40%] Building CXX object devices/CMakeFiles/devices.dir/common/pci/pcihost.cpp.obj
[ 42%] Building CXX object devices/CMakeFiles/devices.dir/common/scsi/mesh.cpp.obj
[ 43%] Building CXX object devices/CMakeFiles/devices.dir/common/scsi/sc53c94.cpp.obj
[ 45%] Building CXX object devices/CMakeFiles/devices.dir/common/scsi/scsi_bus.cpp.obj
[ 46%] Building CXX object devices/CMakeFiles/devices.dir/common/viacuda.cpp.obj
[ 48%] Building CXX object devices/CMakeFiles/devices.dir/deviceregistry.cpp.obj
[ 50%] Building CXX object devices/CMakeFiles/devices.dir/ethernet/mace.cpp.obj
[ 51%] Building CXX object devices/CMakeFiles/devices.dir/floppy/floppyimg.cpp.obj
[ 53%] Building CXX object devices/CMakeFiles/devices.dir/floppy/superdrive.cpp.obj
[ 54%] Building CXX object devices/CMakeFiles/devices.dir/floppy/swim3.cpp.obj
[ 56%] Building CXX object devices/CMakeFiles/devices.dir/ioctrl/amic.cpp.obj
[ 57%] Building CXX object devices/CMakeFiles/devices.dir/ioctrl/grandcentral.cpp.obj
[ 59%] Building CXX object devices/CMakeFiles/devices.dir/ioctrl/heathrow.cpp.obj
[ 60%] Building CXX object devices/CMakeFiles/devices.dir/memctrl/hammerhead.cpp.obj
[ 62%] Building CXX object devices/CMakeFiles/devices.dir/memctrl/hmc.cpp.obj
[ 63%] Building CXX object devices/CMakeFiles/devices.dir/memctrl/memctrlbase.cpp.obj
[ 65%] Building CXX object devices/CMakeFiles/devices.dir/memctrl/mpc106.cpp.obj
[ 66%] Building CXX object devices/CMakeFiles/devices.dir/memctrl/platinum.cpp.obj
[ 68%] Building CXX object devices/CMakeFiles/devices.dir/serial/chario.cpp.obj
[ 69%] Building CXX object devices/CMakeFiles/devices.dir/serial/escc.cpp.obj
[ 71%] Building CXX object devices/CMakeFiles/devices.dir/sound/awacs.cpp.obj
[ 72%] Building CXX object devices/CMakeFiles/devices.dir/sound/soundserver.cpp.obj
[ 74%] Building CXX object devices/CMakeFiles/devices.dir/video/atimach64gx.cpp.obj
[ 75%] Building CXX object devices/CMakeFiles/devices.dir/video/atirage.cpp.obj
[ 77%] Building CXX object devices/CMakeFiles/devices.dir/video/control.cpp.obj
[ 78%] Building CXX object devices/CMakeFiles/devices.dir/video/displayid.cpp.obj
C:/msys64/home/Kelsey/dingusppc/devices/video/displayid.cpp: In member function 'uint8_t DisplayID::read_monitor_sense(uint8_t, uint8_t)':
C:/msys64/home/Kelsey/dingusppc/devices/video/displayid.cpp:114:1: warning: control reaches end of non-void function [-Wreturn-type]
114 | }
| ^
[ 80%] Building CXX object devices/CMakeFiles/devices.dir/video/pdmonboard.cpp.obj
[ 81%] Building CXX object devices/CMakeFiles/devices.dir/video/videoctrl.cpp.obj
[ 81%] Built target devices
[ 83%] Building CXX object debugger/CMakeFiles/debugger.dir/debugger.cpp.obj
[ 83%] Built target debugger
[ 84%] Building CXX object machines/CMakeFiles/machines.dir/machinebase.cpp.obj
[ 86%] Building CXX object machines/CMakeFiles/machines.dir/machinecatalyst.cpp.obj
[ 87%] Building CXX object machines/CMakeFiles/machines.dir/machinefactory.cpp.obj
[ 89%] Building CXX object machines/CMakeFiles/machines.dir/machinegossamer.cpp.obj
[ 90%] Building CXX object machines/CMakeFiles/machines.dir/machinepdm.cpp.obj
[ 92%] Building CXX object machines/CMakeFiles/machines.dir/machineproperties.cpp.obj
[ 93%] Building CXX object machines/CMakeFiles/machines.dir/machinetnt.cpp.obj
[ 93%] Built target machines
[ 95%] Building CXX object utils/CMakeFiles/utils.dir/profiler.cpp.obj
[ 95%] Built target utils
[ 96%] Building CXX object thirdparty/loguru/CMakeFiles/loguru.dir/loguru.cpp.obj
C:/msys64/home/Kelsey/dingusppc/thirdparty/loguru/loguru.cpp:124: warning: "NOMINMAX" redefined
124 | #define NOMINMAX
|
In file included from C:/msys64/mingw64/include/c++/12.2.0/x86_64-w64-mingw32/bits/c++config.h:655,
from C:/msys64/mingw64/include/c++/12.2.0/bits/stl_algobase.h:59,
from C:/msys64/mingw64/include/c++/12.2.0/algorithm:60,
from C:/msys64/home/Kelsey/dingusppc/thirdparty/loguru/loguru.cpp:36:
C:/msys64/mingw64/include/c++/12.2.0/x86_64-w64-mingw32/bits/os_defines.h:45: note: this is the location of the previous definition
45 | #define NOMINMAX 1
|
C:/msys64/home/Kelsey/dingusppc/thirdparty/loguru/loguru.cpp: In function 'char* loguru::get_thread_name_win32()':
C:/msys64/home/Kelsey/dingusppc/thirdparty/loguru/loguru.cpp:933:89: warning: 'thread' attribute directive ignored [-Wattributes]
933 | __declspec( thread ) static char thread_name[LOGURU_THREADNAME_WIDTH + 1] = {0};
| ^
[ 96%] Built target loguru
[ 98%] Building CXX object CMakeFiles/dingusppc.dir/main.cpp.obj
[100%] Linking CXX executable bin/dingusppc.exe
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/dingusppc.dir/objects.a(loguru.cpp.obj):loguru.cpp:(.text+0x3407): undefined reference to `__imp__dupenv_s'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/dingusppc.dir/objects.a(loguru.cpp.obj):loguru.cpp:(.text+0x3637): undefined reference to `__imp__dupenv_s'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/dingusppc.dir/objects.a(loguru.cpp.obj):loguru.cpp:(.text+0x5bad): undefined reference to `__imp__dupenv_s'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/SDL2/lib/x64/SDL2main.lib(x64/Release/SDL_windows_main.obj):(.text[OutOfMemory]+0x1a): undefined reference to `SDL_ShowSimpleMessageBox'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/SDL2/lib/x64/SDL2main.lib(x64/Release/SDL_windows_main.obj):(.text[main_getcmdline]+0x37): undefined reference to `SDL_ShowSimpleMessageBox'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/SDL2/lib/x64/SDL2main.lib(x64/Release/SDL_windows_main.obj):(.text[main_getcmdline]+0x58): undefined reference to `SDL_calloc'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/SDL2/lib/x64/SDL2main.lib(x64/Release/SDL_windows_main.obj):(.text[main_getcmdline]+0x79): undefined reference to `SDL_ShowSimpleMessageBox'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/SDL2/lib/x64/SDL2main.lib(x64/Release/SDL_windows_main.obj):(.text[main_getcmdline]+0xb6): undefined reference to `SDL_wcslen'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/SDL2/lib/x64/SDL2main.lib(x64/Release/SDL_windows_main.obj):(.text[main_getcmdline]+0xd1): undefined reference to `SDL_iconv_string'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/SDL2/lib/x64/SDL2main.lib(x64/Release/SDL_windows_main.obj):(.text[main_getcmdline]+0xfd): undefined reference to `SDL_SetMainReady'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/SDL2/lib/x64/SDL2main.lib(x64/Release/SDL_windows_main.obj):(.text[main_getcmdline]+0x11c): undefined reference to `SDL_free'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/SDL2/lib/x64/SDL2main.lib(x64/Release/SDL_windows_main.obj):(.text[main_getcmdline]+0x130): undefined reference to `SDL_free'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/SDL2/lib/x64/SDL2main.lib(x64/Release/SDL_windows_main.obj):(.text[main_getcmdline]+0x16c): undefined reference to `SDL_ShowSimpleMessageBox'
collect2.exe: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/dingusppc.dir/build.make:210: bin/dingusppc.exe] Error 1
make[2]: *** [CMakeFiles/Makefile2:236: CMakeFiles/dingusppc.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:243: CMakeFiles/dingusppc.dir/rule] Error 2
make: *** [Makefile:169: dingusppc] Error 2
Seems like SDL 2 is failing now. Not sure what could be causing it to fail with the linker.
There's also an error like "undefined reference to `impdupenv_s'", which could be fixed by adding the --libs argument.
Adding -lSDL2
to CMAKE_CXX_STANDARD_LIBRARIES got rid of the SDL linking error.
There's also an error like "undefined reference to `impdupenv_s'", which could be fixed by adding the --libs argument.
What program is that --libs
argument for? CMake doesn't recognize that option.
Whoops, seems --libs is for pkg-config.
pkg-config needs a package name to be specified, and I'm not sure what package is causing the problem.
Loguru is the other library I noticed that has issues linking. Not sure how MinGW is trying to compile this.
Output of make with ld -v
:
[100%] Linking CXX executable bin/dingusppc.exe
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\c++.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-12.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/include --libexecdir=/mingw64/lib --enable-bootstrap --enable-checking=release --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev4, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --disable-libstdcxx-debug --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Rev4, Built by MSYS2 project)
COMPILER_PATH=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/;C:/msys64/mingw64/bin/../lib/gcc/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/
LIBRARY_PATH=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/;C:/msys64/mingw64/bin/../lib/gcc/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../
COLLECT_GCC_OPTIONS='-v' '-O2' '-g' '-D' 'NDEBUG' '-o' 'bin/dingusppc.exe' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'bin/dingusppc.'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/collect2.exe -plugin C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/liblto_plugin.dll -plugin-opt=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\msys64\tmp\ccZ71ags.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep -Bdynamic -o bin/dingusppc.exe C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../lib/crt2.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/crtbegin.o -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0 -LC:/msys64/mingw64/bin/../lib/gcc -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../.. @C:\msys64\tmp\ccmzajhJ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../lib/default-manifest.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/crtend.o
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/dingusppc.dir/objects.a(loguru.cpp.obj): in function `loguru::home_dir()':
C:/msys64/home/Kelsey/dingusppc/thirdparty/loguru/loguru.cpp:665: undefined reference to `__imp__dupenv_s'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/loguru/loguru.cpp:665: undefined reference to `__imp__dupenv_s'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/home/Kelsey/dingusppc/thirdparty/loguru/loguru.cpp:665: undefined reference to `__imp__dupenv_s'
collect2.exe: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/dingusppc.dir/build.make:212: bin/dingusppc.exe] Error 1
make[2]: *** [CMakeFiles/Makefile2:236: CMakeFiles/dingusppc.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:243: CMakeFiles/dingusppc.dir/rule] Error 2
make: *** [Makefile:169: dingusppc] Error 2
https://issueantenna.com/repo/emilk/loguru/issues/128 Found one related issue.
https://issueantenna.com/repo/emilk/loguru/issues/128 Found one related issue.
After putting #ifdef _MSC_VER
and #endif
after the following lines:
const char* home_dir()
{
#ifdef _WIN32
char* user_profile;
size_t len;
#ifdef _MSC_VER // here
errno_t err = _dupenv_s(&user_profile, &len, "USERPROFILE");
CHECK_F(err != 0, "Missing USERPROFILE");
#endif // and here
return user_profile;
#else // _WIN32
auto home = getenv("HOME");
CHECK_F(home != nullptr, "Missing HOME");
return home;
#endif // _WIN32
}
The build has no more errors, but the resulting binary can only be run from within the MinGW terminal and I get missing DLL errors if I run it from outside (e.g. CMD)
You'll want to download the SDL2 DLL (or just copy the DLL from the SDL2 folder over to the same place as the DingusPPC executable). After that, there should be no more issues.
Not only do I have to copy SDL2.dll, but also libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll, only then will the emulator work.
Also 2 bugs: one being that the emulator window is always not responding despite actually still running, the other being when you quit from the debugger after entering it with Ctrl-C, the emulator will crash:
Thread 1 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2984.0x3158]
0x00007ff7503f7b47 in ppc_set_cur_instruction (ptr=ptr@entry=0x1ec25c51c50 <error: Cannot access memory at address 0x1ec25c51c50>) at C:/msys64/home/Kelsey/dingusppc/cpu/ppc/ppcmmu.cpp:89
89 ppc_cur_instruction = READ_DWORD_BE_A(ptr);
(gdb) bt
#0 0x00007ff7503f7b47 in ppc_set_cur_instruction (
ptr=ptr@entry=0x1ec25c51c50 <error: Cannot access memory at address 0x1ec25c51c50>)
at C:/msys64/home/Kelsey/dingusppc/cpu/ppc/ppcmmu.cpp:89
#1 0x00007ff7503f25be in ppc_exec_inner ()
at C:/msys64/home/Kelsey/dingusppc/cpu/ppc/ppcexec.cpp:375
#2 ppc_exec () at C:/msys64/home/Kelsey/dingusppc/cpu/ppc/ppcexec.cpp:391
#3 0x00007ff7503e51cd in SDL_main (argc=<optimized out>, argv=0x1ec1d898ee0)
at C:/msys64/home/Kelsey/dingusppc/main.cpp:202
#4 0x00007ff750436cfd in main_getcmdline ()
#5 0x00007ff7503e13ae in __tmainCRTStartup ()
at C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:329
#6 0x00007ff7503e14e6 in mainCRTStartup ()
at C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:206
I've known about the former for a while, but the latter is new. My guess is that it's still trying to execute code, but Ctrl-C isn't quite working right somehow.
@dingusdev git bisect
Looks like MINGW can't find
_fileno
. I suggest to changedevices/serial/chario.cpp
like this: Then recompile the project. Did it work?
Despite making modifications to devices/serial/chario.cpp, the persistently frustrating error continues to appear for me.
To reproduce in 64-bit MSYS2:
Output log of CMake:
Output log of
make dingusppc
: