audetto / AppleWin

Apple II emulator for Linux
GNU General Public License v2.0
50 stars 12 forks source link

MacOsX Build #39

Closed jvernet closed 11 months ago

jvernet commented 3 years ago

Hello,

I'm trying to build on MacOsX (10.13). cmake ask for libevdev and libglesv2. None of them seems to exist on MacOsX.

Are they totally mandatory ?

audetto commented 3 years ago

No. But, I wonder which of the frontends is MacOsX ready.

Feel free to comment out lines 36, 37 & 39 from https://github.com/audetto/AppleWin/blob/master/CMakeLists.txt#L34

But then you need to find out how to use ImGui on OsX and change this area (and source code) accordingly. https://github.com/audetto/AppleWin/blob/master/source/frontends/sdl/CMakeLists.txt

If all fails and you can only compile / link SDL2, then you have to manually remove all of this https://github.com/audetto/AppleWin/tree/master/source/frontends/sdl/imgui

You will have problems with libpcap and libslirp too. None of which are compulsory, but you will have to add some #ifdef around.

jvernet commented 3 years ago

I can go a little bit further selecting Qt only. sa2 require glesv2

`jeromevernet@macbook ~/D/d/G/A/build (master)> cmake .. -DCMAKE_PREFIX_PATH=/Users/jeromevernet/Qt/5.15.2/clang_64/ -- The C compiler identification is AppleClang 9.1.0.9020039 -- The CXX compiler identification is AppleClang 9.1.0.9020039 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMAKE_BUILD_TYPE:
CMAKE_CXX_FLAGS:
CMAKE_CXX_FLAGS_RELEASE: -O3 -DNDEBUG CMAKE_CXX_FLAGS_DEBUG: -g CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O2 -g -DNDEBUG -- Found PkgConfig: /opt/local/bin/pkg-config (found version "0.29.2") -- Checking for module 'yaml-0.1' -- Found yaml-0.1, version 0.2.5 -- Checking for module 'minizip' -- Found minizip, version 1.2.11 -- Checking for module 'slirp' -- Found slirp, version 4.4.0 -- Checking for module 'libpcap' -- Found libpcap, version 1.10.1 -- Found Boost: /opt/local/include (found version "1.76.0")
CMake Warning at /Applications/CMake.app/Contents/share/cmake-3.19/Modules/FindBoost.cmake:1219 (message): New Boost version may have incorrect or missing dependencies and imported targets Call Stack (most recent call first): /Applications/CMake.app/Contents/share/cmake-3.19/Modules/FindBoost.cmake:1341 (_Boost_COMPONENT_DEPENDENCIES) /Applications/CMake.app/Contents/share/cmake-3.19/Modules/FindBoost.cmake:1950 (_Boost_MISSING_DEPENDENCIES) source/frontends/common2/CMakeLists.txt:28 (find_package)

-- Found Boost: /opt/local/include (found version "1.76.0") found components: program_options -- Configuring done -- Generating done -- Build files have been written to: /Users/jeromevernet/Documents/dev/Github/AppleWin/build`

