ModPlug Central

OpenMPT => Development Corner => Topic started by: Saga Musix on April 11, 2010, 17:16:38

Title: Compiling OpenMPT with Visual Studio Express
Post by: Saga Musix on April 11, 2010, 17:16:38
I've recently heard from 8bitbubsy that you actually can compile OpenMPT using Visual Studio Express - wohoo!
So what do you need?

- Download the Windows SDK
- Download the DirectX SDK
- Grab the ASIO SDK files from an old SVN revision, f.e. revision 240. Those files reside in the "include" directory.
- You'll get some __RPC_OUT problems, just do "#include <rpcsal.h>" on top of mediaobj.h (the one in the visual c++ include library).

I have obviously not tested this myself, but maybe someone using VS Express can confirm that this works?
Title: Compiling OpenMPT with Visual Studio Express
Post by: Rakib on April 11, 2010, 19:24:18
I'll try tomorrow. VS2010 will be released then, been wanting to try it out for a long time.
http://www.microsoft.com/visualstudio/en-us/visual-studio-events
Title: Compiling OpenMPT with Visual Studio Express
Post by: Saga Musix on April 11, 2010, 20:00:16
I don't know what additional steps would/could be necessary for VS2010, since there's no project file for VS2010 yet. I guess I'll get VS2010 ASAP when it's available at university and try it out.
Title: Compiling OpenMPT with Visual Studio Express
Post by: Rakib on April 11, 2010, 20:04:55
But how is this possible?



Quote from: "http://www.microsoft.com/express/Support/Support-faq.aspx"Does Visual C++ 2008 Express Edition include MFC and ATL?

No, MFC and ATL are not included with Visual C++ 2008 Express. MFC and ATL will be included in Visual Studio 2008 Standard and above editions.
Title: Compiling OpenMPT with Visual Studio Express
Post by: Saga Musix on April 11, 2010, 20:17:30
That's what the Windows SDK is for. It just says "is not included", not "does not work with".
Title: Compiling OpenMPT with Visual Studio Express
Post by: Rakib on April 11, 2010, 21:33:48
Hope this is the right file, 1.5GB.
http://www.microsoft.com/downloads/details.aspx?FamilyID=71deb800-c591-4f97-a900-bea146e4fae1&displaylang=en.

And I'm a bit concerned about VS2010 which has removed the local include directories, and instead moved it to each project file.

And also with the new soon to be released winsdk 7.1 with support for .net 4, it looks like it's installer file is going to be 1/3 of the current version, so I'm just guessing MFC is one the things they might remove.

http://blogs.msdn.com/windowssdk/
Title: Compiling OpenMPT with Visual Studio Express
Post by: g on April 12, 2010, 19:51:05
Quote from: "Jojo"I guess I'll get VS2010 ASAP when it's available at university and try it out.
It's already available at Dreamspark (http://www.dreamspark.com). MSDNAA seems to be slower.
Title: Compiling OpenMPT with Visual Studio Express
Post by: Saga Musix on April 12, 2010, 20:08:54
Well, MSDNAA is a lot less hassle for me (no verification or whatever needed), so I will wait for that...
Title: Compiling OpenMPT with Visual Studio Express
Post by: Harbinger on April 20, 2010, 13:52:01
Does this mean i dont need to go buy VS Pro to work on and compile MPT? Will i have to give up anything if i use Express?
Title: Compiling OpenMPT with Visual Studio Express
Post by: Saga Musix on April 20, 2010, 14:06:36
If bubsys discoveries work for you, that means that you don't have to buy VS and you will have everything you need for now.
Title: Re: Compiling OpenMPT with Visual Studio Express
Post by: Harbinger on April 20, 2010, 15:03:36
Quote from: "Jojo"
So what do you need?

- Download the Windows SDK
- Download the DirectX SDK
- Grab the ASIO SDK files from an old SVN revision, f.e. revision 240. Those files reside in the "include" directory.

