Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cefsharp 37 build getting failed with VS2010, what to do? #810

Closed
rover886 opened this issue Feb 14, 2015 · 31 comments
Closed

cefsharp 37 build getting failed with VS2010, what to do? #810

rover886 opened this issue Feb 14, 2015 · 31 comments

Comments

@rover886
Copy link

I have downloaded cefSharp-master.zip and oped in VS2010 downloaded packages from nuget. When I build solution I get errors as follows:

error LNK1104: cannot open file 'libcef_dll_wrapper.lib
error LNK1181: cannot open input file 'libcef_dll_wrapper.lib

What can I do?

@jornh
Copy link
Contributor

jornh commented Feb 14, 2015

You can do this: With VS2010 for building CefSharp from source you need to provide a cef.sdk NuGet built for that version yourself. See under requirements in https://github.com/cefsharp/CefSharp/wiki/Building-CefSharp

The reason is core CefSharp developers currently only have VS2012 and VS2013.

@jornh jornh changed the title cefsharp 37 build getting failed. cefsharp 37 build getting failed with VS2010, what to do? Feb 14, 2015
@rover886
Copy link
Author

NuGet Restore is completed at my side. packages/ folder contains cef.redist.x64.3.2171.1979, cef.redist.x86.3.2171.1979, cef.sdk.3.2171.1979. still on Build Solution I am getting the error.

@jornh
Copy link
Contributor

jornh commented Feb 14, 2015

If you look inside the packages\cef.sdk.3.2171.1979\ folder from the official NuGet you will see lib's for VS2012 and 2013, but nothing for 2010. That's why you need to prepare a cef.sdk for yourself for VS2010.

It's a matter of:

  1. Downloading the right CEF version from http://cefbuilds.com
  2. Use the awesome build.ps1 in our cef-binary repo to repackage to a VS2010 cef.sdk. Before running it adjust comments at https://github.com/cefsharp/cef-binary/blob/master/build.ps1#L373 to enable 2010 and disable the other compiler versions
  3. Setup a local NuGet package source with your new package according to nuget's doc or manually extract/unzip the NuGet into your CefSharp packages folder in place of the official

@rover886
Copy link
Author

I am so sorry because asking you so basic things. But I have done first two steps. I downloaded cefbinary from https://github.com/cefsharp/cef-binary changed build.ps1 as you told in step 2. but I am not getting anything about step 3. I mean how can i download and build files for vs2010. I am so sorry.

@jornh
Copy link
Contributor

jornh commented Feb 14, 2015

No problem! Both writing and understanding stuff like this just via short text descriptions is hard. But I'm sure we'll succeed in the end 😄 Now it's me who is confused about what you write ...

So I'm not sure how far you got? Did you run build.ps1 and now have your own .nupkg files, including cef.sdk - but now don't know how to use it to build CefSharp - or did building cef.sdk fail?

If build worked and you're stuck with step 3. then googling for "NuGet local package" should give https://docs.nuget.org/Create/Hosting-Your-Own-NuGet-Feeds#creating-local-feeds as one of the first hits.

@rover886
Copy link
Author

Thanks for your such a nice motivation 😄 :P. well as you said I run build.ps using power shell but I am continuously getting following error:

PS C:\Users\amoghs> E:\Downloads\cef-binary-master_V37\cef-binary-master\build.ps1
Exception calling "DownloadFile" with "2" argument(s): "The remote name could not be resolved: 'www.nuget.org'"
At E:\Downloads\cef-binary-master_V37\cef-binary-master\build.ps1:361 char:23

  •     $Client.DownloadFile <<<< ('http://nuget.org/nuget.exe', $Nuget);
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : DotNetMethodException

I have checked with connectivity, firewall as well as proxy server. it's all seems fine.

@jornh
Copy link
Contributor

jornh commented Feb 15, 2015

You're welcome. You know ... we try ... 😄

Hmm, some time since I actually have used that script. And because I already have that file I won't experience any download problem/hit that line in the code. Does downloading http://nuget.org/nuget.exe and manually placing it into your %LOCALAPPDATA%\nuget\ folder bring you past that step?

@amaitland
Copy link
Member

