Author Topic: Building libpinproc with Visual Studio  (Read 2267 times)

lachied

  • P3 Developers
  • *
  • Posts: 296
    • View Profile
    • Pin build/blog
Building libpinproc with Visual Studio
« on: April 02, 2015, 12:06:07 AM »
So after spending much time trying to determine why my laptop wouldnt connect to the PROC I think I have to build libpinproc from source.

I previously had it working on my old laptop and I was using the same pinproc.dll on my new laptop but for some reason I was getting a dll not found error relating to pinproc.dll. The prebuilt dll I am using is the one included in Compys netprocgame:
https://github.com/Compy/NetProcGame/tree/master/NetProcGame
Yes it is 3 years old but not much should have changed anyway.
Running the code on my work PC was not generating the missing dll error which was strange (same codebase) and then using dependency walker I realised that my laptop didnt have the mingw compiler installed. This compiler installs 2 dlls that pinproc.dll relies on.

Having to install a compiler just to connect to the proc is a bit average. So I'm trying to build the libpinproc from source in an attempt to fold in some external dependencies and maybe even convert it to managed C++ for even easier integration with C# and .net.
I followed the instructions here:
http://pinballcontrollers.com/wiki/Windows_build_instructions_VS
I've been attempting to get it to work using VS2013 Community Edition (Free if others are interested) on a Windows 7 machine and Windows 8.1 machine. Both are 64bit. I had to download the VS2013 Build Tools.
I used the following commands to generate my solution files:
Code: [Select]
cmake -G "Visual Studio 12" -DBUILD_SHARED_LIBS:BOOL=OFF
cmake -G "Visual Studio 12" -DLIB_TYPE=SHARED -DEXTRA_INC=".\ftdi;.\yaml-cpp\include" -DEXTRA_LINK=".\ftdi\i386;.\yaml-cpp\Release;.\yaml-cpp\Debug"

Remember to open the Yaml solution and build it in debug then release if you are following along here.
I could then build the pinproc solution using VS2013. However this only produced a .lib file and not the .dll that I want. Changing the project properties to output a .dll caused it to have a dummy spit and as I tried to fix those errors I just created more until I eventually got it building a 7kb dll file which Im pretty sure wont work. - The original pinproc.dll is a 126kb file.

Anyone had any luck with this previously?
Gerry, care to elaborate on what you guys are doing with the P3? Do you have a prebuilt version of pinproc.dll you could share? I wouldn't of thought you would install mingw on all the p3 machines?
 

lachied

  • P3 Developers
  • *
  • Posts: 296
    • View Profile
    • Pin build/blog
Re: Building libpinproc with Visual Studio
« Reply #1 on: April 02, 2015, 03:39:05 AM »
I got around it by using the standard installer. After doing that no problems. Now I can move onto to handling switch events and pushing them up to the client.
Seems a little excessive though having to install everything that comes with the installer. Once I clean up my pinPC I might progressively uninstall things e.g. python and see what I end up with. Then just make that into a Windows 8.1 embedded image.

Gerry Stellenberg

  • Administrator
  • *****
  • Posts: 2399
    • View Profile
    • PinballControllers.com
Re: Building libpinproc with Visual Studio
« Reply #2 on: April 02, 2015, 02:17:39 PM »
Gerry, care to elaborate on what you guys are doing with the P3? Do you have a prebuilt version of pinproc.dll you could share? I wouldn't of thought you would install mingw on all the p3 machines?

Glad you figured out a solution.  I agree, it's way too involved just to install the low level library.

The P3 is running linux; so we don't have to deal with building windows drivers.

- Gerry

lachied

  • P3 Developers
  • *
  • Posts: 296
    • View Profile
    • Pin build/blog
Re: Building libpinproc with Visual Studio
« Reply #3 on: April 02, 2015, 10:34:38 PM »
The P3 is running linux; so we don't have to deal with building windows drivers.

Fair enough. Pretty happy and not too worried about it at the moment. Just connected 4 switches and added some code to push them into the proc. Switch events came back from the proc for each one with correct number. So I know that everything is good including my new switch matrix board.
Coils will probably be a bit harder to get working (circuit breaker will probably come in handy) but I probably wont tackle them till I've got the switches bedded down and the framework cleaned up.

briancox

  • Full Member
  • ***
  • Posts: 45
    • View Profile
Re: Building libpinproc with Visual Studio
« Reply #4 on: May 17, 2015, 11:16:06 PM »
Hi guys,

I'm having a similar issue with Windows 10, and was wondering if there are any pre-build binaries for libpinproc?

thanks!

Brian Cox

dave_h

  • Wizard
  • *****
  • Posts: 185
    • View Profile
Re: Building libpinproc with Visual Studio
« Reply #5 on: February 24, 2016, 09:28:37 AM »
Hi guys,

I'm having a similar issue with Windows 10, and was wondering if there are any pre-build binaries for libpinproc?

I nearly had a 64bit built yesterday .....after 3 hours ....but doesn't work. Have you managed to build one yet? I'm after 64bit