Skip to content

windows VS project corrupt #9

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

Closed
murphy85 opened this issue Feb 9, 2016 · 9 comments
Closed

windows VS project corrupt #9

murphy85 opened this issue Feb 9, 2016 · 9 comments

Comments

@murphy85
Copy link

murphy85 commented Feb 9, 2016

I'm having trouble to use the plugin for platform windows with visual studio 2015.

The VS workspace file cordova-sqlite-ext/src/windows/SQLite3-Win-RT/SQLite3/SQLite3.sln targets 3 subprojects:

Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite3.Shared", "SQLite3\SQLite3.Shared\SQLite3.Shared.vcxitems", "{DB84AE51-4B93-44F5-BE22-1EAE1833ECEC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite3.Windows", "SQLite3\SQLite3.Windows\SQLite3.Windows.vcxproj", "{D1848FEE-6A8E-4EF1-8BFB-8652E5A9CD4A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite3.WindowsPhone", "SQLite3\SQLite3.WindowsPhone\SQLite3.WindowsPhone.vcxproj", "{6435C2E4-4FD2-405A-9EE2-5312AE852782}"
EndProject

BUT there are only 2 folders for Windows and WindowsPhone. The shared file is in same directory and not in subfolder SQLite3.Shared. Additionally to that, the workspace file is already in folder SQLite3, so the first part of the path "SQLite3" should not be there.

Am I right or what am I doing wrong?

(If you are changing the reference, then pay attention to the subprojects Windows and WindowsPhone. They are referencing the shared file too)

After I changed the references, the plugin starts building but fails some steps later anyways.
fatal error C1083: File (Include) could not be opened: "vccorlib.h"
I started copying about 30-40 files from Windows Kit and Visual Studio / libs folder to the plugin workspace folder to solve one error after another. Am I missing some SDKs, Windows Kits, library configurations, ...?!

@brody4hire
Copy link
Owner

  1. You are right about the incorrect folder reference. (I have been using Visual Studio Express 2013 and it has not complained so far.)
  2. Please specify which file actually includes "vccorlib.h" (I do not see this included by any of the sources in this project).

@murphy85
Copy link
Author

murphy85 commented Feb 9, 2016

  1. Thanks.
  2. I think the files are referenced indirectly by SQLite3.sln > SQLite3.WindowsPhone/SQLite3.WindowsPhone.vcxproj > pch.h > Collections.h
    The console only tells me pch.cpp needs bccorlib.h, but there is no include for that in pch.cpp. Maybe I'm just missing some AdditionalIncludeDirectories in my Visual Studio config. I will check this. Most of the missing files are included in Visual Studio 14.0/VC/include.

D:\DEV\git\mobile\Layover\cordova>cordova build windows
Building project: D:\DEV\git\mobile\Layover\cordova\platforms\windows\CordovaApp
.Windows.jsproj
Configuration : debug
Platform : anycpu
pch.cpp
d:\dev\git\mobile\layover\cordova\plugins\cordova-sqlite-ext\src\windows\sqlite
3-win-rt\sqlite3\pch.cpp : fatal error C1083: Datei (Include) kann nicht geöffn
et werden: "vccorlib.h": No such file or directory [D:\DEV\git\mobile\Layover\c
ordova\plugins\cordova-sqlite-ext\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.Wi
ndows\SQLite3.Windows.vcxproj]
ERROR building one of the platforms: Error: C:\Program Files (x86)\MSBuild\14.0
bin\msbuild.exe: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with
exit code 1

@brody4hire
Copy link
Owner

Can you specify which edition of Visual Studio 2015 you are using, such as Express/Community/Professional/Enterprise?

I do not expect it to work if you try building it with with the platform set to "anycpu".

I suspect you are building for the Windows 10 target, which is currently not supported. I will investigate this when I get a chance. Until then only the Windows 8.1 and Windows Phone 8.1 targets are supported.

Here is what I have discovered so far:

The following page documents that you can use a "/ZW" or "/FI" option to force the inclusion of "vccorlib.h": https://msdn.microsoft.com/en-us/library/hh700130.aspx

The following page documents that the "/ZW" option forces Visual Studio to build Windows 8.x apps: https://msdn.microsoft.com/en-us/library/hh561383.aspx

Please let me know if this helps and if you find a way to build for Windows 10.

@murphy85
Copy link
Author

murphy85 commented Feb 9, 2016

Microsoft Visual Studio Community 2015
Version 14.0.24720.00 Update 1

I already reinstalled VS. I tried building with cordova cli AND with visual internal build. Same results.

Thank you for the links, I will check this!!

After I added two paths to the Additional Include Directories of the project, there are no more missing files (but other exceptions ;-) )
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Clang 3.7\include
OR
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\ucrt;

So there are some missing lib folders in the projects configuration OR in my VS config.

EDIT:
If I'm using the VS 12 includes, it's working even more :-D
(I've added C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include to additional include directories)

That's not the right solution, but atm I'm trying to figure out what's wrong.

@brody4hire
Copy link
Owner

A quick search on ucrt reveals the following:

I suspect you just have to add the UCRT libs to build it for Windows 10. I will try this when I get a chance, maybe within the next couple of weeks. I suggest you use the MS build properties as described in the vcblog link instead of hardcoding when possible.

@murphy85
Copy link
Author

murphy85 commented Feb 9, 2016

At the moment I'm still trying to build WIndows 8 and Windows 8.1 ;-)

I now added "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib;" to the VC++/Libraries entry and it's BUILDING :-D

So the main problem seems to be, that the project is not compatible with the new VisualStudio (libraries). Changing the references to the old VS 12 libs and includes is working for Win 8 and Win 8.1 targets. I think that's enough for me.

Thank you for your fast support, even on basic VS questions!!

@brody4hire
Copy link
Owner

Happy to hear. I will document this when I get a chance.

@brody4hire
Copy link
Owner

FYI This project now supports Windows 10. Windows 8.1/Windows Phone 8.1 is dropped for now, supported in Cordova-sqlite-legacy.

@brody4hire
Copy link
Owner

@aryniec please see the answer in storesafe/cordova-sqlite-storage-help#19.

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

2 participants