# first build, cmake error "Cannot find source file"



## mic angelo (Aug 22, 2016)

*UPDATE*

I finished a build with no errors, but obs64.exe won't run, "because avcodec-57.dll is missing from your computer." I can copy it over from /dependencies2015/ but there are many others missing, including QT stuff, etc. All suggestions are welcome!

---

*ORIGINAL POST*

cmake

I checked /win-dshow/libshowcapture and it's just empty.

I anticipate that I have not included enough information for anyone to give me useful advice. Please help me ask a better question!


----------



## Jack0r (Aug 22, 2016)

Did you do: git clone --recursive https://github.com/jp9000/obs-studio.git
To get all necessary files? As described in the install instructions.


----------



## mic angelo (Aug 23, 2016)

I had not... but I just started from scratch so I can follow the install instructions to the letter (git clone --recursive). I have new problems... should I post here, or start a new thread?

Here (cmake image) is my current CMake output. When I try to Build Solution in VS15, I get several hundred 'unresolved' errors, 'operator' warnings, and 'library' warnings.

Also I'm unsure if I should set DepsPath to the literal 'deps' directory in the project root, or to the directory I added (the contents of dependencies2015.zip)


----------



## Jack0r (Aug 23, 2016)

The screenshot looks good as far as I can tell, check copy dependencies and click on configure, then generate to get the obs-studio.sln.
VS will show quite a few different warnings and errors, but at the end it should say something like:
==========  Build: 31 succesful, 0 errors, 0 up to date, 2 skipped
And you should have an obs.exe to run in your build\rundir\Release\bin\32bit or 64bit folder.

Oh and the dependencies path should be the folder with the extracted zip contents:

DepsPath (Path to the include for all dependencies, not including Qt.)
for example: C:\Build\Dependencies\win32\include for 32bit


----------



## mic angelo (Aug 23, 2016)

Thanks for the continued support! I've followed your instruction. Still lots of errors and warnings in VS. Ideas?

cmake, VS


----------



## Jack0r (Aug 24, 2016)

I checked again and I wasnt completely correct earlier. VS should show warnings but no errors if all builds went fine.

I noticed one error that could lead to some missing files though. DepsPath in cmake is: C:\github\obs-studio\deps. You will probably want to add \dependencies2015\win64\include there as well.

You can also click on advanced in cmake to see the full cmake list, maybe attach a screenshot of that list after changing the depspath and clicking on configure


----------



## mic angelo (Aug 24, 2016)

Okay, cool.

After that change, the VS errors look about the same.

Here is my updated CMake (album, 2 images).

Here is VS error list (album, 6 images).

Among (many) other problems, a lot of ffmpeg stuff is not working correctly, which is odd, since CMake seems to think my ffmpeg business is working just fine. Maybe I'll try the dependencies2013 pack, instead of -2015... or the 32-bit packs instead of 64.

update: I tried both the 32-bit and 64-bit packs in both the 2013 and 2015 dependencies packs from the installation instructions, to no avail. I did notice using either of the two 32-bit packs produced more errors, along the lines of "32-bit/64-bit conflict" kind of stuff.

Thank you!


----------



## Jack0r (Aug 24, 2016)

I noticed it found a few files in C:\Strawberry\c\include which might lead to problems, for example the freetype library is found in your normal dependencies folder for OBS but the other two folders are set to strawberry. You should make sure it only uses your dependencies2015 folder.

You might just want to do the following, first of all make sure your environment variables are configured as needed. I just added the DepsPath and QTDir there so I dont have to add them to Cmake each time, see the attached image.

DepsPath32 : C:\github\obs-studio\deps\dependencies2015\win32\include
DepsPath64 : C:\github\obs-studio\deps\dependencies2015\win64\include

QTDir32 : C:\QT\5.7\msvc2015
QTDir64 : C:\QT\5.7\msvc2015_64
Then delete your build folder to start fresh with cmake. 

Make sure, when you first click on configure to select the "Visual Studio 14 2015 Win64" compiler in the first dropdown.
Cmake should then pick the dependencies2015\win64 path for each module and "CMAKE_LINKER" should use the x86_amd64/link.exe of visual studio.
After the first configure is done and if all folders look correct (make sure advanced is checked) you can check copy dependencies and click configure again, then generate.
In VS after opening the obs.sln give it some time to load everything and then let it try building again.


----------



## mic angelo (Aug 25, 2016)

avcodec-57.dll missing

Thank you! After some playing, I finished a build with no errors, but the obs64.exe won't run, "because avcodec-57.dll is missing from your computer."

I'll look into this. Any insight you might have would be greatly appreciated.

=]

*EDIT: I've found that if I simply copy/paste the DLL into the same directory as the executable, I no longer get that error (however I do get another error because other DLL(s) are also missing)

EDIT 2: Looks like a ton of stuff from obs-studio/additional_install_files/exec64 is missing. Should I adjust my CMake env vars to account for this?*


----------



## Jim (Aug 25, 2016)

It sounds like you didn't follow the build instructions.  Specifically, the part mentioning the COPY_DEPENDENCIES.  If you failed to copy the first time, there will be a new variable, COPIED_DEPENDENCIES.  Uncheck that if you want to make it re-copy dependencies for use with building.  You do not need to do this every time you build, that's usually only for re-copying when you want to update dependencies.  You should normally only need to have dependencies copied once.


----------



## mic angelo (Aug 25, 2016)

Thanks Jim. I tried your suggestion, but it didn't change anything.


----------



## Jim (Aug 25, 2016)

Delete your cmake cache and try again I suppose.  There isn't any bug with the cmake files on this.


----------



## mic angelo (Aug 29, 2016)

If I manually copy/paste all the DLLs into my build folder, OBS runs flawlessly. Any suggestions other than start over from scratch? (why don't my DLLs get copied into my build folder?)


----------

