I decided to delete the built stuff and try again from scratch. The steps are the same as described above (using ReleaseWithDebInfo/win32 config for LLVM and release/x86 config for CppSharp). One thing that I did notice is when I loaded the generated CppSharp.sln for the first time, VS2013 wanted to upgrade a bunch of the projects:
Upgrading project 'Basic.CLI'...
Configuration 'Debug|Win32': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Debug|x64': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Release|Win32': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Release|x64': no upgrade required. Platform Toolset is 'v120'.
TargetFrameworkVersion = v4.5 (was v4.0)
Upgrading project 'CLITemp.CLI'...
Configuration 'Debug|Win32': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Debug|x64': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Release|Win32': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Release|x64': no upgrade required. Platform Toolset is 'v120'.
TargetFrameworkVersion = v4.5 (was v4.0)
Upgrading project 'STL.CLI'...
Configuration 'Debug|Win32': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Debug|x64': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Release|Win32': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Release|x64': no upgrade required. Platform Toolset is 'v120'.
TargetFrameworkVersion = v4.5 (was v4.0)
Upgrading project 'CppSharp.Parser.CLI'...
Configuration 'Debug|Win32': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Debug|x64': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Release|Win32': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Release|x64': no upgrade required. Platform Toolset is 'v120'.
TargetFrameworkVersion = v4.5 (was v4.0)
Upgrading project 'CppSharp.Parser'...
Configuration 'Debug|Win32': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Debug|x64': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Release|Win32': no upgrade required. Platform Toolset is 'v120'.
Configuration 'Release|x64': no upgrade required. Platform Toolset is 'v120'.
TargetFrameworkVersion = v4.5 (was v4.0)
Retargeting End: 5 completed, 0 failed, 0 skipped
I tried option 4 again as per your suggestion (i.e. Visual Studio 2013 - without the C++ Parser) and when I compile, I get the following output:
(Trimmed for readability)
4><CppSharp>\tests\stl\STL.h(9): warning C4251: 'TestVectors::IntVector' : class 'std::vector<int,std::allocator<_Ty>>' needs to have dll-interface to be used by clients of struct 'TestVectors'
6> Creating library ..\lib\Release_x32\CLITemp.Native.lib and object ..\lib\Release_x32\CLITemp.Native.exp
4> with
8> Creating library ..\lib\Release_x32\CSharpTemp.Native.lib and object ..\lib\Release_x32\CSharpTemp.Native.exp
4> [
4> _Ty=int
4> ]
1><CppSharp>\src\AST\Type.cs(230,25,230,36): warning CS0109: The member 'CppSharp.AST.PointerType.IsReference' does not hide an inherited member. The new keyword is not required.
3><CppSharp>\tests\basic\basic.cpp(233): warning C4717: 'operator|' : recursive on all control paths, function will cause runtime stack overflow
10><CppSharp>\src\Parser\Parser.cpp : warning C4793: 'clang::ExternalASTSource::`vcall'{20}'' : function compiled as native :
11><CppSharp>\src\CppParser\Bindings\CSharp\AST.cs(1505,41,1505,58): warning CS0660: 'CppSharp.Parser.AST.TemplateParameter' defines operator == or operator != but does not override Object.Equals(object o)
11><CppSharp>\src\CppParser\Bindings\CSharp\AST.cs(1505,41,1505,58): warning CS0661: 'CppSharp.Parser.AST.TemplateParameter' defines operator == or operator != but does not override Object.GetHashCode()
10>Parser.obj : warning LNK4248: unresolved typeref token (01000028) for 'clang.ASTMutationListener'; image may not run
10>Parser.obj : warning LNK4248: unresolved typeref token (01000029) for 'clang.ASTDeserializationListener'; image may not run
10>Parser.obj : warning LNK4248: unresolved typeref token (01000052) for 'clang.CodeCompleteConsumer'; image may not run
13>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3274: The primary reference "<CppSharp>\build\vs2013\projects\..\lib\Release_x32\CppSharp.Parser.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
13><CppSharp>\src\Core\Parser\Parser.cs(24,35,24,47): error CS0246: The type or namespace name 'ParserResult' could not be found (are you missing a using directive or an assembly reference?)
13><CppSharp>\src\Core\Parser\Parser.cs(29,31,29,43): error CS0246: The type or namespace name 'ParserResult' could not be found (are you missing a using directive or an assembly reference?)
13><CppSharp>\src\Core\Parser\Parser.cs(46,47,46,60): error CS0246: The type or namespace name 'ParserOptions' could not be found (are you missing a using directive or an assembly reference?)
13><CppSharp>\src\Core\Parser\Parser.cs(46,16,46,32): error CS0246: The type or namespace name 'ParserTargetInfo' could not be found (are you missing a using directive or an assembly reference?)
14>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3274: The primary reference "<CppSharp>\build\vs2013\projects\..\lib\Release_x32\CppSharp.Parser.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
14>CSC : error CS0006: Metadata file '<CppSharp>\build\vs2013\lib\Release_x32\CppSharp.dll' could not be found
The actual errors seem to be these:
13><CppSharp>\src\Core\Parser\Parser.cs(24,35,24,47): error CS0246: The type or namespace name 'ParserResult' could not be found (are you missing a using directive or an assembly reference?)
13><CppSharp>\src\Core\Parser\Parser.cs(29,31,29,43): error CS0246: The type or namespace name 'ParserResult' could not be found (are you missing a using directive or an assembly reference?)
13><CppSharp>\src\Core\Parser\Parser.cs(46,47,46,60): error CS0246: The type or namespace name 'ParserOptions' could not be found (are you missing a using directive or an assembly reference?)
13><CppSharp>\src\Core\Parser\Parser.cs(46,16,46,32): error CS0246: The type or namespace name 'ParserTargetInfo' could not be found (are you missing a using directive or an assembly reference?)
However, it turns out that the conversion process of Visual Studio is the real issue. When it updated the project files, it seems to have set the target framework to 4.5. Having read in the gettingstarted that you require 4.5 Mono, I assumed that meant 4.5 .NET also. It appears that was a mistake. The fix in my case was to go through and modify the project properties for all the C# projects in CppSharp.sln to use a target framework of 4.5 instead of 4.0. This made things compile.
When I then run the SDL example again with the verbose option on, I get the following output (which does explain why it's not working since it's expecting to find SDL installed at the specified location and I don't have SDL on this machine):
Parsing libraries...
Indexing library symbols...
Parsing code...
ignoring nonexistent directory "<CppSharp>\build\examples\SDL\SDL-2.0\include"
ignoring nonexistent directory ".\lib\clang\3.5\include"
#include "..." search starts here:
#include <...> search starts here:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include
C:\Program Files (x86)\Windows Kits\8.1\\include
End of search list.
File 'SDL.h' was not found
ignoring nonexistent directory "<CppSharp>\build\examples\SDL\SDL-2.0\include"
ignoring nonexistent directory ".\lib\clang\3.5\include"
#include "..." search starts here:
#include <...> search starts here:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include
C:\Program Files (x86)\Windows Kits\8.1\\include
End of search list.
One thing I am curious about though is why it's looking for the dir "<CppSharp>\build\examples\SDL\lib\clang\3.5\include" ? Is that part of SDL normally?
Finally, I notice that in the C++ projects, it has these for additional include dirs:
..\..\..\deps\llvm\include
..\..\..\deps\llvm\tools\clang\include
..\..\..\deps\llvm\tools\clang\lib
..\..\..\deps\llvm\build\include
..\..\..\deps\llvm\build\tools\clang\include
All of those are fine and do exist except for the last one. There is no llvm\build\tools directory. Is there supposed to be?