Code Monkey home page Code Monkey logo

Comments (7)

tritao avatar tritao commented on July 17, 2024

Can you try to enable Options.Verbose and paste the output under both here?

It should output header search paths for each file it tries to parse.

from cppsharp.

gpetrou avatar gpetrou commented on July 17, 2024

Yes, sure. Here it is. Actually now that I see this is it supposed to show like this twice? I think with the CppSharp_VS2012_423 it only shows once the
ignoring nonexistent directory ".\lib\clang\3.5\include" etc

Parsing libraries...
Indexing library symbols...
Parsing code...
ignoring nonexistent directory ".\lib\clang\3.5\include"
#include "..." search starts here:
#include <...> search starts here:
PATH_TO_3RDPARTY_DIR
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include
C:\Program Files (x86)\Windows Kits\8.0\include
End of search list.
Error parsing 'PATH_TO_3RDPARTY_DIR\PARTY_HEADER.h'
PATH_TO_3RDPARTY_DIR\PARTY_HEADER.h(156,68): warning: invalid suffix on literal; C++11 requires a space
between literal and identifier
PATH_TO_3RDPARTY_DIR\PARTY_HEADER.h(1806,10): fatal: 'windows.h' file not found
ignoring nonexistent directory ".\lib\clang\3.5\include"
#include "..." search starts here:
#include <...> search starts here:
PATH_TO_3RDPARTY_DIR
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include
C:\Program Files (x86)\Windows Kits\8.0\include
End of search list.
Processing code...
Pass 'CppSharp.Passes.CleanUnitPass'
Pass 'CppSharp.Passes.SortDeclarationsPass'
Pass 'CppSharp.Passes.ResolveIncompleteDeclsPass'
Pass 'CppSharp.Passes.CheckIgnoredDeclsPass'
Pass 'CppSharp.Passes.GenerateInlinesCodePass'
Pass 'CppSharp.Passes.FindSymbolsPass'
Pass 'CppSharp.Passes.CheckStaticClass'
Pass 'CppSharp.Passes.MoveOperatorToClassPass'
Pass 'CppSharp.Passes.MoveFunctionToClassPass'
Pass 'CppSharp.Passes.CheckAmbiguousFunctions'
Pass 'CppSharp.Passes.CheckOperatorsOverloadsPass'
Pass 'CppSharp.Passes.CheckVirtualOverrideReturnCovariance'
Pass 'CppSharp.Passes.CheckAbiParameters'
Pass 'CppSharp.Passes.FieldToPropertyPass'
Pass 'CppSharp.Passes.CleanInvalidDeclNamesPass'
Pass 'CppSharp.Passes.CheckIgnoredDeclsPass'
Pass 'CppSharp.Passes.CheckFlagEnumsPass'
Pass 'CppSharp.Passes.CheckDuplicatedNamesPass'
Generating code...

from cppsharp.

tritao avatar tritao commented on July 17, 2024

Does the latest version find the same include search paths as CppSharp_VS2012_423?

Since you only seem to have provided the latest version output I cannot compare them myself.

Anyway, the Windows include path seems to be in the paths found by the compiler, so I'm not sure what causes the failure here. Can you check that the path exists and has "windows.h" inside?

from cppsharp.

gpetrou avatar gpetrou commented on July 17, 2024

Here is the old one and the paths are different:

Parsing libraries...
Indexing library symbols...
Parsing code...
ignoring nonexistent directory ".\lib\clang\3.4\include"
#include "..." search starts here:
#include <...> search starts here:
PATH_TO_3RDPARTY_DIR
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include
End of search list.
Unhandled type class 'Attributed'
Unhandled type class 'Attributed'
Parsed 'PATH_TO_3RDPARTY_DIR\PARTY_HEADER.h'
PATH_TO_3RDPARTY_DIR\PARTY_HEADER.h(156,68): warning: invalid suffix on literal; C++11 requires a space
between literal and identifier
Processing code...
Invalid operator overload Test::Equal
Generating code...
Generated 'Test.cs'

Are you talking about C:\Program Files (x86)\Windows Kits\8.0\include ?
I don't think this has windows.h file in it. It has three folders (shared, um, WinRT)
If I add manually C:\Program Files (x86)\Windows Kits\8.0\include\um that has windows.h in it, the application takes forever to run and crashes with a NotSupportedException in VisitArrayType in CppTypePrinter

from cppsharp.

tritao avatar tritao commented on July 17, 2024

Do you have both VS 2012 and VS 2013 (or a recent Windows SDK) installed?

Old versions of CppSharp ignored versions newer than 2013 if an older version of VS was found since Clang had some problems parsing new Windows SDK versions. We changed that not too long ago to choose 2013 headers if available.

There's a workaround which you can try using. In the parser options structure, there's public int ToolSetToUse; which takes the MS toolset version you want to target as an integer. IIRC for VS2012 you can set it to 1700 which will force it to choose VS2012 headers.

from cppsharp.

gpetrou avatar gpetrou commented on July 17, 2024

I only have VS 2012.
I set the options.ToolSetToUse = 1700; but did not help. I get the same include paths.
Actually, I see that you already have that in Parser.cpp

if (Opts->MicrosoftMode)
{
    LangOpts.MSCVersion = Opts->ToolSetToUse;
    if (!LangOpts.MSCVersion) LangOpts.MSCVersion = 1700;
}

ToolSetToUse appears to be 0 by default

from cppsharp.

tritao avatar tritao commented on July 17, 2024

Are you still facing this problem?

from cppsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.