But make fail with errors `jeromevernet@macbook ~/D/d/G/A/build (master)> make -j2 Scanning dependencies of target common2 Scanning dependencies of target appleii [ 0%] Building CXX object source/CMakeFiles/appleii.dir/Tfe/tfe.cpp.o [ 1%] Building CXX object source/frontends/common2/CMakeFiles/common2.dir/commonframe.cpp.o In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/tfe.cpp:27: In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/../StdAfx.h:58: In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/win.h:16: /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:81:25: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] size_t myPlayPosition = 0; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:82:26: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] size_t myWritePosition = 0; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:83:17: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] WORD myStatus = 0; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:84:17: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] LONG myVolume = DSBVOLUME_MAX; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:94:21: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] HRESULT Release() override; ^ In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.cpp:1: In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/StdAfx.h:58: In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/win.h:16: /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:81:25: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] size_t myPlayPosition = 0; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:82:26: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] size_t myWritePosition = 0; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:83:17: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] WORD myStatus = 0; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:84:17: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] LONG myVolume = DSBVOLUME_MAX; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:94:21: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] HRESULT Release() override; ^ In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.cpp:2: In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.h:3: In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:3: /Users/jeromevernet/Documents/dev/Github/AppleWin/source/FrameBase.h:76:14: error: implicit instantiation of undefined template 'std::1::basic_string<char, std::__1::char_traits, std::1::allocator >' std::string g_pLastDiskImageName; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is declared here class _LIBCPP_TEMPLATE_VIS basic_string; ^ In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.cpp:2: In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.h:3: /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:10:21: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void Initialize() override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:11:18: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void Destroy() override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:13:28: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void FrameDrawDiskLEDS() override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:14:30: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void FrameDrawDiskStatus() override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:15:42: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void FrameRefreshStatus(int drawflags) override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:16:32: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void FrameUpdateApple2Type() override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:17:38: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void FrameSetCursorPosByMousePos() override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:19:51: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void SetFullScreenShowSubunitStatus(bool bShow) override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:20:111: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedHeight = 0) override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:21:60: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] int SetViewportScale(int nNewScale, bool bForce = false) override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:22:47: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void SetAltEnterToggleFullScreen(bool mode) override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:24:49: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void SetLoadedSaveStateFlag(const bool bFlag) override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:26:18: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void Restart() override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/linuxframe.h:27:64: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits) override; ^ 5 warnings generated. In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.cpp:2: /Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.h:15[ 2%] Building CXX object source/CMakeFiles/appleii.dir/Tfe/tfearch.cpp.o :23: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void Initialize() override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.h:16:20: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void Destroy() override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.h:17:20: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] void Restart() override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.h:19:67: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions] BYTE* GetResource(WORD id, LPCSTR lpType, DWORD expectedSize) override; ^ /Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.cpp:43:13: **error: no member named 'emplace_back' in 'std::1::vector<std::1::basic_string, std::1::allocator<std::1::basic_string > >' paths.emplace_back(std::string(path) + '/'+ ROOT_PATH);


/Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.cpp:45:13: error: no member named
      'emplace_back' in 'std::__1::vector<std::__1::basic_string<char>, std::__1::allocator<std::__1::basic_string<char> > >'
      paths.emplace_back(std::string(path) + '/'+ SHARE_PATH);
      ~~~~~ ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.cpp:49:11: error: no member named
      'emplace_back' in 'std::__1::vector<std::__1::basic_string<char>, std::__1::allocator<std::__1::basic_string<char> > >'
    paths.emplace_back(CMAKE_SOURCE_DIR);
    ~~~~~ ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.cpp:51:35: warning: range-based for loop is a
      C++11 extension [-Wc++11-extensions]
    for (const std::string & path : paths)
                                  ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.cpp:83:17: error: cannot initialize object
      parameter of type 'LinuxFrame' with an expression of type 'common2::CommonFrame'
    LinuxFrame::Initialize();
                ^~~~~~~~~~
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/frontends/common2/commonframe.cpp:88:17: error: cannot initialize object
      parameter of type 'LinuxFrame' with an expression of type 'common2::CommonFrame'
    LinuxFrame::Destroy();
                ^~~~~~~
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/tfearch.cpp:30:10: warning: non-portable path to file '"Pcap.h"';
      specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "pcap.h"
         ^~~~~~~~
         "Pcap.h"
24 warnings and 6 errors generated.
make[2]: *** [source/frontends/common2/CMakeFiles/common2.dir/commonframe.cpp.o] Error 1
make[1]: *** [source/frontends/common2/CMakeFiles/common2.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/tfearch.cpp:30:
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/pcap.h:49:10: warning: non-portable path to file '"Bpf.h"'; specified
      path differs in case from file name on disk [-Wnonportable-include-path]
#include "bpf.h"
         ^~~~~~~
         "Bpf.h"
[  3%] Building CXX object source/CMakeFiles/appleii.dir/Tfe/tfesupp.cpp.o
[  4%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debug.cpp.o
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/tfearch.cpp:37:
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/StdAfx.h:58:
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/win.h:16:
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:81:25: warning: in-class initialization of
      non-static data member is a C++11 extension [-Wc++11-extensions]
  size_t myPlayPosition = 0;
                        ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:82:26: warning: in-class initialization of
      non-static data member is a C++11 extension [-Wc++11-extensions]
  size_t myWritePosition = 0;
                         ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:83:17: warning: in-class initialization of
      non-static data member is a C++11 extension [-Wc++11-extensions]
  WORD myStatus = 0;
                ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:84:17: warning: in-class initialization of
      non-static data member is a C++11 extension [-Wc++11-extensions]
  LONG myVolume = DSBVOLUME_MAX;
                ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:94:21: warning: 'override' keyword is a C++11
      extension [-Wc++11-extensions]
  HRESULT Release() override;
                    ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/tfearch.cpp:160:27: error: use of undeclared identifier
      'pcap_lib_version'
        LogOutput("%s\n", p_pcap_lib_version());
                          ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/tfearch.cpp:152:28: note: expanded from macro 'p_pcap_lib_version'
#define p_pcap_lib_version pcap_lib_version
                           ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/tfearch.cpp:161:31: error: use of undeclared identifier
      'pcap_lib_version'
        LogFileOutput("%s\n", p_pcap_lib_version());
                              ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/tfearch.cpp:152:28: note: expanded from macro 'p_pcap_lib_version'
#define p_pcap_lib_version pcap_lib_version
                           ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/tfearch.cpp:533:11: error: use of undeclared identifier
      'pcap_sendpacket'
    if ((*p_pcap_sendpacket)(TfePcapFP, txframe, txlength) == -1) {
          ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Tfe/tfearch.cpp:150:27: note: expanded from macro 'p_pcap_sendpacket'
#define p_pcap_sendpacket pcap_sendpacket
                          ^
7 warnings and 3 errors generated.
make[2]: *** [source/CMakeFiles/appleii.dir/Tfe/tfearch.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:32:
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/StdAfx.h:58:
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/win.h:16:
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:81:25: warning: in-class initialization of
      non-static data member is a C++11 extension [-Wc++11-extensions]
  size_t myPlayPosition = 0;
                        ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:82:26: warning: in-class initialization of
      non-static data member is a C++11 extension [-Wc++11-extensions]
  size_t myWritePosition = 0;
                         ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:83:17: warning: in-class initialization of
      non-static data member is a C++11 extension [-Wc++11-extensions]
  WORD myStatus = 0;
                ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:84:17: warning: in-class initialization of
      non-static data member is a C++11 extension [-Wc++11-extensions]
  LONG myVolume = DSBVOLUME_MAX;
                ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/linux/windows/dsound.h:94:21: warning: 'override' keyword is a C++11
      extension [-Wc++11-extensions]
  HRESULT Release() override;
                    ^
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:40:
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/../Interface.h:17:
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/FrameBase.h:76:14: error: implicit instantiation of undefined template
      'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        std::string g_pLastDiskImageName;
                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:43:
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/../Disk.h:28:
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/DiskFormatTrack.h:67:14: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        std::string m_strReadD5AAxxDetected;
                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:43:
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/../Disk.h:28:
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/DiskFormatTrack.h:45:14: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        std::string GetReadD5AAxxDetectedString(void) { std::string tmp = m_strReadD5AAxxDetected; m_strReadD5AAxxDetected ...
                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:43:
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/../Disk.h:28:
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/DiskFormatTrack.h:45:62: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        std::string GetReadD5AAxxDetectedString(void) { std::string tmp = m_strReadD5AAxxDetected; m_strReadD5AAxxDetected ...
                                                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:43:
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/../Disk.h:73:14: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        std::string m_imagename;        // <FILENAME> (ie. no extension)
                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:43:
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/../Disk.h:74:14: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        std::string m_fullname; // <FILENAME.EXT> or <FILENAME.zip>  : This is persisted to the snapshot file
                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:43:
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/../Disk.h:75:14: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        std::string m_strFilenameInZip;                                 // ""             or <FILENAME.EXT>
                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
In file included from /Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:47:
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/../SoundCore.h:22:14: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        std::string name;
                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:230:20: **error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        const std::string g_FileNameProfile = TEXT("Profile.txt"); // changed from .csv to .txt since Excel doesn't give imp...
                          ^**
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:250:14: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        std::string g_aSourceFileName;
                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:290:14: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        std::string g_sFileNameConfig     =
                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:2039:15: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
                std::string sFileName;
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:2048:21: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
                const std::string sFilePath = g_sCurrentDir + sFileName;
                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:2350:46: error: invalid operands to binary expression
      ('std::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >') and 'const char *')
        const std::string sFileName = g_sCurrentDir + pFileName; // TODO: g_sDebugDir
                                      ~~~~~~~~~~~~~ ^ ~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:765:1: note: candidate
      template ignored: could not match 'reverse_iterator<type-parameter-0-0>' against 'const char *'
operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:1184:1: note: candidate
      template ignored: could not match 'move_iterator<type-parameter-0-0>' against 'const char *'
operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:1455:5: note: candidate
      template ignored: could not match '__wrap_iter<type-parameter-0-0>' against 'const char *'
    operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT_DEBUG;
    ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:2350:20: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        const std::string sFileName = g_sCurrentDir + pFileName; // TODO: g_sDebugDir
                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:2404:20: **error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        const std::string sFilename = g_sProgramDir + g_sFileNameConfig;**
                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:3279:13: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
                        diskCard.GetCurrentTrackString().c_str(),
                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:3280:13: error: implicit instantiation of undefined
      template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
                        diskCard.GetCurrentPhaseString().c_str(),
                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:193:32: note: template is
      declared here
    class _LIBCPP_TEMPLATE_VIS basic_string;
                               ^
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/Debug.cpp:3337:32: error: reference to type 'const std::string'
      (aka 'const basic_string<char, char_traits<char>, allocator<char> >') could not bind to an lvalue of type 'LPCTSTR'
      (aka 'const char *')
                diskCard.InsertDisk( iDrive, pDiskName, IMAGE_FORCE_WRITE_PROTECTED, IMAGE_DONT_CREATE );
                                             ^~~~~~~~~
/Users/jeromevernet/Documents/dev/Github/AppleWin/source/Debugger/../Disk.h:145:62: note: passing argument to parameter 'pathname'
      here
        ImageError_e InsertDisk(const int drive, const std::string& pathname, const bool bForceWriteProtected, const bool bC...
                                                                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5 warnings and 20 errors generated.
make[2]: *** [source/CMakeFiles/appleii.dir/Debugger/Debug.cpp.o] Error 1
make[1]: *** [source/CMakeFiles/appleii.dir/all] Error 2
make: *** [all] Error 2
`
audetto commented 3 years ago