@rover886 Are you building a custom version of CefSharp with some modifications? Far as I'm aware the stock standard nuget packages will work just fine under VS2010 long as you have VC++ 2012 Redist installed. (I could be totally mistaken, as it has been a very long time since I tried VS2010)

@rover886
Copy link
Author

@amaitland no I am not building custom version of CefSharp. I have just downloaded CefSharp-master and wanted to run and then use in my application by adding some code, like custom schemes and etc. VC++2013, VC++2010 is installed in my machine. still do i need to install 2012 version?

@amaitland
Copy link
Member

You can use the CI Builds if you need the latest master

https://github.com/cefsharp/CefSharp#nuget-packages

Official versions require VC++ 2012, which is independent of VS 2012 and can be used with VS2010, VS2012 and VS2013.

VC++ 2012 being Visual C++ 2012.

You can use VS2013 to build a master version of your own, you just need to make sure you compile in Release mode and that VC++ 2013 is installed on your target machines.

@rover886
Copy link
Author

@amaitland i installed VC++2012 and tried to build but it's still giving me build error

error LNK1104: cannot open file 'libcef_dll_wrapper.lib
error LNK1181: cannot open input file 'libcef_dll_wrapper.lib

@jankurianski
Copy link
Member

This is a C++ build error. So it seems you are still trying to build CefSharp. Why not use NuGet?

@rover886
Copy link
Author

@jankurianski By nuget I get message as Finished configuring this solution to restore NuGet packages on build. and when I build solution i build error.

@jankurianski
Copy link
Member

So you are getting this error when building your C# solution? Could you post the full output of the build action? Debug menu > Windows > Output, then choose Show output from: Build.

@rover886
Copy link
Author

Yes I am getting error while building C# solution. Here is build output :

1>------ Build started: Project: CefSharp, Configuration: Debug x86 ------
1>Project file contains ToolsVersion="12.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="4.0".
1> Restoring NuGet packages...
1> To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
1> All packages listed in packages.config are already installed.
1> CefSharp -> E:\Downloads\CefSharp-master_V37\CefSharp-master\CefSharp\bin\x86\Debug\CefSharp.dll
2>------ Build started: Project: CefSharp.Core, Configuration: Debug Win32 ------
2> Restoring NuGet packages...
2> To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
2> All packages listed in packages.config are already installed.
2>Project file contains ToolsVersion="12.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="4.0".
2>Project file contains ToolsVersion="12.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="4.0".
2>
2> Starting pass 1
2>LINK : fatal error LNK1181: cannot open input file 'libcef_dll_wrapper.lib'
3>------ Build started: Project: CefSharp.BrowserSubprocess.Core, Configuration: Debug Win32 ------
4>------ Build started: Project: CefSharp.Example, Configuration: Debug x86 ------
4> Restoring NuGet packages...
3> Restoring NuGet packages...
3> To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
3> All packages listed in packages.config are already installed.
4> To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
4> All packages listed in packages.config are already installed.
4>Project file contains ToolsVersion="12.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="4.0".
4>Project file contains ToolsVersion="12.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="4.0".
4>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(160,9): error MSB3104: The referenced assembly "E:\Downloads\CefSharp-master_V37\CefSharp-master\CefSharp.Core\bin\Debug\CefSharp.Core.dll" was not found. If this assembly is produced by another one of your projects, please make sure to build that project before building this one.
5>------ Build started: Project: CefSharp.WinForms, Configuration: Debug x86 ------
5> Restoring NuGet packages...
3>LINK : fatal error LNK1104: cannot open file 'libcef_dll_wrapper.lib'
5> To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
5> All packages listed in packages.config are already installed.
5>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(160,9): error MSB3104: The referenced assembly "E:\Downloads\CefSharp-master_V37\CefSharp-master\CefSharp.Core\bin\Debug\CefSharp.Core.dll" was not found. If this assembly is produced by another one of your projects, please make sure to build that project before building this one.
6>------ Build started: Project: CefSharp.BrowserSubprocess, Configuration: Debug x86 ------
6> Restoring NuGet packages...
6> To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
6> All packages listed in packages.config are already installed.
6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(160,9): error MSB3104: The referenced assembly "E:\Downloads\CefSharp-master_V37\CefSharp-master\Debug\CefSharp.BrowserSubprocess.Core.dll" was not found. If this assembly is produced by another one of your projects, please make sure to build that project before building this one.
6>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(160,9): error MSB3104: The referenced assembly "E:\Downloads\CefSharp-master_V37\CefSharp-master\CefSharp.Core\bin\Debug\CefSharp.Core.dll" was not found. If this assembly is produced by another one of your projects, please make sure to build that project before building this one.
7>------ Build started: Project: CefSharp.WinForms.Example, Configuration: Debug x86 ------
7> Restoring NuGet packages...
7> To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
7> All packages listed in packages.config are already installed.
7>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(160,9): error MSB3104: The referenced assembly "E:\Downloads\CefSharp-master_V37\CefSharp-master\CefSharp.Core\bin\Debug\CefSharp.Core.dll" was not found. If this assembly is produced by another one of your projects, please make sure to build that project before building this one.
7>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(160,9): error MSB3104: The referenced assembly "E:\Downloads\CefSharp-master_V37\CefSharp-master\CefSharp.Example\bin\x86\Debug\CefSharp.Example.dll" was not found. If this assembly is produced by another one of your projects, please make sure to build that project before building this one.
7>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(160,9): error MSB3104: The referenced assembly "E:\Downloads\CefSharp-master_V37\CefSharp-master\CefSharp.WinForms\bin\x86\Debug\CefSharp.WinForms.dll" was not found. If this assembly is produced by another one of your projects, please make sure to build that project before building this one.
========== Build: 1 succeeded, 6 failed, 0 up-to-date, 0 skipped ==========

