[Outdated - need VS 2013 now] Microsoft Visual Studio 2010/2012

Jack0r

The Helping Squad
See: Getting Started with OBS Development
To successfully compile OBS you will need the following things:
The DirectX SDK is actually included in the Windows 8 SDK, but if you get an error message while compiling, make sure to install the DirectX SDK.

Now after you installed everything (and properly rebooted your PC) extract the source files to there own folder and open Visual Studio. I will talk about compiling OBS with the "ALL" option so you will be good to go afterwards. So, in Visual Studio click on File -> Open -> Project / Solution and open the OBS-All.sln!
It will take some time to load everything. (Header files of the Windows/DirectX SDK etc.) Visual Studio 2012 will ask you to update the VC++ Projects to Visual Studio 2012. You will have to update them, to compile everything with Visual Studio 2012.
Users of VS 2010 can skip this step.

Before you can compile right away, you might want to check the correct version will be build. You can do this by using the the Build Menu and opening the Configuration Manager.
For a normal compile process, choose Release, and your desired Windows version (Win32 or 64). Then hit F7 or click on Build -> Build Solution. The Output console should show you which file is currently being processed. After a successfull compile you should get the following result:
========== Build: 10 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Something failed? Check the console which step failed and start Troubleshooting. Missing headers for example indicate you are missing SDK files or similar.
Everything fine? You can now open your sources folder in your Explorer and enter the "rundir" folder.
Now select the copy*****.bat according to the settings you choose in Visual Studio earlier.
  • - CopyDebug for Debug 32bit
    - CopyRelease64 for Release 64bit
    - etc.
You can also move the Program Debug DataBase files according to your compiled version to this folder. They are in the rundir/pdb32 or pdb64 folder. Now you have your first self-compiled version of OBS. You can move the files to a more comfortable folder of course.

More Information can be found in the INSTALL file of your sources.zip.
Additions, Questions? Feel free to post them.
 
Last edited:
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

Thanks for the guide.

This doesn't actually work for VS 2012, however, because the repo is missing copies of libmp3lame-static.lib for VC11.
 

Jack0r

The Helping Squad
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

hmm, I tested it on both Programs, and it worked and compiled perfectly, can you be more specific on what kind of error you get?
Quote of the INSTALL file:
Compiling
---------------------------------------------

Required (and included) libraries:
libmp3lame - MP3 encoder - obs/lame
libfaac - AAC encoder - obs/libfaac
librtmp - RTMP protocol - obs/librtmp
libsamplerate - audio resampler - obs/libsamplerate
libx264 - x264 encoder - obs/x264

To compile OBS and all its sub-libraries, you can use OBS-All.sln
and compile everything all at once, or you can compile everything
individually yourself. x264 and libmp3lame are pre-compiled for
convenience.

So im not sure what error you got :)
 
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

Have you tried the Release x64 configuration?

2>------ Build started: Project: OBS, Configuration: Release x64 ------
2>LINK : fatal error C1047: The object or library file 'lame/output/64bit\libmp3lame-static.lib' was created with an older compiler than other objects; rebuild old objects and libraries
2>LINK : fatal error LNK1257: code generation failed
 

Jack0r

The Helping Squad
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

Tested it on both 2010 and 2012, and yes, I got the same error on 2012 trying to build release x64.
I will try to recompile the libmp3lame-static.lib later as I dont have enough time at the moment. You can try this as well of course. It should probably fix the error.
 

Faruton

Developer
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

Yeah. When I did it I just copied nasmw into the lame directory and build the 64bit version of the library with Makefile.mvsc.
 
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

I actually just upgraded lame's VC projects and added libmp3lame-static and libmpghip-static to OBS-All. I'm not a fan of committing compiled libs for every version of Visual C++. And starting with VC11, VC updates will happen a lot more often.
 

ogry

New Member
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

I'm getting 66 Warinings and theses 10 erros when trying to compile the "Debug Win32" version with VS2012

  • Error 5 error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj) C:\Users\ogry\Documents\GitHub\OBS\LIBCMT.lib(invarg.obj) OBS
    Error 6 error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj) C:\Users\ogry\Documents\GitHub\OBS\LIBCMT.lib(invarg.obj) OBS
    Error 7 error LNK2005: __call_reportfault already defined in LIBCMTD.lib(invarg.obj) C:\Users\ogry\Documents\GitHub\OBS\LIBCMT.lib(invarg.obj) OBS
    Error 8 error LNK2005: __get_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj) C:\Users\ogry\Documents\GitHub\OBS\LIBCMT.lib(invarg.obj) OBS
    Error 9 error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj) C:\Users\ogry\Documents\GitHub\OBS\LIBCMT.lib(invarg.obj) OBS
    Error 10 error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj) C:\Users\ogry\Documents\GitHub\OBS\LIBCMT.lib(invarg.obj) OBS
    Error 11 error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj) C:\Users\ogry\Documents\GitHub\OBS\LIBCMT.lib(invarg.obj) OBS
    Error 12 error LNK2005: __set_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj) C:\Users\ogry\Documents\GitHub\OBS\LIBCMT.lib(invarg.obj) OBS
    Error 13 error LNK2005: ___pInvalidArgHandler already defined in LIBCMTD.lib(invarg.obj) C:\Users\ogry\Documents\GitHub\OBS\LIBCMT.lib(invarg.obj) OBS
    Error 14 error LNK1169: one or more multiply defined symbols found C:\Users\ogry\Documents\GitHub\OBS\Debug\OBS.exe 1 1 OBS


