MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Pages: 1

rubinstu
MAME Fan
Reged: 02/05/10
Posts: 20
Send PM


Visual Studio lots of little errors
#394447 - 07/21/22 02:21 PM


Hello, I would like to compile using Visual Studio for a variety of practical reasons (particularly the debugger). I have tried both MSVS 2022 and 2019. Each time, I get all kinds of errors:

  • Error C1189 #error: "This version of XAudio2 is available only in Windows 8 or later..."
  • 'DeviceClass *":invalid target type for dynamic_cast
  • 'signbit': ambiguous call to overloaded function
  • Various warnings treated as errors (I have manually disabled this function, but still have problems)
  • If I really mess with things to get it to compile, I have all sorts of linker errors
  • and more...


Compiling with MSYS2 seems OK.

I have fresh installs of MSVS.

I have tried the "master" and recent releases of the sources.

Are there any tricks I'm missing?

Has anyone built MAME from scratch with MSVS recently?

Is Visual Studio really supported?

I have some ideas for the code and would like to contribute back. Any help is appreciated!

Thank you!



mhoes
MAME Fan
Reged: 08/27/15
Posts: 168
Send PM


Re: Visual Studio lots of little errors new [Re: rubinstu]
#394448 - 07/21/22 02:53 PM


> Hello, I would like to compile using Visual Studio for a variety of practical reasons
> (particularly the debugger). I have tried both MSVS 2022 and 2019. Each time, I get
> all kinds of errors:
>
>
> Error C1189 #error: "This version of XAudio2 is available only in Windows 8 or
> later..."
> 'DeviceClass *":invalid target type for dynamic_cast
> 'signbit': ambiguous call to overloaded function
> Various warnings treated as errors (I have manually disabled this function, but still
> have problems)
> If I really mess with things to get it to compile, I have all sorts of linker errors
> and more...
>
>
> Compiling with MSYS2 seems OK.
>
> I have fresh installs of MSVS.
>
> I have tried the "master" and recent releases of the sources.
>
> Are there any tricks I'm missing?
>
> Has anyone built MAME from scratch with MSVS recently?
>
> Is Visual Studio really supported?
>
> I have some ideas for the code and would like to contribute back. Any help is
> appreciated!
>
> Thank you!


Not sure if it matters, but (you didn't specify) : what version of Windows are you using ?



rubinstu
MAME Fan
Reged: 02/05/10
Posts: 20
Send PM


Re: Visual Studio lots of little errors new [Re: mhoes]
#394450 - 07/21/22 02:59 PM


Good question. I should have specified. I am using Windows 11. (And like you implied, hopefully, that does not matter!)



MooglyGuy
Renegade MAME Dev
Reged: 09/01/05
Posts: 2258
Send PM


Re: Visual Studio lots of little errors new [Re: rubinstu]
#394462 - 07/22/22 09:19 AM


It helps to read the documentation: https://docs.mamedev.org/initialsetup/compilingmame.html#issues-affecting-microsoft-visual-studio



Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4462
Loc: Melbourne, Australia
Send PM


Re: Visual Studio lots of little errors new [Re: rubinstu]
#394465 - 07/22/22 10:32 AM


https://docs.mamedev.org/initialsetup/compilingmame.html#issues-affecting-microsoft-visual-studio



rubinstu
MAME Fan
Reged: 02/05/10
Posts: 20
Send PM


Re: Visual Studio lots of little errors new [Re: Vas Crabb]
#394472 - 07/23/22 04:36 AM


Not sure how I missed those. Thanks for the links for the MSVS problems!



rubinstu
MAME Fan
Reged: 02/05/10
Posts: 20
Send PM


Re: Visual Studio lots of little errors new [Re: rubinstu]
#394491 - 07/24/22 07:00 PM


So, I went back and added the defines, etc. as per the notes. I still have a few errors, one of which I worked around, but the other I can't figure out. Here's the output from MSVS:

Code:

12>cpu16.cpp
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(644,1): error C2680: 'DeviceClass *': invalid target type for dynamic_cast
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(644,1): error C2680: with
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(644,1): error C2680: [
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(644,1): error C2680: DeviceClass=mc68hc16z1_device
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(644,1): error C2680: ]
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(644,1): error C2680: this->m_target = dynamic_cast(device);
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(644,1): error C2680: ^
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(644,1): message : 'mc68hc16z1_device': class must be defined before using in a dynamic_cast
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(644,1): message : this->m_target = dynamic_cast(device);
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(644,1): message : ^
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(636): message : while compiling class template member function 'bool device_finder::findit(validity_checker *)'
12>C:\Users\stuar\Documents\mame\src\emu\devfind.h(636): message : {
12>C:\Users\stuar\Documents\mame\src\devices\cpu\m68hc16\cpu16.h(125): message : see reference to class template instantiation 'device_finder' being compiled
12>C:\Users\stuar\Documents\mame\src\devices\cpu\m68hc16\cpu16.h(125): message : DECLARE_DEVICE_TYPE(MC68HC16Z1, mc68hc16z1_device)
331>Generating Code...


I would really appreciate it if anyone else sees this and what they do about it. Thank you!



MooglyGuy
Renegade MAME Dev
Reged: 09/01/05
Posts: 2258
Send PM


Re: Visual Studio lots of little errors new [Re: rubinstu]
#394493 - 07/24/22 07:49 PM


You aren't giving enough information. "MSVS 2022" (I've only ever heard it acronymed as MSVC, but whatev) encompasses a whole ton of versions, same as with MSVC 2019 and earlier iterations.

You haven't said what exact version you're using, and you also haven't said what packages you've installed.

For example, I'm on MSVC 2022, version 17.2.6, and the relevant installed packages are:
- All of the x64/x86 variants of "MSVC v143 - VS 2022 C++ build tools"
- Windows Universal CRT SDK
- C++ Build Tools core features
- C++ core features
- C++ ATL for latest v143 build tools (x86 & x64)
- C++ ATL for latest v143 build tools with Spectre Mitigations (x86 & x64)
- C++ MFC for latest v143 build tools (x86 & x64)
- C++ MFC for latest v143 build tools with Spectre Mitigations (x86 & x64)
- Windows 10 SDK (10.0.19041.0)
- Windows Universal C Runtime

I don't encounter the compile errors you're talking about. At this point, I would suggest simply using a text editor and using the command-line Msys2 build tools. They're the most common and well-tested build configuration, and if you're deviating from that, you're expected to be capable of doing some level of self-diagnosis.



rubinstu
MAME Fan
Reged: 02/05/10
Posts: 20
Send PM


Re: Visual Studio lots of little errors new [Re: MooglyGuy]
#394495 - 07/25/22 04:39 AM



Quote:


"MSVS 2022" (I've only ever heard it acronymed as MSVC, but whatev)



"MSVS" is the acronym Microsoft uses for Visual Studio.

I have tried two versions of MSVS, with these specifics, respectively (with only relevant info shown):


Code:

Microsoft Visual Studio Community 2022
Version 17.1.6
VisualStudio.17.Release/17.1.6+32421.90
Microsoft .NET Framework
Version 4.8.04161

Installed Version: Community

Visual C++ 2022 00482-90000-00000-AA550
Microsoft Visual C++ 2022

Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

Qt Visual Studio Tools 2.9.1.6
The Qt Visual Studio Tools allow developers to use the standard development environment without having to worry about any Qt-related build steps or tools.

Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0
Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools 17.0.1229.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.1.0-5.22165.10+e555772db77ca828b02b4bd547c318387f11d01f
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake 1.0
Visual Studio Tools for CMake



and


Code:

Microsoft Visual Studio Community 2019
Version 16.11.17
VisualStudio.16.Release/16.11.17+32630.194
Microsoft .NET Framework
Version 4.8.04161

Installed Version: Community

Visual C++ 2019 00435-00000-00000-AA752
Microsoft Visual C++ 2019

Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake 1.0
Visual Studio Tools for CMake



Just for fun, I will update to the next version of 2022 which matches what you have.

Thank you



MooglyGuy
Renegade MAME Dev
Reged: 09/01/05
Posts: 2258
Send PM


Re: Visual Studio lots of little errors new [Re: rubinstu]
#394613 - 08/06/22 02:00 PM


> Just for fun, I will update to the next version of 2022 which matches what you have.

Make sure you match packages, as well. If those two text snippets are all of the packages that you have installed, it seems like you have a bunch of necessary things missing.


Pages: 1

MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 36 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 442