@amaitland
Copy link
Member

I'd still strongly recommend using the Nuget package. If your having this much trouble building from source then it's likely to be the simplest solution.

@jankurianski By nuget I get message as Finished configuring this solution to restore NuGet packages on build. and when I build solution i build error.

Providing the build error for that problem is likely to be far more productive. I'd highly recommend reading https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting, specially the parts about AnyCpu are a good place to start.

@rover886
Copy link
Author

Yes I also like that nuget will do all the stuff, but don't know why its' not working or where I am doing wrong.

I already read trouble shooting article and I have taken care that all projects are set to x86/win32. Hey I remember one thing, while opening solution file for the first time I changed targeting framework version to 4.0, is this the reason of getting fail or as @jornh said at #810 (comment) I need to build libcef_dll_wrapper.lib file for 2010 as from nuget only files for 2012 n 2013 are coming?

@amaitland
Copy link
Member

What is the exact error your seeing?

@rover886
Copy link
Author

error LNK1104: cannot open file 'libcef_dll_wrapper.lib
error LNK1181: cannot open input file 'libcef_dll_wrapper.lib

I have updated my last comment.

@amaitland
Copy link
Member

If your trying to build master or another branch under VS2010 then you'll need to compile cef-binary from source supporting VS2010, I don't recommend this unless there's no other choice.

If your just wishing to use CefSharp in either a WinForms or WPF application then you just need to use

https://www.nuget.org/packages/CefSharp.WinForms/
https://www.nuget.org/packages/CefSharp.Wpf

Examples of consuing the release Nuget packages can be found here at https://github.com/cefsharp/CefSharp.MinimalExample

For reference master is not version 37, it's version 39, which is in the -pre release phase and should be out shortly (it's a little behind schedule at this point in time).

@rover886
Copy link
Author

Yes!!! 😄 Finally I am successful to build master in VS2010 hushhhhh!! don't know you may be feel I am over excited but so many things I have learned nuget,cefsharp's master branch, CefSharp for winform, cefsharp-cefbinary, building libcef_dll_wrapper.lib for VS 2010 using cefbinary etc

@jornh, @amaitland, @jankurianski you guys helped me a lot by giving proper direction time to time with immediate reply. Thnaks 😄 🎁. @jornh if you permit I will like to close this issue by writing small guide which will help other user to build master in VS2010 along with building and generating 'libcef_dll_wrapper.lib' file.

😄 😄 😄

@jornh
Copy link
Contributor

jornh commented Feb 16, 2015