Which Windows SDK? After a search in microsoft, it has choices for Windows 7, Windows SDK for Visual Studio 2008 (but the notes say it does NOT work with Visual Studio Express), and many other types.

(If it matters, i'm using Windows XP...)

I found the DirectX SDK for XP here (http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=86cf7fa2-e953-475c-abde-f016e4f7b61a), but there other more recent versions. This one is a 441 MB DL!

Still looking for the ASIO SDK...
Title: Re: Compiling OpenMPT with Visual Studio Express
Post by: Saga Musix on April 20, 2010, 15:33:17
Quote from: "Harbinger"Still looking for the ASIO SDK...
The ASIO stuff can be found here (http://sagagames.de/stuff/include.zip), just extract the files into OpenMPT's "include" directory (there are already files like BLADEENC.H in that directory).
Title: Compiling OpenMPT with Visual Studio Express
Post by: 8bitbubsy on April 20, 2010, 15:33:52
Download the Windows 7 SDK even though you're in XP (it installs the XP SDK files)
http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en

It's a big download but it's a one-time install. Same goes to the DirectX SDK.
They should both work with Visual C++ 2008 Express.

Regarding the ASIO files, Saga_Musix has got them in a zip somewhere... Make its presence known!
EDIT: I'm a slowpoke!
You can also put the include files here:
<programfiles>\Microsoft Visual Studio 9.0\VC\include
Which means you don't have to download them again if you were to accidentally delete the OpenMPT SVN folder.

As for the SDKs you download, they are seen by Visual C++ as include paths. Don't copy or move them.
Title: Compiling OpenMPT with Visual Studio Express
Post by: Harbinger on April 20, 2010, 16:17:59
Bad news --- you have to be on the internet at your own computer, because the Download button apparently downloads an executable that downloads the actual software. Seeing that i'm on the internet at the library, and they don't allow installation of anything onto their computers, nor running an executable from even a flashdrive, i've hit the proverbial dead-end...
Which may be ok, i only have a 4GB flashdrive anyway; i don't think i would have made it. :cry:

The DirectX SDK was also too big, and it would have taken a couple of hours here at the library, and we're only allowed 2 hours a day. :x

As for others, i'm sure it will work. Thanks 8bit for that great info!! :wink:
Title: Compiling OpenMPT with Visual Studio Express
Post by: Saga Musix on April 20, 2010, 16:21:42
You could try the ISO version (http://www.microsoft.com/downloads/details.aspx?FamilyID=71deb800-c591-4f97-a900-bea146e4fae1&displaylang=en) Rakib linked to earlier. You can burn that on a CD (or use CD emulation, for that matter). If that's too big, try a download manager (preferrably a portable one).
Title: Compiling OpenMPT with Visual Studio Express
Post by: Harbinger on April 20, 2010, 16:26:34
OK, that may work. But i'll hafta wait till next time, because i didn't bring any CDs with me (it does work on CDs right, or am i presuming too much? again! :lol: )
So i just download the correct ISO directly to a CD/DVD and it will work as normal when i take it home?
Title: Compiling OpenMPT with Visual Studio Express
Post by: Saga Musix on April 20, 2010, 16:31:57
you download the ISO preferrably to a usb stick and either
1) burn it on a CD at home (using f.e. CDBurnerXP) or
2) extract the files from the ISO file, for example using WinRAR or
3) emulate a CD drive using something like daemon tools
Title: Compiling OpenMPT with Visual Studio Express
Post by: Harbinger on April 20, 2010, 16:48:04
Great answers, and everything would work except that when i began downloading, the download dialog box said it would take 5 hrs!!

Needless to say, that won't work -- i've only got 80 mins left! :o

Always one constraint or another...