The compiler seems to have issues with C++11.

Try to add this

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
  1. make VERBOSE=1 to see exactly what is executed
  2. see if you can copy error messages in a more readable way
  3. you will have to modify the code and see if you can figure out what it is not happy about
jvernet commented 3 years ago

That shut off C11 warnings Next, I had to correct "Bpf.h" and "Pcacp.h' in tfearch.cpp (caption in the filename). Then, there is error with p_cap function, and error in linuxframe.h, like implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >' std::string g_pLastDiskImageName; See attached file macosxError.txt ar

audetto commented 3 years ago

I wouldn't do that. It should ignore them and use the system header files. You should try to figure out why it cannot find system header files for pcap. I think this is the cause of the other pcap errors too. The "mispelling" is actually a feature, otherwise I would have to remove the files as I want to use system's pcap and not AW's.

common2: it is not needed to QT, comment out the makefile line.

jvernet commented 3 years ago

in source/tTfe there is a file Pcap.h. In tsearch.cpp, a #include "pcap.h" it should be #include so that the correct headr file is used. I can pass it now Now, I have error in Debugger.Cpp about ConsoleBuffer . Is there a way to remove Debugger also ?

I need to add #include everywhere !

jvernet commented 3 years ago

I'm making progress... Now it goes to the linking phase, but stop with ld: library not found for -lyaml

libyaml was found before, but cmake do not go in /opt/local/lib where libyaml lib are... Cannot figure out HOW i can add lib path the cmake build system.... There is no more -L option in final make !

audetto commented 3 years ago

I've fixed 3 things you reported (pcap, string and C++11).

Adding many header files should not be required. Which ones did you need?

Re yaml:

try to add statements like this