With the "Release Win32" I get 55 warnings, but goes...

  • ========== Build: 11 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
 
K

kuzma

Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

If you get any compiling errors on VS2012, then you have to remove all OBS source files, install the W8 SDK, DX SDK and then redownload all of the files again.
 

Krazy

Town drunk
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

How do you get around the mp3 lib error? I can't compile in 2012 for the life of me...

I get these same errors:
2>LINK : fatal error C1047: The object or library file 'lame/output/64bit\libmp3lame-static.lib' was created with an older compiler than other objects; rebuild old objects and libraries
2>LINK : fatal error LNK1257: code generation failed

edit: This is ONLY with the x64 compile. Compiling OBS in Win32 goes without a hitch
 

Jack0r

The Helping Squad
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

For vs2012 you have to rebuild the libmp3 I think. At least Jim told me that once and the error seems to lead to this conclusion. The vs2010 can build both (32/64) without a problem, so I assume the libmp3 was build with that! Maybe we can ask Faruton about this:
Faruton said:
Yeah. When I did it I just copied nasmw into the lame directory and build the 64bit version of the library with Makefile.mvsc.
 

Krazy

Town drunk
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

I tried rebuilding libmp3, but that didn't work either =/
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

Rebuilding lame needs to be done via command line unfortunately (which is why I provide lib files for convenience).

Open visual studio command prompt (32it for 32bit, 64bit for 64bit), go to the lame directory, and type:

nmake -f Makefile.MSVC CPU=P3 ASM=NO

or, for 64bit,

nmake -f Makefile.MSVC CPU=P3 MSVCVER=Win64 ASM=NO

You may get errors when building the executables -- this is actually fine, ignore it, only the main library file needs to be compiled. The library file will be generated in the output directory and will probably have to be manually moved wo the 32bit/64it subdirectory there. (It's annoying I admit)
 

Tyr

New Member
Re: [Compiling] OBS using Microsoft Visual Studio 2010/2012

I compiled libmp3 this way with VS 2012 installed and copied the resulting libmp3lame-static.lib in the 64bit folder where OBS expects it. But I still get the error "The object or library file 'lame/output/64bit\libmp3lame-static.lib' was created with an older compiler than other objects; rebuild old objects and libraries".
If I change all the OBS projects to use the Visual Studio 2010 (v100) Platform Toolset, it works though.
I believe I still have VS 2010 installed, maybe the Makefile uses the old toolset?
 

karthik

New Member
Hi,

When i trying to compiling i got this following errors :

Error #1

Error 51 error C1083: Cannot open include file: 'D3DX10.h': No such file or directory
d:\obs-all\obs_0472b_source_vs2010\source\Main.h Line:43 Column:1 Project:OBS

Error #2

Error 84 error LNK1181: cannot open input file 'dxguid.lib'
D:\OBS-all\OBS_0472b_Source_VS2010\GraphicsCapture\GraphicsCaptureHook\LINK Project: GraphicsCaptureHook

Error #3

174 IntelliSense: cannot open source file "D3DX10.h" d:\obs-all\obs_0472b_source_vs2010\source\main.h Line:43 Column:1 Project:OBS

Thanks in Advance
 

Jack0r

The Helping Squad
That sounds like it cant find the DirectX Header files. Did you install the DirectX SDK from the first post?
 

dodgepong

Administrator
Community Helper
Also, why on earth are you trying to build version 0.472b? The latest release is 0.64b. 0.472b is insanely old. VS2013 is free now, so there's no reason not to.
 

myopia

New Member
Is it possible to compile the latest version of OBS1 (0.64b) with VS2010? I was able to compile with VS2013 but had no luck with VS2010.

I'm trying to create a plugin for OBS and some of the other libraries I want to link against were created in VS2010.

Any help is appreciated.
 

myopia

New Member
Thanks Jack0r. I guess I'll have to contact the dev of the library and see if he is willing to upgrade to VS2013.
 
Top