Page 1 of 1

Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 2:09 am
by Alegend45
I have a standard MinGW installation, with the recommended OpenAL devpak installed manually.

However, once PCem is compiled, whenever I try to run it, it gives me this error: "The procedure entry point GUID_SysMouse could not be located in the dynamic link library PCem.exe"

First, why the fuck does Windows think GUID_SysMouse is a function?
Secondly, why the fuck does Windows think PCem.exe is a DLL?

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 3:02 am
by roytam1
I don't know yours but my hg-head dynrec build works.
Image

https://mega.co.nz/#!mM8DUJSC!Yc8RDXpBc ... a2-Spz1sIY

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 3:02 am
by truth
BUILD GUIDE:
Download latest pcem: http://www.retrosoftware.co.uk/hg/pcem
Install mingw32/gcc4.6.2 along with dx8.0 headers/libs for mingw (copy dx8 headers to /usr/include/directx/ and libs to /usr/lib/)
openal: openal-soft-1.15.1 built by cmake-gui and mingw32-make install (optionally "add SSE" to CFLAG during cmake configuration)
freealut: also built by cmake-gui and mingw32-make install
copy openal and freealut headers to /usr/include/ and libraries to /mingw/lib/

add line to pcem makefile.mingw:
CFLAGS+=-I/usr/include -I/usr/include/directx

change directory to /PCem/src/ and build binary:
make -f Makefile.mingw

The following files necessary to run PCem (two DLL files generated by above cmake procedure):
openal32.dll, libalut.dll, pcem.exe, and two binary files from mingw, libgcc_s_dw2-1.dll and libstdc++-6.dll.

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 3:21 am
by therock247uk
any reason ppl are still using gcc4.6.2? mingw comes with gcc version 4.8.1 (GCC) by default so not sure where people are getting 4.6.2 from.

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 3:45 am
by Alegend45
truth, I know HOW to build it. I can do it on Linux, AND on a certain Windows XP system! This system just doesn't want to fucking run this shit.

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 3:52 am
by truth
That error is related to directinput. The function exists in win-mouse.cc, and it's related to directx (dinput).

Alternatively, post the exact steps in building pcem, including versions of all libraries.

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 3:56 am
by Alegend45
First off, I have the DirectX headers and libraries from the MinGW installer.

Anyway...

OpenAL - version Tom recommended,
ALUT - Same thing.

And all I did was make -f Makefile.mingw -j4

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 3:59 am
by truth
Verify if the directx version is unavailable in your mingw system. If not, is it directx8? Also, was the XP build copied to the 8.1 system, or did it compile successfully on 8.1? If it doesn't build on 8.1, is there an error?

Directinput errors have been addressed by the following hints:
linking to dinput8 library and definition lines in the source code
#define INITGUID
#define DIRECTINPUT_VERSION 0x0800

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 4:35 am
by Alegend45
It compiled successfully on 8.1, and I'm using DirectX 9, not 8.

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 4:37 am
by truth
Is your 8.1 system a desktop or a tablet? Did you test with the pcem binary which roytam1 posted above? If so, did it work? If not, could you post your pcem binary so others can replicate the error on a 8.1 desktop?

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 5:44 am
by Alegend45
Mine's a desktop. roytam1's binary did work though. Here's mine.

https://mega.co.nz/#!Ihd1DQxR!h3PCpOoE5 ... -PSbsu3au0

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Tue 18 Nov, 2014 6:17 am
by truth
That pcem binary fails on XP with similar error, but in the library "OpenAL32.dll". I also verified that your GUID_sysmouse functions are embedded differently from my working pcem binary (see image below). Your pcem binary is different from the build by roytam1 and myself; your pcem is incorrectly importing functions, including GUID_sysmouse, from a (openal32.dll, in my case) module.

If you follow my above instructions, then I can ensure that you build the same working pcem binary as I have. The DX8 headers/libs for mingw: http://alleg.sourceforge.net/wip.html. Perhaps start with a new mingw installation so the incorrect headers and libraries are not seen by the compiler/linker. Also, build openal32 so the error in the image is not present (red solid boxes).

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Thu 29 Jan, 2015 10:55 pm
by Alegend45
Okay, this problem is back again. I get everything fine except the linking. Now it keeping saying

undefined reference to `__imp_alutExit'
undefined reference to `__imp_alutInit'

Even though I'm linking both OpenAL and ALut! SO WHAT GIVES?!

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Fri 30 Jan, 2015 8:33 am
by SarahWalker
Which order are you linking ALut and OpenAL in? On GCC ALut has to be before OpenAL on the command line.

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Fri 30 Jan, 2015 3:35 pm
by Alegend45
TomWalker wrote:Which order are you linking ALut and OpenAL in? On GCC ALut has to be before OpenAL on the command line.
I've tried the standard ALut before AL, I've tried AL before ALut, I'VE TRIED STATICALLY COMPILING IN THE FREEALUT LIBRARY and it hasn't done jack shit. Same errors every time. I'm using the latest TDM-GCC-64.

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Fri 30 Jan, 2015 6:08 pm
by SarahWalker
64-bit GCC? You're on your own. Not sure I ever got that working right.

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Fri 30 Jan, 2015 6:15 pm
by Alegend45
After resorting to commenting out the USE_OPENAL define in soundopenal.c, it compiles and runs perfectly, albeit, without sound. You should probably use something other than OpenAL, as it's quite outdated and old. Also, I've gotten 64-bit GCC working before. Besides, this is necessary as I have a fully 64-bit system.

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Fri 30 Jan, 2015 6:35 pm
by SarahWalker
Umm, pretty sure you can use 32-bit compiler and applications on 64-bit Windows...

Besides, if you're running only 64-bit stuff then you can't use the recompiler, as that's currently 32-bit only.

Re: Unable to build a working PCem executable on Windows 8.1

Posted: Fri 30 Jan, 2015 7:00 pm
by Alegend45
Eh, true.

EDIT: Actually, after compiling PCem as a 64-bit dynarec executable, the recompiler works just fine. I'm working on adding stack ops.