message("YAML INFO: ${YAML_LIBRARIES} and ${YAML_INCLUDE_DIRS}.")

to

https://github.com/audetto/AppleWin/blob/master/source/CMakeLists.txt#L6

and see what gets printed.

cmake uses pkg-config so make sure yours is setup properly.

pkg-config yaml-0.1 --libs or pkg-config yaml-0.1 --cflags

for this and other 3rd party libs.

Edit:

unless you need to use

_LINK_LIBRARIES instead of _LIBRARIES in places like https://github.com/audetto/AppleWin/blob/master/source/CMakeLists.txt#L244

jvernet commented 3 years ago

I need to add some headers like sys/types/h in the network sources and #include everywhere else

cmake found yaml: YAML_LIBRARIES: yaml YAML_INCLUDE_DIRS: /opt/local/include YAML_LIBRARY_DIRS: /opt/local/lib

and $>pkg-config yaml-0.1 --libs -L/opt/local/lib -lyaml

cmake simply do not add ANY -L library search path to the link phase. More over, I want to link against static library so that you will need to havev them installed, so I added set(BUILD_SHARED_LIBS OFF) set(CMAKE_EXE_LINKER_FLAGS "-static") link_libraries("-static")

but cmake don't care about it (cmake version 3.21.3) [ 84%] Linking CXX shared library libappleii.dylib cd /Users/jeromevernet/Documents/dev/Github/AppleWin/build/source && /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/appleii.dir/link.txt --verbose=1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -O3 -DNDEBUG -dynamiclib -Wl,-headerpad_max_install_names -o libappleii.dylib -install_name @rpath/libappleii.dylib CMakeFiles/appleii.dir/Tfe/tfe.cpp.o CMakeFiles/appleii.dir/Tfe/tfearch.cpp.o CMakeFiles/appleii.dir/Tfe/tfesupp.cpp.o CMakeFiles/appleii.dir/Debugger/Debug.cpp.o CMakeFiles/appleii.dir/Debugger/Debugger_Help.cpp.o CMakeFiles/appleii.dir/Debugger/Debugger_Color.cpp.o CMakeFiles/appleii.dir/Debugger/Debugger_Disassembler.cpp.o CMakeFiles/appleii.dir/Debugger/Debugger_Symbols.cpp.o CMakeFiles/appleii.dir/Debugger/Debugger_DisassemblerData.cpp.o CMakeFiles/appleii.dir/Debugger/Debugger_Console.cpp.o CMakeFiles/appleii.dir/Debugger/Debugger_Assembler.cpp.o CMakeFiles/appleii.dir/Debugger/Debugger_Parser.cpp.o CMakeFiles/appleii.dir/Debugger/Debugger_Range.cpp.o CMakeFiles/appleii.dir/Debugger/Debugger_Commands.cpp.o CMakeFiles/appleii.dir/Debugger/Util_MemoryTextFile.cpp.o CMakeFiles/appleii.dir/SSI263.cpp.o CMakeFiles/appleii.dir/Speaker.cpp.o CMakeFiles/appleii.dir/SoundCore.cpp.o CMakeFiles/appleii.dir/AY8910.cpp.o CMakeFiles/appleii.dir/Mockingboard.cpp.o CMakeFiles/appleii.dir/Pravets.cpp.o CMakeFiles/appleii.dir/YamlHelper.cpp.o CMakeFiles/appleii.dir/Log.cpp.o CMakeFiles/appleii.dir/Disk.cpp.o CMakeFiles/appleii.dir/DiskFormatTrack.cpp.o CMakeFiles/appleii.dir/DiskImage.cpp.o CMakeFiles/appleii.dir/DiskImageHelper.cpp.o CMakeFiles/appleii.dir/Harddisk.cpp.o CMakeFiles/appleii.dir/Memory.cpp.o CMakeFiles/appleii.dir/CPU.cpp.o CMakeFiles/appleii.dir/6821.cpp.o CMakeFiles/appleii.dir/NoSlotClock.cpp.o CMakeFiles/appleii.dir/SAM.cpp.o CMakeFiles/appleii.dir/z80emu.cpp.o CMakeFiles/appleii.dir/ParallelPrinter.cpp.o CMakeFiles/appleii.dir/MouseInterface.cpp.o CMakeFiles/appleii.dir/LanguageCard.cpp.o CMakeFiles/appleii.dir/RGBMonitor.cpp.o CMakeFiles/appleii.dir/NTSC.cpp.o CMakeFiles/appleii.dir/NTSC_CharSet.cpp.o CMakeFiles/appleii.dir/CardManager.cpp.o CMakeFiles/appleii.dir/Disk2CardManager.cpp.o CMakeFiles/appleii.dir/Riff.cpp.o CMakeFiles/appleii.dir/SaveState.cpp.o CMakeFiles/appleii.dir/SynchronousEventManager.cpp.o CMakeFiles/appleii.dir/Video.cpp.o CMakeFiles/appleii.dir/Core.cpp.o CMakeFiles/appleii.dir/Utilities.cpp.o CMakeFiles/appleii.dir/FrameBase.cpp.o CMakeFiles/appleii.dir/Configuration/PropertySheetHelper.cpp.o CMakeFiles/appleii.dir/linux/windows/handles.cpp.o CMakeFiles/appleii.dir/linux/windows/files.cpp.o CMakeFiles/appleii.dir/linux/windows/time.cpp.o CMakeFiles/appleii.dir/linux/windows/stringcb.cpp.o CMakeFiles/appleii.dir/linux/windows/strings.cpp.o CMakeFiles/appleii.dir/linux/windows/misc.cpp.o CMakeFiles/appleii.dir/linux/windows/winbase.cpp.o CMakeFiles/appleii.dir/linux/windows/winuser.cpp.o CMakeFiles/appleii.dir/linux/windows/dsound.cpp.o CMakeFiles/appleii.dir/linux/windows/guiddef.cpp.o CMakeFiles/appleii.dir/linux/windows/dmusicc.cpp.o CMakeFiles/appleii.dir/linux/windows/winnls.cpp.o CMakeFiles/appleii.dir/linux/resources.cpp.o CMakeFiles/appleii.dir/linux/benchmark.cpp.o CMakeFiles/appleii.dir/linux/paddle.cpp.o CMakeFiles/appleii.dir/linux/version.cpp.o CMakeFiles/appleii.dir/linux/registry.cpp.o CMakeFiles/appleii.dir/linux/keyboard.cpp.o CMakeFiles/appleii.dir/linux/linuxframe.cpp.o CMakeFiles/appleii.dir/linux/context.cpp.o CMakeFiles/appleii.dir/linux/tape.cpp.o CMakeFiles/appleii.dir/linux/network/uthernet2.cpp.o CMakeFiles/appleii.dir/linux/network/tfe2.cpp.o CMakeFiles/appleii.dir/linux/network/slirp2.cpp.o CMakeFiles/appleii.dir/linux/duplicates/Debugger_Display.cpp.o CMakeFiles/appleii.dir/linux/duplicates/Debugger_Win32.cpp.o CMakeFiles/appleii.dir/linux/duplicates/Joystick.cpp.o CMakeFiles/appleii.dir/linux/duplicates/SerialComms.cpp.o CMakeFiles/appleii.dir/linux/duplicates/PropertySheet.cpp.o CMakeFiles/appleii.dir/Z80VICE/z80.cpp.o CMakeFiles/appleii.dir/Z80VICE/z80mem.cpp.o CMakeFiles/appleii.dir/Z80VICE/daa.cpp.o -static -lyaml -lminizip -lpcap ld: library not found for -lyaml

audetto commented 3 years ago

Try now. I've added https://github.com/audetto/AppleWin/blob/master/source/CMakeLists.txt#L250

jvernet commented 3 years ago

_LINK_LIBRARIES instead of _LIBRARIES in places like.. do the job.

Now, I'm dealing with a mixe of 64 and 32 bits library

audetto commented 3 years ago

I need to add some headers like sys/types/h in the network sources and #include everywhere else

you will have to be more precise than that.

_LINK_LIBRARIES instead of _LIBRARIES in places like.. do the job.

I've added the library dir separately. Will do it to the other cases too.

Now, I'm dealing with a mixe of 64 and 32 bits library

retry with my latest code.

jvernet commented 3 years ago

Back with a fresh git clone. Will need to note what I'm doing to go at least at link time.

I forgot to mention this error: /Users/jeromevernet/Documents/dev/Github/temp/AppleWin/source/Debugger/Debug.cpp:814:53: error: cannot pass object of non-trivial type 'const std::string' (aka 'const basic_string<char, char_traits<char>, allocator<char> >') through variadic function; call will abort at runtime [-Wnon-pod-varargs] ConsoleBufferPushFormat ( sText, " Saved: %s", g_FileNameProfile ); I simply removed g_FileNameProfile in such ConsoleBufferFormat calls.

jvernet commented 3 years ago

In benchmark.cpp it complain about Interface.h. Need to use "../Interface.h" Same in linuxframe `[ 1%] Building CXX object source/CMakeFiles/appleii.dir/linux/benchmark.cpp.o /Users/jeromevernet/Documents/dev/Github/temp/AppleWin/source/linux/benchmark.cpp:12:10: warning: non-portable path to file "interface.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]

include "Interface.h"

     ^~~~~~~~~~~~~
     "interface.h"

/Users/jeromevernet/Documents/dev/Github/temp/AppleWin/source/linux/benchmark.cpp:20:3: error: unknown type name 'FrameBase' FrameBase & frame = GetFrame(); ^ /Users/jeromevernet/Documents/dev/Github/temp/AppleWin/source/linux/benchmark.cpp:20:23: error: use of undeclared identifier 'GetFrame' FrameBase & frame = GetFrame(); ^ /Users/jeromevernet/Documents/dev/Github/temp/AppleWin/source/linux/benchmark.cpp:21:19: error: use of undeclared identifier 'GetVideo' Video & video = GetVideo(); ^ 1 warning and 3 errors generated.`

audetto commented 3 years ago

Back with a fresh git clone. Will need to note what I'm doing to go at least at link time.

I forgot to mention this error: /Users/jeromevernet/Documents/dev/Github/temp/AppleWin/source/Debugger/Debug.cpp:814:53: error: cannot pass object of non-trivial type 'const std::string' (aka 'const basic_string<char, char_traits<char>, allocator<char> >') through variadic function; call will abort at runtime [-Wnon-pod-varargs] ConsoleBufferPushFormat ( sText, " Saved: %s", g_FileNameProfile ); I simply removed g_FileNameProfile in such ConsoleBufferFormat calls.

Yes, I am aware of some issues, I have a PR ready. But this has to go to AppleWin, so it will take a bit longer, for now, just comment out.

I am pleased to see that clang warns by default.

audetto commented 3 years ago