Great! I think we can all relate to that feeling of needing to celebrate 👍

@amaitland and @jankurianski I guess there still might be value in being able to build from source for people wanting to step into our libs to help figure out how things work. (And it's our secret weapon to convert users into forkers and suddenly committers). But I realize the need to support VS2010 may be a lot less now with the VS2013 community edition available. Apparently @rover886 was the first to try this for a while - at least as a new user needing help.

Another possibility I'm pondering is if it would make sense to add a JustBuildTheExamplesMaam.sln they are important "documentation" and it should remove the need for cef.sdk matching the local VS version. Soon we will probably see someone not being able to build with VS2015 😄

Yes @rover886 by all means do share your experiences. It gets harder over time for us in the project to see things from the angle of a newcomer to the project. Personally I'm a bit curious about the NuGet.exe download issue in #810 (comment)? I think this is a point where build.ps1 maybe is a bit over engineered.

@jornh
Copy link
Contributor

jornh commented Feb 16, 2015

Oh well, guess I spoke too soon forgot entirely that the examples are now .NET 4.5 and this not appropriate for VS2010. Guess we should just encourage people to use VS2012+ and discourage VS2010 source builds. Dooh!

@rover886
Copy link
Author

@jornh I am frustrated with download issue with nuget I don't konw it's just me who is facing this issue or what, I posted one question on other forum, also I contacted to you via nuget.

I am just thinking to post new question that is coming in my mind is about .NET version, is it really necessary to use .NET4.5 😄 hope so you will answer it 😄

@jornh
Copy link
Contributor

jornh commented Feb 17, 2015

Yes and I posted a comment to your question on http://stackoverflow.com/questions/28541343/cefsharp-winforms-nuget-download-issue so go there and look. Also pinging us on NuGet.org in addition won't do any good other than flooding our inboxes basically. Please understand CefSharp is just a spare time "hobby" for us.

.NET 4.5 only recently was added as a requirement to only the CefSharp.*.Example projects as witnessed by GitHub history fc65192. And only after a lengthy open debate in #381. All of the binary NuGets CefSharp.<something> we plan to keep on 4.0 for the foreseeable future. If you look in any other .csproj file including those in the CefSharp.MinimalExample repo you will see that.

@amaitland
Copy link
Member

@jornh I am frustrated with download issue with nuget I don't konw it's just me who is facing this issue or what, I posted one question on other forum, also I contacted to you via nuget.

Make sure you have the latest Nuget package installed into VS2010. Otherwise you can download Nuget and use the commend line to restore. I don't beleive this issue has anything to do with CefSharp.

NuGet 2.8.3 Released
NuGet 2.8.3 was released on November 5th. For Visual Studio 2010, Visual Studio 2012 and Visual Studio 2013, upgrade now using the Visual Studio Extension Manager.

Make sure you have 2.8.3 installed

I am just thinking to post new question that is coming in my mind is about .NET version, is it really necessary to use .NET4.5 😄 hope so you will answer it 😄

As .Net 4.5 is supported on every current version of Windows, I don't see this being a problem personally. Specially as it's only the example projects that have that dependency.

@amaitland
Copy link
Member

Closing due to lack of feedback.

Please note that I've also changed the Nuget Restore method as per http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html

It should be more reliable for our managed packages.

@tafia
Copy link

tafia commented Aug 31, 2015

Trying to reopen the issue ...
We'd like to use CefSharp.WPF for an internal tool in our company (200+ users). Unfortunately VC++ 2012 is not installed per default (only VC++ 2010) on user systems.
As asking for all users to contact the support team to have VC++ 2012 is not a solution, is there a way we can build against VC++ 2010 only?

@rover886
Copy link
Author

@tafia you can manually keep VC++ 2012 files in your application folder (files must be parallel to cefSharp DLLs).

Following files are needed:

msvcp120.dll
msvcr120.dll
vccorlib120.dll

I achieved this by adding all above files as module in setup and deployment project, so there is no need to install VC++ 2012 per machine. I hope this will solve your problem.

@amaitland
Copy link
Member

@rover886 Excellent suggestion 👍

@tafia
Copy link

tafia commented Aug 31, 2015

@rover886 thanks!
Let me try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants