Jump to content



Photo

Compiling VPinMame


  • Please log in to reply
12 replies to this topic

#1 MrGrynch

MrGrynch

    Enthusiast

  • Members
  • PipPipPip
  • 127 posts

  • Flag: United States of America

  • Favorite Pinball: Blood Machines, Fish Tales, Attack from Mars

Posted 02 May 2023 - 01:26 AM

Hi,

 

I am trying to compile the VPinMAME source.  I am using Visual Studio 2017 Community Edition.  I am seeing several problems like the following:

1>------ Build started: Project: PinMAME, Configuration: Debug Win32 ------
2>------ Build started: Project: PinMAME32, Configuration: Debug Win32 ------
3>------ Build started: Project: InstallVPinMAME, Configuration: Debug Win32 ------
4>------ Build started: Project: Visual PinMame, Configuration: Debug Win32 ------
1>Assembling asmblit.asm...
1>'nasm' is not recognized as an internal or external command,
1>operable program or batch file.

I have nasm installed and set up as a build customization.  I have verified that the path is correct in the Build Customization Search Paths:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations"

I have verified that the nasm.exe file is located here as well.

 

In my project files, I have set the Build Customization to nasm(.targets .props)

 

What else I am missing?  I appreciate any help!

 

 -G

 



#2 MrGrynch

MrGrynch

    Enthusiast

  • Members
  • PipPipPip
  • 127 posts

  • Flag: United States of America

  • Favorite Pinball: Blood Machines, Fish Tales, Attack from Mars

Posted 02 May 2023 - 11:49 AM

Progress!!

 

I added the path to the build customizations to the system environment variables, and that solved the nasm problem.  I had the path in the user variable, but the compilation must run on as different user.  The only project failing now is the VPinMAME project:

Severity	Code	Description	Project	File	Line	Suppression State
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	
Warning	C4005	'inline': macro redefinition	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	207	
Error	C1189	#error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.	Visual PinMame	c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\xkeycheck.h	260	

These errors are coming from a VC++ include file, so I it might be a project configuration issue.  Any help would be appreciated!

 -G


Edited by MrGrynch, 02 May 2023 - 11:57 AM.


#3 sdivodul

sdivodul

    Hobbyist

  • Members
  • PipPip
  • 39 posts
  • Location:NY

  • Flag: United States of America

  • Favorite Pinball: Indiana Jones PB Adventure

Posted 02 May 2023 - 02:03 PM

Look at the workflow used to build vpm on github. You may need to add compile or link time switches.

 

https://github.com/v...ws/vpinmame.yml



#4 MrGrynch

MrGrynch

    Enthusiast

  • Members
  • PipPipPip
  • 127 posts

  • Flag: United States of America

  • Favorite Pinball: Blood Machines, Fish Tales, Attack from Mars

Posted 02 May 2023 - 03:04 PM

Look at the workflow used to build vpm on github. You may need to add compile or link time switches.

 

https://github.com/v...ws/vpinmame.yml

 

Great suggestion!  I noticed the automated build is using CMake.  I'm very familiar with it and am sure I can figure it out from there.

 

I'm somewhat surprised that the generated project files would behave differently than the solution files in the source tree.  Not sure why the project settings wouldn't be carried over.  How do devs work on the code?  It must be locally compilable.  Since the automated builds are generating the project files on the fly, it almost doesn't make sense to have the solution files in source control, unless they are checked in every time the build runs?  I can understand the missing nasm, since the build machines already have this set up.

 

Thank you!

 -G



#5 MrGrynch

MrGrynch

    Enthusiast

  • Members
  • PipPipPip
  • 127 posts

  • Flag: United States of America

  • Favorite Pinball: Blood Machines, Fish Tales, Attack from Mars

Posted 02 May 2023 - 05:28 PM

Progress!

 

Using cmake to generate the project files has helped!  I also had to install the v141_xp toolset.  This left the following errors:

Severity	Code	Description	Project	File	Line	Suppression State
Warning	MSB8051	Support for targeting Windows XP is deprecated and will not be present in future releases of Visual Studio. Please see https://go.microsoft.com/fwlink/?linkid=2023588 for more information.	ZERO_CHECK	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141_xp\Toolset.targets	39	
Warning	MSB8051	Support for targeting Windows XP is deprecated and will not be present in future releases of Visual Studio. Please see https://go.microsoft.com/fwlink/?linkid=2023588 for more information.	pinmame	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141_xp\Toolset.targets	39	
Warning	C4333	'>>': right shift by too large amount, data loss	pinmame	C:\_dev\pinmame-master\ext\vgm\vgmwrite.c	241	
Error	LNK2026	module unsafe for SAFESEH image.	pinmame	C:\_dev\pinmame-master\build\pinmamee\asmblit.obj	1	
Error	LNK2026	module unsafe for SAFESEH image.	pinmame	C:\_dev\pinmame-master\build\pinmamee\ddraw.lib(DDRAW.dll)	1	
Error	LNK2026	module unsafe for SAFESEH image.	pinmame	C:\_dev\pinmame-master\build\pinmamee\ddraw.lib(DDRAW.dll)	1	
Error	LNK2026	module unsafe for SAFESEH image.	pinmame	C:\_dev\pinmame-master\build\pinmamee\dsound.lib(DSOUND.dll)	1	
Error	LNK2026	module unsafe for SAFESEH image.	pinmame	C:\_dev\pinmame-master\build\pinmamee\dsound.lib(DSOUND.dll)	1	
Error	LNK2026	module unsafe for SAFESEH image.	pinmame	C:\_dev\pinmame-master\build\pinmamee\dinput.lib(DINPUT.dll)	1	
Error	LNK2026	module unsafe for SAFESEH image.	pinmame	C:\_dev\pinmame-master\build\pinmamee\dinput.lib(dilib1.obj)	1	
Error	LNK2026	module unsafe for SAFESEH image.	pinmame	C:\_dev\pinmame-master\build\pinmamee\dinput.lib(dilib2.obj)	1	
Error	LNK2026	module unsafe for SAFESEH image.	pinmame	C:\_dev\pinmame-master\build\pinmamee\dinput.lib(dilib3.obj)	1	
Error	LNK1281	Unable to generate SAFESEH image.	pinmame	C:\_dev\pinmame-master\build\pinmamee\Debug\PinMAME.exe	1	

I added "No (/SAFESEH:NO)" to the linker properties and that has resolved the problem.  I don't exactly know why that was needed, but I'll take what I can get

 

-G



#6 MrGrynch

MrGrynch

    Enthusiast

  • Members
  • PipPipPip
  • 127 posts

  • Flag: United States of America

  • Favorite Pinball: Blood Machines, Fish Tales, Attack from Mars

Posted 03 May 2023 - 04:00 AM

I've got everything except pinmame compiling.  The build is failing with a bunch of errors like:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2001	unresolved external symbol _logerror	pinmame	C:\_dev\pinmame-master\build\vgmwrite.obj	1	
Error	LNK2001	unresolved external symbol _logerror	pinmame	C:\_dev\pinmame-master\build\fileio.c.obj	1	
Error	LNK2001	unresolved external symbol _logerror	pinmame	C:\_dev\pinmame-master\build\wmssnd.obj	1	
Error	LNK2001	unresolved external symbol _logerror	pinmame	C:\_dev\pinmame-master\build\zacproto.obj	1	
Error	LNK2001	unresolved external symbol _logerror	pinmame	C:\_dev\pinmame-master\build\zacsnd.obj	1	
Error	LNK2001	unresolved external symbol _logerror	pinmame	C:\_dev\pinmame-master\build\ticker.obj	1	
Error	LNK2001	unresolved external symbol _logerror	pinmame	C:\_dev\pinmame-master\build\taito.obj	1	
Error	LNK2001	unresolved external symbol _logerror	pinmame	C:\_dev\pinmame-master\build\taitos.obj	1	

Any ideas?



#7 MrGrynch

MrGrynch

    Enthusiast

  • Members
  • PipPipPip
  • 127 posts

  • Flag: United States of America

  • Favorite Pinball: Blood Machines, Fish Tales, Attack from Mars

Posted 03 May 2023 - 12:29 PM

UPDATE:  The problem mentioned above only happens in DEBUG build.



#8 sdivodul

sdivodul

    Hobbyist

  • Members
  • PipPip
  • 39 posts
  • Location:NY

  • Flag: United States of America

  • Favorite Pinball: Indiana Jones PB Adventure

Posted 03 May 2023 - 01:46 PM

Since the automated builds are generating the project files on the fly...

The projects within the solutions don't change, but the way they are built is controlled by the workflow. Workflow settings override project settings.

 

Don't know why the linker can't find the logerror function. You could see how it is called, and add your own logerror function.



#9 MrGrynch

MrGrynch

    Enthusiast

  • Members
  • PipPipPip
  • 127 posts

  • Flag: United States of America

  • Favorite Pinball: Blood Machines, Fish Tales, Attack from Mars

Posted 03 May 2023 - 02:21 PM

 

Since the automated builds are generating the project files on the fly...

The projects within the solutions don't change, but the way they are built is controlled by the workflow. Workflow settings override project settings.

 

Don't know why the linker can't find the logerror function. You could see how it is called, and add your own logerror function.

 

 

In the places I've looked, it is defined as an analog of LOG(X).  In some cases, it's only defined if VERBOSE is enabled.  In others, only if the build type is DEBUG.  It's going to be equally as tricky to write a replacement as to fix what's wrong with the build.

 

I need the debug build to work so I can start working on fixes/cleanup of the altsound code, and hopefully contribute more in the future.  I'll figure it out eventually.  I can't be the only one trying to run DEBUG builds of these apps and libraries, though.  Was hoping someone would say "hey you dumbass, you have to do <this>"

 

It's possible too, that I don't have the DEBUG libs of some external dependency, and this error is occurring due to trying to link to a release library with a different interface.

 

By the way, in my previous work, we didn't version control the project files at all.  The build script generated them on the fly, so there was no need to update the project files, and avoids all the associated headaches.


Edited by MrGrynch, 03 May 2023 - 02:23 PM.


#10 MrGrynch

MrGrynch

    Enthusiast

  • Members
  • PipPipPip
  • 127 posts

  • Flag: United States of America

  • Favorite Pinball: Blood Machines, Fish Tales, Attack from Mars

Posted 03 May 2023 - 05:11 PM

I added "No (/SAFESEH:NO)" to the linker properties and that has resolved the problem.  I don't exactly know why that was needed, but I'll take what I can get

 

-G

 

Following up on this, the reason I needed to add it was because the projects that need it only apply it if the configuration is RELEASE.  If building in DEBUG, it's not applied, which is why the errors appeared in my build.  By the way, isn't this a Windows thing?  Shouldn't this be bracketed by compiler as well?



#11 MrGrynch

MrGrynch

    Enthusiast

  • Members
  • PipPipPip
  • 127 posts

  • Flag: United States of America

  • Favorite Pinball: Blood Machines, Fish Tales, Attack from Mars

Posted 03 May 2023 - 08:34 PM

UPDATE:  I think I might have figured it out..

 

The project that builds libpinmame from the workflows uses cmake scripts that only include the files needed to compile it for RELEASE mode.  In DEBUG mode, it needs more files to compile, one of which is in the "Windows" source folder.  If you open one of the solution files which are part of the source tree, you can see the Windows sources included in the build for the PinMAME project.  The file in question is "config.c" which includes the definition of the logerror function.  It's declared as an external function which is why compilation succeeds, but linking fails.



#12 sdivodul

sdivodul

    Hobbyist

  • Members
  • PipPip
  • 39 posts
  • Location:NY

  • Flag: United States of America

  • Favorite Pinball: Indiana Jones PB Adventure

Posted 04 May 2023 - 01:57 PM

/SAFESEH:NO

 

Yeah, that is specific to Windows linker, don't know much about it though.

 

Google this:

SAFESEH site:microsoft.com



#13 MrGrynch

MrGrynch

    Enthusiast

  • Members
  • PipPipPip
  • 127 posts

  • Flag: United States of America

  • Favorite Pinball: Blood Machines, Fish Tales, Attack from Mars

Posted 07 May 2023 - 01:03 AM

UPDATE:  I created a fork of the PinMame repository and modified the cmake scripts to set /SAFESEH:NO on all Windows builds.  It is currently only applied to RELEASE builds which is why I was having an issue.  I also fixed a linking issue with libpinmame for DEBUG builds.  The problem was that the DEBUG build has "logerror" commands but there is no definition for it, since it normally gets it as part of another build.

 

I have a pull request up to formalize these changes in the main repo.