In benchmark.cpp it complain about Interface.h. Need to use "../Interface.h" Same in linuxframe [ 1%] Building CXX object source/CMakeFiles/appleii.dir/linux/benchmark.cpp.o /Users/jeromevernet/Documents/dev/Github/temp/AppleWin/source/linux/benchmark.cpp:12:10: warning: non-portable path to file "interface.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path] #include "Interface.h" ^~~~~~~~~~~~~ "interface.h" /Users/jeromevernet/Documents/dev/Github/temp/AppleWin/source/linux/benchmark.cpp:20:3: error: unknown type name 'FrameBase' FrameBase & frame = GetFrame(); ^ /Users/jeromevernet/Documents/dev/Github/temp/AppleWin/source/linux/benchmark.cpp:20:23: error: use of undeclared identifier 'GetFrame' FrameBase & frame = GetFrame(); ^ /Users/jeromevernet/Documents/dev/Github/temp/AppleWin/source/linux/benchmark.cpp:21:19: error: use of undeclared identifier 'GetVideo' Video & video = GetVideo(); ^ 1 warning and 3 errors generated.

Good point too. I will rename to avoid path warnings.

Renamed.

jvernet commented 3 years ago

In uthernet2.cpp, need to add:

#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <poll.h>

// fix SOCK_NONBLOCK for e.g. macOS
#ifndef SOCK_NONBLOCK
#include <fcntl.h>
#define SOCK_NONBLOCK O_NONBLOCK
#endif
#define
jvernet commented 3 years ago

Next: the gz thing are not obvious as I have 64Bits minizip and gzip lib: lipo -info /opt/local/lib/libminizip.a Architectures in the fat file: /opt/local/lib/libminizip.a are: x86_64 i386

` Undefined symbols for architecture x86_64: "SingleStep(bool)", referenced from: DebugContinueStepping(bool) in Debug.cpp.o

"registerSoundBuffer(IDirectSoundBuffer)", referenced from: IDirectSound::CreateSoundBuffer(_DSBUFFERDESC const, IDirectSoundBuffer*, IUnknown) in dsound.cpp.o

"unregisterSoundBuffer(IDirectSoundBuffer*)", referenced from: IDirectSoundBuffer::Release() in dsound.cpp.o

"_crc32", referenced from: CWOZHelper::CreateEmptyDisk(unsigned int&) in DiskImageHelper.cpp.o CDiskImageHelper::Detect(unsigned char, unsigned int, char const, unsigned int&, ImageInfo) in DiskImageHelper.cpp.o CWOZ1Image::Write(ImageInfo, float, unsigned char, int) in DiskImageHelper.cpp.o CWOZ2Image::Write(ImageInfo, float, unsigned char, int) in DiskImageHelper.cpp.o _unzReadCurrentFile in libminizip.a(unzip.o) _zipWriteInFileInZip in libminizip.a(zip.o) "_deflate", referenced from: _zipWriteInFileInZip in libminizip.a(zip.o) _zipCloseFileInZipRaw64 in libminizip.a(zip.o) "_deflateEnd", referenced from: _zipCloseFileInZipRaw64 in libminizip.a(zip.o) "deflateInit2", referenced from: _zipOpenNewFileInZip4_64 in libminizip.a(zip.o) "_get_crc_table", referenced from: _zipOpenNewFileInZip4_64 in libminizip.a(zip.o) "_gzclose", referenced from: CImageBase::WriteImageData(ImageInfo, unsigned char, unsigned int, long) in DiskImageHelper.cpp.o CImageHelperBase::CheckGZipFile(char const, ImageInfo) in DiskImageHelper.cpp.o "_gzopen", referenced from: CImageBase::WriteImageData(ImageInfo, unsigned char, unsigned int, long) in DiskImageHelper.cpp.o CImageHelperBase::CheckGZipFile(char const, ImageInfo) in DiskImageHelper.cpp.o "_gzread", referenced from: CImageHelperBase::CheckGZipFile(char const, ImageInfo) in DiskImageHelper.cpp.o "_gzwrite", referenced from: CImageBase::WriteImageData(ImageInfo, unsigned char*, unsigned int, long) in DiskImageHelper.cpp.o "_inflate", referenced from: _unzReadCurrentFile in libminizip.a(unzip.o) "_inflateEnd", referenced from: _unzCloseCurrentFile in libminizip.a(unzip.o) "inflateInit2", referenced from: _unzOpenCurrentFile3 in libminizip.a(unzip.o) ld: symbol(s) not found for architecture x86_64 `

audetto commented 3 years ago

OK, couple of things

  1. maybe I need to add libzexplicitly too
  2. basically libappleiie is not fully resolved. it leaves undefined a few things that depend on the frontend. a sort of "link-time" interface. ld lets me do it, but your linker is probably more strict.
  3. Only when I link the final executable, any missing symbols must be present.
  4. I am going to try to allow the project to link as static or to relax the linker flags
  5. Will have to rethink a better way to do that.
audetto commented 3 years ago

I've created a new STATIC branch https://github.com/audetto/AppleWin/tree/static

Try.

jvernet commented 3 years ago

Now it complain about missing zipinfo.... May be minizip at least on macosx do not work. There is libz and zlib directory in applwin tree, may be use them ?

audetto commented 3 years ago

What is zipinfo exactly?

I think system libraries are much more portable and require no maintenance. But give it a go.

jvernet commented 3 years ago

I needed libzip and not minizip for another port... so I need to activate/deactivate minizip libzip and so on... Frameworks on Mac are so easy to use rather than linux libraries.... Simply clic on the one you need, the version you need,embed it in your binary, and done... but cmake struggle to find the correct one.

