# Trying To Build OBS Redux



## dacoder (Feb 9, 2014)

Hello again, I have been trying to compile the dev version of OBS from this guide:
https://github.com/jp9000/obs-studio/blob/master/INSTALL
So am I doing it wrong, or is the rewrite not reached a stage of being able to be compiled?
I am building it with VS2013, the whole project, and I have compiled and added both QT5 and FFmpeg to my windows environment variables.
But: on trying to build I get numerous errors:

```
Error	1	error MSB6006: "cmd.exe" exited with code 3.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets	170	5	obs-studio
Error	2	error C1083: Cannot open include file: 'libavutil/opt.h': No such file or directory	d:\users\dacoder\downloads\obs-studio-master\obs-studio-master\libobs\media-io\audio-resampler-ffmpeg.c	21	1	libobs
Error	3	error LNK1104: cannot open file 'libobs.lib'	D:\Users\DaCoder\Downloads\obs-studio-master\obs-studio-master\vs\2013\wintest\LINK	wintest
Error	4	error LNK1104: cannot open file 'libobs.lib'	D:\Users\DaCoder\Downloads\obs-studio-master\obs-studio-master\vs\2013\libobs-d3d11\LINK	libobs-d3d11
Error	5	error LNK1104: cannot open file 'libobs.lib'	D:\Users\DaCoder\Downloads\obs-studio-master\obs-studio-master\vs\2013\libobs-opengl\LINK	libobs-opengl
Error	6	error C1083: Cannot open include file: 'libavformat/avformat.h': No such file or directory	d:\users\dacoder\downloads\obs-studio-master\obs-studio-master\plugins\obs-ffmpeg\obs-ffmpeg-output.h	24	1	obs-ffmpeg
Error	7	error LNK1104: cannot open file 'libobs.lib'	D:\Users\DaCoder\Downloads\obs-studio-master\obs-studio-master\vs\2013\test-input\LINK	test-input
```

So what have I done wrong, (I don't use Visual Studo, but I have done C++ and C) from this, it would seem, it is trying to include some things from FFmpeg, and OpenGL, but I have setup the paths correctly, so I am uncertain as to why this is happening.


----------



## Jim (Feb 10, 2014)

Well I'm not entirely sure what it is you're doing but you've definitely not set it up correctly.  I'm pretty sure that's not the entire build command line either, I would have to see the entire thing to be able to tell you why.


----------



## dacoder (Feb 10, 2014)

Jim said:
			
		

> Well I'm not entirely sure what it is you're doing but you've definitely not set it up correctly.  I'm pretty sure that's not the entire build command line either, I would have to see the entire thing to be able to tell you why.



So post the whole build log? Alright, will do.


----------



## Jim (Feb 10, 2014)

Yea, please do.  Make sure to attach it as a text file or use code tags as per usual.


----------



## dacoder (Feb 11, 2014)

Jim said:
			
		

> Yea, please do.  Make sure to attach it as a text file or use code tags as per usual.



I just uploaded the output directly to pastebin, here you go: http://pastebin.com/Q6UAXx9A


----------



## ScarFace (Feb 11, 2014)

Having the same cmd.exe error.
It says that is has to do with the custom build object, which probably means it has problems with Qt5. Don't know the solution though...

As far as the libobs, it probably means that ffmpeg is not found (it needs it to create libavutil/opt.h)

I managed to finish a build of ffmpeg through this

But i don't really understand what to do with Qt5... grab the pre-built, or compile? and when compiling i tried to follow this guide but i am getting some errors while using nmake.

Hope it helped a bit, and hopefully we can get some further info on using Qt5 here


----------



## Jim (Feb 11, 2014)

Building on windows right now is difficult.  They don't provide VS2013-compatible binaries yet (I think that's late next month when they will), so it has to be built manually.  I actually at this point would probably not recommend doing it if you're not experienced with this sort of thing, because it's going to be somewhat painful.

Download the Qt5 repo
Set up the Qt5 repo
Build the Qt5 repo (preferably with jom to utilize all your cores)

Building FFmpeg is a bit painful too.  I would probably recommend downloading a prebuilt distribution somewhere if you can.  Otherwise you'll have to follow the build instructions on their site.  Make sure to build it with the correct architecture as well.  After doing that, set the FFmpegPath environment variable to the ffmpeg path where you cloned the repo to.

It'll probably need x264 if using cmake as well, though you don't need to actually compile it.  x264Path should be what you have to set for the clone dir.

I personally just use the VS project files on windows, I have it set up just the way I like right now


----------



## dacoder (Feb 11, 2014)

