JibbSmart / JoyShockMapper

A tool for PC gamers to play games with DualShock 4, DualSense, JoyCon, and Switch Pro Controllers. Gyro aiming, flick stick.
Other
786 stars 67 forks source link

Compiling fails #52

Open SharlSherif opened 4 years ago

SharlSherif commented 4 years ago

I'm on Windows 10 using MinGW. I ran main.cpp with the command g++ main.cpp and I got this massive log:

[TrayIcon.cpp 2020-07-07 09:32:01.967]
,,TrayIcon.cpp:172:2: warning: "/*" within comment [-Wcomment]
  172 | }/**/
      |   
TrayIcon.cpp: In constructor 'TrayIcon::TrayIcon(HINSTANCE, HINSTANCE, LPTSTR, int, std::function<void()>)':
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::hWnd' [-Wmissing-field-initializers]
   86 |  , _beforeShow(beforeShow)
      |                          ^
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::uID' [-Wmissing-field-initializers]
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::uFlags' [-Wmissing-field-initializers]
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::uCallbackMessage' [-Wmissing-field-initializers]
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::hIcon' [-Wmissing-field-initializers]
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::szTip' [-Wmissing-field-initializers]
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::dwState' [-Wmissing-field-initializers]
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::dwStateMask' [-Wmissing-field-initializers]
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::szInfo' [-Wmissing-field-initializers]
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::<anonymous>' [-Wmissing-field-initializers]
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::szInfoTitle' [-Wmissing-field-initializers]
TrayIcon.cpp:86:26: warning: missing initializer for member '_NOTIFYICONDATAA::dwInfoFlags' [-Wmissing-field-initializers]
TrayIcon.cpp:81:51: warning: unused parameter 'hPrevInstance' [-Wunused-parameter]
   81 | TrayIcon::TrayIcon(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow, std::function<void()> beforeShow)
      |                                         ~~~~~~~~~~^~~~~~~~~~~~~
TrayIcon.cpp:81:73: warning: unused parameter 'lpCmdLine' [-Wunused-parameter]
   81 | TrayIcon::TrayIcon(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow, std::function<void()> beforeShow)
      |                                                                  ~~~~~~~^~~~~~~~~
TrayIcon.cpp:81:88: warning: unused parameter 'nCmdShow' [-Wunused-parameter]
   81 | TrayIcon::TrayIcon(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow, std::function<void()> beforeShow)
      |                                                                                    ~~~~^~~~~~~~
TrayIcon.cpp: In member function 'BOOL TrayIcon::InitInstance()':
TrayIcon.cpp:220:7: warning: unused variable 'err' [-Wunused-variable]
  220 |  auto err = GetLastError();
      |       ^~~
TrayIcon.cpp: In member function 'void TrayIcon::ShowContextMenu(HWND)':
TrayIcon.cpp:282:87: error: cannot convert 'const wchar_t*' to 'LPCSTR' {aka 'const char*'}
  282 |     InsertMenu(hMenu, -1, MF_BYPOSITION | MF_STRING, SWM_CUSTOM + id, btn->label.c_str());
      |                                                                       ~~~~~~~~~~~~~~~~^~
      |                                                                                       |
      |                                                                                       const wchar_t*
In file included from c:\mingw\include\windows.h:48,
                 from c:\mingw\include\trayicon.h:2,
                 from TrayIcon.cpp:7:
c:\mingw\include\winuser.h:3940:62: note:   initializing argument 5 of 'BOOL InsertMenuA(HMENU, UINT, UINT, UINT, LPCSTR)'
 3940 | WINUSERAPI BOOL WINAPI InsertMenuA (HMENU, UINT, UINT, UINT, LPCSTR);
      |                                                              ^~~~~~
TrayIcon.cpp:289:125: error: cannot convert 'const wchar_t*' to 'LPCSTR' {aka 'const char*'}
  289 |     InsertMenu(hMenu, -1, MF_BYPOSITION | MF_STRING | (state ? MF_CHECKED : MF_UNCHECKED), SWM_CUSTOM + id, tgl->label.c_str());
      |                                                                                                             ~~~~~~~~~~~~~~~~^~
      |                                                                                                                             |
      |                                                                                                                             const wchar_t*
In file included from c:\mingw\include\windows.h:48,
                 from c:\mingw\include\trayicon.h:2,
                 from TrayIcon.cpp:7:
c:\mingw\include\winuser.h:3940:62: note:   initializing argument 5 of 'BOOL InsertMenuA(HMENU, UINT, UINT, UINT, LPCSTR)'
 3940 | WINUSERAPI BOOL WINAPI InsertMenuA (HMENU, UINT, UINT, UINT, LPCSTR);
      |                                                              ^~~~~~
TrayIcon.cpp:298:93: error: cannot convert 'const wchar_t*' to 'LPCSTR' {aka 'const char*'}
  298 |      InsertMenu(submenu, -1, MF_BYPOSITION | MF_STRING, SWM_CUSTOM + id, button->label.c_str());
      |                                                                          ~~~~~~~~~~~~~~~~~~~^~
      |                                                                                             |
      |                                                                                             const wchar_t*
In file included from c:\mingw\include\windows.h:48,
                 from c:\mingw\include\trayicon.h:2,
                 from TrayIcon.cpp:7:
c:\mingw\include\winuser.h:3940:62: note:   initializing argument 5 of 'BOOL InsertMenuA(HMENU, UINT, UINT, UINT, LPCSTR)'
 3940 | WINUSERAPI BOOL WINAPI InsertMenuA (HMENU, UINT, UINT, UINT, LPCSTR);
      |                                                              ^~~~~~
TrayIcon.cpp:302:119: error: cannot convert 'const wchar_t*' to 'LPCSTR' {aka 'const char*'}
  302 |     InsertMenu(hMenu, -1, MF_BYPOSITION | MF_STRING | MF_POPUP, reinterpret_cast<UINT_PTR>(submenu), menu->label.c_str());
      |                                                                                                      ~~~~~~~~~~~~~~~~~^~
      |                                                                                                                       |
      |                                                                                                                       const wchar_t*
In file included from c:\mingw\include\windows.h:48,
                 from c:\mingw\include\trayicon.h:2,
                 from TrayIcon.cpp:7:
c:\mingw\include\winuser.h:3940:62: note:   initializing argument 5 of 'BOOL InsertMenuA(HMENU, UINT, UINT, UINT, LPCSTR)'
 3940 | WINUSERAPI BOOL WINAPI InsertMenuA (HMENU, UINT, UINT, UINT, LPCSTR);
      |                                                              ^~~~~~
TrayIcon.cpp: In member function 'ULONGLONG TrayIcon::GetDllVersion(LPCTSTR)':
TrayIcon.cpp:328:85: warning: cast between incompatible function types from 'FARPROC' {aka 'int (__attribute__((stdcall)) *)()'} to 'DLLGETVERSIONPROC' {aka 'long int (__attribute__((stdcall)) *)(_DllVersionInfo*)'} [-Wcast-function-type]
  328 |         pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hinstDll, "DllGetVersion");
      |                                                                                     ^
TrayIcon.cpp: In static member function 'static INT_PTR TrayIcon::DlgProc(HWND, UINT, WPARAM, LPARAM)':
TrayIcon.cpp:383:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
  383 |    tray->ShowContextMenu(hWnd);
      |    ~~~~~~~~~~~~~~~~~~~~~^~~~~~
TrayIcon.cpp:384:3: note: here
  384 |   default:
      |   ^~~~~~~
TrayIcon.cpp: At global scope:
TrayIcon.cpp:67:13: warning: 'toastReady' defined but not used [-Wunused-variable]
   67 | static bool toastReady = false;
      |             ^~~~~~~~~~

is it because I'm not using Visual Studio's compiler?

JibbSmart commented 4 years ago

I guess so. One shouldn't have to use Visual Studio in theory, but that's just what I've been using. The project is undergoing some big changes at the moment, including making it friendlier to other compilers :)

SharlSherif commented 4 years ago

@JibbSmart I was trying to avoid downloading 10gb of bloated software just to compile it, haha. I will be trying that, if it worked then I'm going to post a new thread for building a UI.

JibbSmart commented 4 years ago

@SharlSherif I think it's worth exploring a standalone GUI application that just parses config files (the format is very simple) and saves config files. JSM being a command line program means another application should be able to send commands to it pretty easily (I think). A lot is changing structurally at the moment, but the features aren't changing yet, so a standalone GUI application should still work.

SharlSherif commented 4 years ago

@JibbSmart I thought the same thing but didn't think it would be doable to maintain in the long-term. if that's the only way now then I will give it a try.

JibbSmart commented 4 years ago

The latest version of JSM uses CMake if you want to give it a go