Ok, I'm going a litle bit further with the static branch. Now it goes to link qapple and again complain about missing library yaml, etc. You need to add them like you did for libappleII

I've added option(BUILD_SHARED_LIBS "Build using shared libraries" OFF) in sources/CMakelist.txt so that ld will use static libs rather that .dylib.

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -O3 -DNDEBUG -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/qapple.dir/qapple_autogen/mocs_compilation.cpp.o CMakeFiles/qapple.dir/main.cpp.o CMakeFiles/qapple.dir/qapple.cpp.o CMakeFiles/qapple.dir/preferences.cpp.o CMakeFiles/qapple.dir/emulator.cpp.o CMakeFiles/qapple.dir/memorycontainer.cpp.o CMakeFiles/qapple.dir/gamepadpaddle.cpp.o CMakeFiles/qapple.dir/qvideo.cpp.o CMakeFiles/qapple.dir/configuration.cpp.o CMakeFiles/qapple.dir/options.cpp.o CMakeFiles/qapple.dir/loggingcategory.cpp.o CMakeFiles/qapple.dir/viewbuffer.cpp.o CMakeFiles/qapple.dir/qdirectsound.cpp.o CMakeFiles/qapple.dir/qtframe.cpp.o CMakeFiles/qapple.dir/qapple_autogen/EWIEGA46WW/qrc_qapple.cpp.o -o ../../../qapple -Wl,-rpath,/Users/jeromevernet/Qt/5.15.2/clang_64/lib /Users/jeromevernet/Qt/5.15.2/clang_64/lib/QtGamepad.framework/QtGamepad /Users/jeromevernet/Qt/5.15.2/clang_64/lib/QtMultimedia.framework/QtMultimedia ../../libappleii.a QHexView/libqhexview-lib.a /Users/jeromevernet/Qt/5.15.2/clang_64/lib/QtNetwork.framework/QtNetwork -lyaml -lminizip -lpcap -lz /Users/jeromevernet/Qt/5.15.2/clang_64/lib/QtWidgets.framework/QtWidgets /Users/jeromevernet/Qt/5.15.2/clang_64/lib/QtGui.framework/QtGui /Users/jeromevernet/Qt/5.15.2/clang_64/lib/QtCore.framework/QtCore ld: library not found for -lyaml

audetto commented 3 years ago

Uhm.. there was a mistake https://github.com/audetto/AppleWin/commit/3904cf58b2bd04845893f5c361842e40cfb3bb9e which affected libraries in non standard locations (which I cant really test).

Otherwise poke around https://github.com/audetto/AppleWin/blob/master/source/CMakeLists.txt#L250 and https://github.com/audetto/AppleWin/blob/master/source/frontends/qt/CMakeLists.txt#L51 adding -L until it works.

Then we can fix cmake.

jvernet commented 3 years ago

I'm making some progess ! Well, I cannot find how to add static lib to qappel CMakeFiles, the same that work for libapple do not work. Simplu modified by hand link.txt.

Got something/ no image no sound ! qapple macosx

jvernet commented 3 years ago

Yesss !! No sound, but something show (using Apple//e emulation). Qapple MacOsX 2

audetto commented 3 years ago

Fantastic. Now

  1. audio: you need to make sure the correct QT audio plugin is installed (and working). all the errors printed on screen indicate QT could not find any
  2. I have kind of stopped developing the QT interface as the one based on ImGui works very well. I am talking about all the configuration options. If you manage to get one of the examples from https://github.com/ocornut/imgui/tree/master/examples to run on your system, then I can integrate it.

This one in particular: https://github.com/ocornut/imgui/tree/master/examples/example_sdl_metal

audetto commented 3 years ago

Even better, this one: https://github.com/ocornut/imgui/blob/master/examples/example_sdl_opengl3/main.cpp

It claims to work on __APPLE__, that would be the easiest to support.

jvernet commented 3 years ago

It's working

imgui macosx

audetto commented 3 years ago

Then I will integrate the if defs. You will have to put back "common2" and "sdl" in the makefiles and work your way through the other issues.

audetto commented 3 years ago

You will have to agree with me that Mac OS X development is a pain. If you could run a VM for it, it would be so much easier!

audetto commented 3 years ago

Ok, in that example the code uses GL 3.2 Core on Apple, while I was using GLES 2 (or 3) to be compatible with the Pi3/4.

Unless Apple supports GLES 2 or 3, the best approach is that I first support GL 3.2 (which I can develop on my desktop), and then the step to Apple will be shorter.

jvernet commented 3 years ago

the example_sdl_opengl2 is also working, metal should be the best thing to use.

Well, if you developpe for MacOsX, it's pretty easy. But porting (multiple) thing from Linux is a pain due to all these library you have to use. On MacOsX, we use Framework (simply packaged library), you can have as much version as you want. Linux tools are not very friendly... CMake try to find Framework, but often fail. I'm working on Hatari, for example, and spent a lot of time to make Frameworks pour all library used. It can be done also with Applewin, to have an XCode project. But I'm not good with cmake.... You can run a VM of Apple, I'm using a VM with Oracle VirtualBox. It's painfully slow on my PC wich only have 8Gb of RAM, but it work. I can provide you the VM. Thanks for support !

audetto commented 3 years ago

If you say MacOS is so easy to use, why don't you extend this https://github.com/audetto/AppleWin/blob/master/.travis.yml to include the Mac OS CI environment.

They claim to support it

https://docs.travis-ci.com/user/reference/osx/

It would be much easier going forward having a way to test the code.

audetto commented 3 years ago

Except that my travis credit has run out. But if you open a travis account they give you more.

jvernet commented 3 years ago

I never took time to look at Travis CI. May try to find how it work.

jvernet commented 3 years ago

I finally found a libGLESV2 library on my mac. I don not know if it's complete ? But sa2 build and show me this: `jeromevernet@macbook ~/D/d/G/t/A/build ((51b66041…)) [2]> ./sa2

SDL: 4 drivers 0: metal 1: opengl 2: opengles2 3: software Active driver (-1): metal SDL_RENDERER_SOFTWARE: 0 SDL_RENDERER_ACCELERATED: 1 SDL_RENDERER_PRESENTVSYNC: 1 SDL_RENDERER_TARGETTEXTURE: 1 Supported pixel formats: SDL_PIXELFORMAT_ARGB8888 SDL_PIXELFORMAT_ABGR8888 SDL_PIXELFORMAT_YV12 SDL_PIXELFORMAT_IYUV SDL_PIXELFORMAT_NV12 SDL_PIXELFORMAT_NV21 Selected format: SDL_PIXELFORMAT_ARGB8888 [DSInit] PC=00000000, WC=00000000, Diff=00000000 SDL_GL_SetSwapInterval: No OpenGL context has been made current`

audetto commented 3 years ago

Your system supports GLES2, good.

Try it: --sdl-driver 2 or if you still get the SDL_GL_SetSwapInterval error, disable it: --gl-swap 0, but your refresh rate will be random.

Anyway, this is not what you want.

What you really want is sa2 --imgui (got to make this the default). If this works, use it and enjoy it.

jvernet commented 3 years ago

./sa2 --imgui=>Could not load EGL library sa2 --sdl-driver 2 say Metal and OpenGL not supported on same window sa2 --sdl-driver 1 start and show a big resizabe windows (what to do then ?)

0 and 3 do not start (SDL_GL_SetSwapInterval: No OpenGL context has been made current

audetto commented 3 years ago

So,

About imgui you will have to poke around the initialisation and see if some changes fix it. You tried https://github.com/ocornut/imgui/blob/master/examples/example_sdl_opengl3/main.cpp#L37 but what my code does is https://github.com/ocornut/imgui/blob/master/examples/example_sdl_opengl3/main.cpp#L30

So define IMGUI_IMPL_OPENGL_ES2 and try the example and see if it works or you get the same problem. Otherwise I will have to run ImGui with OpenGL 3.2 (so NOT GLES).

sa2 --sdl-driver 2 say Metal and OpenGL not supported on same window

can you figure out which line causes it. probably the same as the next error.

0 and 3 do not start (SDL_GL_SetSwapInterval: No OpenGL context has been made current

have you disabled it --gl-swap 0?

Just comment out SDL_GL_SetSwapInterval completely and try again.

audetto commented 3 years ago

--sdl-driver 1 start and show a big resizabe windows (what to do then ?)

this should be the emulator. give it a disk (sa2 --help) and see if it runs it.

if you do sa2 --qt-ini it will reuse the same settings as your last qapple run.

jvernet commented 3 years ago

./sa2 --sdl-driver x --gl-swap 0 work with x=0,1 or 3

So I tried to replace in SDLImGuiFrame and it crash IMGUI_VERSION: 1.84 WIP GL_VENDOR: fish: Job 1, './sa2 --imgui' terminated by signal SIGSEGV (Erreur de frontière d'adresse)

#if defined(__APPLE__)
      // GL 3.2 Core + GLSL 150
      const char* glsl_version = "#version 150";

      SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); // Always required on Mac
      SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
#elif
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, SDL_CONTEXT_MAJOR); // from local gles.h
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
#endif
audetto commented 3 years ago

Yes, more or less it is correct. Attach gdb and figure out when it crashes.

If you managed to run the example, you are not far from running it properly.

jvernet commented 3 years ago

Crash happen in

std::cerr << "GL_VENDOR: " << glGetString(GL_VENDOR) << std::endl; std::cerr << "GL_RENDERER: " << glGetString(GL_RENDERER) << std::endl; std::cerr << "GL_VERSION: " << glGetString(GL_VERSION) << std::endl; std::cerr << "GL_SHADING_LANGUAGE_VERSION: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl; .... So removed, it start, but Video refresh rate: 60 Hz, 16.67 ms ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile vertex shader! With GLSL: #version 100

jvernet commented 3 years ago

I think I'm not using the correct GLES library. IMGUI example do not use it at all ?

audetto commented 3 years ago

That is what I am trying to tell you. I've changed the code to work with OpenGL as well (branch static)

On Darwin it goes to OpenGL directly.

Here

https://github.com/audetto/AppleWin/blob/static/source/frontends/sdl/imgui/glselector.h#L46

see if you need further adjustments.

BTW, colors are wrong, got to figure out how to flip them in OpenGL.

audetto commented 3 years ago

Fixed that too. Try now.

jvernet commented 3 years ago

In fact, there is NO opengles port to MacOsX. I tried to use an old lib that came with a product, tweaking it. Not Working....

audetto commented 3 years ago

The latest code does not use GLES for Mac, and should not try to link it either. If it does, then I made a mistake on the cmake configuration.

Now, the example and my code are the same on a Mac, and (pending errors) should just work. If you see a black screen, try to click on the menu and see if that works.

audetto commented 3 years ago

I have updated master with all the issues you have reported.

It should now just work, but only you can check. If I have missed something, please comment below.