Thanks though for your help Jojo and 8bitbubsy! :wink:
Title: Compiling OpenMPT with Visual Studio Express
Post by: Saga Musix on April 20, 2010, 16:49:48
Well, as I said, a download manager should help.
Title: Compiling OpenMPT with Visual Studio Express
Post by: Relabsoluness on April 21, 2010, 00:13:11
Since nothing else seems to suggest that the SDK would include MFC and I've seen an installation of that particular SDK that does not have MFC includes nor libraries, more details about this would be nice to hear.
Title: Compiling OpenMPT with Visual Studio Express
Post by: rewbs on April 21, 2010, 07:52:35
Quote from: "Relabsoluness"Since nothing else seems to suggest that the SDK would include MFC and I've seen an installation of that particular SDK that does not have MFC includes nor libraries, more details about this would be nice to hear.

Agreed. I always thought that the MFC libraries are effectively "part of" VS Standard/Pro only, so there is no (legal) way to build MFC apps on Express. That said, I can't find an unambiguous reference from MS supporting this statement, so I'd be delighted to be proven wrong.

8bitbubsy, just to be sure, can you confirm you have successfully built and executed OpenMPT on a system on which no commercial versions of VS are installed?
Title: Compiling OpenMPT with Visual Studio Express
Post by: Rakib on April 21, 2010, 08:07:28
Another pack that claims to include support for mfc.
http://www.microsoft.com/downloads/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en
Title: Compiling OpenMPT with Visual Studio Express
Post by: 8bitbubsy on April 21, 2010, 10:06:16
Quote from: "Relabsoluness"Since nothing else seems to suggest that the SDK would include MFC and I've seen an installation of that particular SDK that does not have MFC includes nor libraries, more details about this would be nice to hear.
That's quite odd, because I've never ever used the pay-version of Visual C++, and yet I've compiled OpenMPT just fine by installing the DirectX SDK and Platform SDK/Windows SDK... + the include files Jojo/Saga_Musix linked to.
Actually, I compiled OpenMPT today and yesterday.
Title: Compiling OpenMPT with Visual Studio Express
Post by: Relabsoluness on April 21, 2010, 21:51:17
Quote from: "Rakib"Another pack that claims to include support for mfc.
http://www.microsoft.com/downloads/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en
But as said in the site: "This is a supplemental library and requires Visual Studio 2008 Standard Edition or above be installed on your system. "

Quote from: "8bitbubsy"That's quite odd, because I've never ever used the pay-version of Visual C++, and yet I've compiled OpenMPT just fine by installing the DirectX SDK and Platform SDK/Windows SDK... + the include files Jojo/Saga_Musix linked to.
And you can verify that the MFC include files and libraries are located in the SDK folders which by default is something like "C:\Program Files\Microsoft SDKs\Windows\v7.0\..."?
Title: Compiling OpenMPT with Visual Studio Express
Post by: Harbinger on April 22, 2010, 20:44:52
Found out that the library i'm downloading at is part of the city internetwork, so the more people working for the city are using the network, the slower my DLs will be. I've come here later in the day, about 5pm, when the city workers are going home, and my transfer rate is at least 10 times faster. So i'm DLing the Express .iso first. I'll let you all know...

(Later that day...)

Transfer rate much better, i may be able to get the Windows SDK, the DirectX SDK, and Visulal Basic 2008 Express all today...i'm anxious to get working. :wink:
Title: Compiling OpenMPT with Visual Studio Express
Post by: Harbinger on May 01, 2010, 17:52:36
Downloaded the dxsdk_apr2007.exe
Extracting:
- When initially extracting (the first window), the first process seems to stutter, but it does work.
- Let the Self-Extractor unzip to the temporary folder. The Setup afterwards will allow you to place it where you wish.
- When asked which files to extract, everything is checked except the "Redistributable Files". I went ahead and checked that so it would be included. The total disk space needed is about 8.5 MB.
- The files are extracted to a folder called "Microsoft DirectX SDK (April 2007)".

Downloaded the GRMSDK_EN_DVD.iso
Extracting:
- Tried burning to a DVD-R in hopes of opening it as a mounted CD/DVD. The burn was successful (it will not fit onto a single CD-R), but Windows would not mount it when i double-clicked it. Went to WinRAR as Jojo suggested, but it did not recognize anything except the ReadMe. On a hunch, i opened it with 7-Zip, and it recognized all the files. I unzipped the ISO to a temp folder.
- Ran the Setup for the SDK installer. Again i checked the Redistributable Files box since i wasn't sure if i would need it. Total Disk space for everything: 1.4 GB.
- The files are extracted to a folder called "MicroSoft SDKs". I also noticed a lot of Registry reworking (adding AND deleting entries) while the extraction took place. But the whole installation seemed to be well-organized (it stopped to clean up memory caches along the way!), and it even creates a log file. I should have brought a Tom Clancy novel though; it took 15 minutes!

Downloaded VS2008ExpressENUX1397868.iso
Extracting:
- With 7-Zip the extraction of .iso files into a temporary folder took a lot longer (over 20 mins, even at 2MB/sec!). But it was successful. It needed over 2.7GB of my hard drive to do it. Apparently because there are 4 versions of Visual Express: Visual C++, Visual C#, Visual Basic, and Visual Web Developer. That's dumb...
- The Setup installer prompts you for various components: Visual C++, SQL, and Silverline. Since i'm not on the internet at home, i deselected the Silverline. Not sure if i would need SQL, i kept that (it was only an extra 400 MB). Anyway, the installation took over 10 minutes, and there was no details on what was being done like in the WindowsSDK installer.
- After it was done, i found no log as to what was added to my computer and where.

I have a feeling i should have loaded the SDKs AFTER the VSExpress installation.

I started VS2008Express, but i wasn't sure how to determine if VSExpress recognizes all the SDKs. It loaded mptrack.vsproj just fine.
I need to learn the VS environment, so i can learn how to compile the source. I first want to make sure it will cleanly build the project from the outset.

More news later, but first a couple of questions:

1. How do i know if the SDKs are being recognized and used?
2. Once i begin making changes, how do i use Tortoise to create a patch (what the usual routine?)? Then where do i submit it for inclusion in the build? (I have the most recent build, and the 'working copy' all set up, but the instructions make it unclear about how to create the patch from a project...)

OK, after trying to build, the log says that it doesn't recognize stdafx, which i believe is part of MFC. So for now i still can't do any (effective) work...
Title: Compiling OpenMPT with Visual Studio Express
Post by: Saga Musix on May 01, 2010, 20:10:40
QuoteI have a feeling i should have loaded the SDKs AFTER the VSExpress installation.
yes.

QuoteIt loaded mptrack.vsproj just fine.
You have to open MPTRACK_08.sln.

Quote1. How do i know if the SDKs are being recognized and used?
If it doesn't compile. :P
2. You can find that out as described here: http://openmpt.xwiki.com/xwiki/bin/view/Development/GettingTheCode

Quote
2. Once i begin making changes, how do i use Tortoise to create a patch (what the usual routine?)?
Right-click on the OpenMPT-Folder (it should have a red exclamation mark instead of a green checker) as soon as you modify a file and choose TortoiseSVN -> Create Patch. Then send it to Relabs.
Title: Compiling OpenMPT with Visual Studio Express
Post by: Relabsoluness on May 13, 2010, 20:27:15
To cut wings from the rumours giving false hope to people and wasting their time, could we make it clear that OpenMPT can't be compiled by using VC2010 express with latest Microsoft SDK or if it can, surely someone can confirm the report.
Title: Compiling OpenMPT with Visual Studio Express
Post by: Harbinger on May 13, 2010, 20:47:41
I've had so many problems with 2008 Express and there have been no clear instructions on how to set up everything, that i've given up and i'm trying to  find VS 2008 Professional/Standard. Plus i'll be trying some other projects, and i need to use the dialog builder feature.