So is there a x64 architecture for the OBS build? I have compiled ffmpeg (actually for my livestream application for ubuntu) not qt5 yet. I suppose I should just get x32 for both qt5 and ffmpeg, even though I have a x64 pc.

I installed a x64 qt5 and a x64 ffmpeg, in the path areas should i place the path to qt5's tools for qtCreator, or just the 5.2.1 release, or the folder in that folder? "Installation folder" is a bit in-precise. Likewise: FFmpeg's builds are installed to a path with "bin" and etc. in it. Should the path for "FFmpegPath" be set to the bin? or the folder containing thereof?


----------



## dacoder (Feb 12, 2014)

dacoder said:
			
		

> So is there a x64 architecture for the OBS build? I have compiled ffmpeg (actually for my livestream application for ubuntu) not qt5 yet. I suppose I should just get x32 for both qt5 and ffmpeg, even though I have a x64 pc.
> 
> I installed a x64 qt5 and a x64 ffmpeg, in the path areas should i place the path to qt5's tools for qtCreator, or just the 5.2.1 release, or the folder in that folder? "Installation folder" is a bit in-precise. Likewise: FFmpeg's builds are installed to a path with "bin" and etc. in it. Should the path for "FFmpegPath" be set to the bin? or the folder containing thereof?



I fixed the the issue, I went back and found that my lib32 and lib64 files (in the FFmpeg path area) did not have any .libs in 'em! Fixed and fixed man, will let you know what else comes up!

Fixed it, going with x32, since your project seems to want to stay in x32 mode? :/


> Compile FFmpeg and Qt5(Until they release a binary VS2013 version).
> They should both be compiled with VS2013.



Here is the issue I have been having, I need to compile this version sadly.

Getting errors on Qt5 compile, but that is irrelevant to this post.
After 3 hours or so trying to compile it, I decided to just wait for a 2013 release :P
Compiling is so much easier on Linux, man.


----------



## ScarFace (Feb 15, 2014)

Found the problem with the cmd.exe error.

Seems when you pull the qt5 repository, it has a different folder layout as the programmer probably has.
The necessary "include" folder for qt5 is not in the qt5 root folder, but in "qt5/qtbase/".

So you should set the QTDIR environment variable to (example) "C:\qt5\qtbase".

Or like lazy me:

Cut the qtbase folder
Paste it up one directory
Throw the remaining qt5 folder away
Rename the qtbase folder to qt5

(for some reason the project still used the previous locations and cleaning the build didn't fix it for me)

You probably won't need the other files so i got rid of all excess stuff.

after adding some .dll files and the stuff from the build folder of obs-studio, i finally got it to work. But right now it is clear that it is still way before alpha release. So you will be better of waiting just a bit longer.


----------



## dacoder (Feb 15, 2014)

ScarFace said:
			
		

> Found the problem with the cmd.exe error.
> 
> Seems when you pull the qt5 repository, it has a different folder layout as the programmer probably has.
> The necessary "include" folder for qt5 is not in the qt5 root folder, but in "qt5/qtbase/".
> ...



Oh I had the wrong version aswell, but glad you found another issue :D


----------



## dacoder (May 22, 2014)

Jim said:


> Building on windows right now is difficult.  They don't provide VS2013-compatible binaries yet (I think that's late next month when they will), so it has to be built manually.  I actually at this point would probably not recommend doing it if you're not experienced with this sort of thing, because it's going to be somewhat painful.
> 
> Download the Qt5 repo
> Set up the Qt5 repo
> ...



I know this is an old post, but QT5 (i have just found out) have put out a VS2013 build. Now I am super close to finishing the compile for this :D

Here is the only problem i am having (i am trying to compile in x64...

And this error appears:
Error    14    error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'    D:\Users\DaCoder\Downloads\OBS STUDIO\obs-studio-master\obs-studio-master\vs\2013\obs-studio\Qt5Cored.lib(Qt5Cored.dll)    obs-studio

Do I just have to compile in 32 bit? Qt5 + FFmpeg are both 64 bit

EDIT: Found it was just a VS2013 configuration bug, now im left with this sole error:
Error    1    error C1083: Cannot open include file: 'x264.h': No such file or directory    D:\Users\DaCoder\Downloads\OBS STUDIO\obs-studio-master\obs-studio-master\plugins\obs-x264\obs-x264.c    21    1    obs-x264

EDITx2: Just didn't compile the x264 and it compiled correctly! :D still can't run obs-studio.exe, what are you supposed to do with the .exe and files after it compiles? I cannot seem to find any info on that...


----------



## Jim (May 22, 2014)

Currently if you build it bare on windows you can run it through visual studio.  To make a fully modular version you need to include all the necessary qt5 dlls, which is incredibly annoying.


----------



## Stulander (Jul 4, 2014)

Dacoder, did you ever get this compiled? Jim, what works in this version?

I'm looking to capture a full-screen video game and encode with VP8. From what I understand this should be possible with this version?


----------



## Jim (Jul 4, 2014)

It is possible, though I haven't added user interface for the FFmpeg output yet.

I'll update the compile instructions at some point, for all operating systems and a number of problematic distros.


----------



## dacoder (Jul 5, 2014)

Stulander said:


> Dacoder, did you ever get this compiled? Jim, what works in this version?
> 
> I'm looking to capture a full-screen video game and encode with VP8. From what I understand this should be possible with this version?



I did get it to compile, except for x264... it will not run in VB, just says it stopped working. Error code 03 (cmd error)

What does it take to get x264 to compile? I thought that OBS could run with out that library?

EDIT: The x264 must be compiled in new versions of OBS studio. Thanks again Jim!


----------



## dacoder (Jul 7, 2014)

Bump.
New update: http://pastebin.com/j1jhmYQS
Got x264 working beautifully, but this other error i have no clue x.x


----------



## dacoder (Jul 7, 2014)

fix was ATL (found in pre-2003 Windows SDK's) and a https://github.com/jp9000/libdshowcapture
download and install both to specified folders, and bam!

Easiest way, DONT GET EXPRESS, go get VS2013 Studio.


----------



## mmlac (Aug 14, 2014)

PLEASE tell me how on earth you got x264 to compile in 64bit on windows?

I can't find anything on the internet regarding how to build it so I actually have an include folder. Building it shared won't do sh***. I can build a static that gives me a libx264.lib file but cmake will neither recognize the lib by setting the env variable to the folder itself nor work if I manually select this as the LIB_X264 variable

Also libfdk needs manual building?


And yes, building this on windows atm is a massive pain in the back. I'd love to test and help out but I can't even get past the install notes :D


----------



## benklett (Aug 14, 2014)

mmlac said:


> PLEASE tell me how on earth you got x264 to compile in 64bit on windows?
> 
> I can't find anything on the internet regarding how to build it so I actually have an include folder. Building it shared won't do sh***. I can build a static that gives me a libx264.lib file but cmake will neither recognize the lib by setting the env variable to the folder itself nor work if I manually select this as the LIB_X264 variable
> 
> ...



BtbN made some builds and shared a zip file which has basically every libary you would need except Qt as you can download Qt from their website. I do not know if he wants his link to be shared, but I quickly uploaded it to GDrive: https://drive.google.com/file/d/0B5aNGDV5-2TUaU1WX0Zlb2RxTkU/edit?usp=sharing .

libfdk is as far as I know optional and will, if not available, be replaced by ffmpegs AAC encoder. Though libfdk is also included in this zip.


----------



## mmlac (Aug 15, 2014)

ha...ha... this is embarrassing.

make *install* after make created the folders and solved everything. You would think a single article in the interwebs would mention that... *sigh*

Thanks for the package, I think I got all the libs compiled now.  I used the package provided anyhow and it build just fine.

What file do I execute now? I tried build/obs/Debug/obs64.exe but it just barks at me saying obs.dll is missing from my computer.

Same with all the other .exe in the build folder. Am I executing the wrong one?

I build selecting ALL_BUILD in the solution and then just BUILD -> Build Solution

========== Build: 20 succeeded, 0 failed, 0 up-to-date, 2 skipped ==========


----------



## mmlac (Aug 17, 2014)

Can anyone help me here?  :/

I checked out the latest code (83fe23), ran CMAKE with copy dependencies.

I try to run it from within Visual Studio (select solution, right click, Debug -> Start new Instance) and it will also always fail with missing DLLs:

ALL_BUILD: avcodec-55.dll is missing from your computer
obs -> obs.dll is missing
win-test -> obs.dll missing
INSTALL fails   https://gist.github.com/mmlac/162bbf0cbb6aaefbc2db



What am I doing wrong? :(


----------



## Jim (Aug 17, 2014)

mmlac - I'm guessing it can't find the FFmpeg dlls?  I'd probably have to build it on your computer myself to know for sure but I'm betting the FFmpeg directories are set up in a way it doesn't currently account for.


----------



## mmlac (Aug 17, 2014)

Ok, adding it to the global Path and running it inside VS worked. Still don't know why it didn't find the dll, it found everything else needed :/

Thanks so much :)


----------



## Jim (Aug 17, 2014)

No problem.  Feel free to come by the dev chat any time if you have questions about building as well.


----------

