mono / CppSharp

Tools and libraries to glue C/C++ APIs to high-level languages
MIT License
3.14k stars 518 forks source link

OS-X Build failure : error CS0118: `CppSharp.Parser.ParserOptions.ASTContext' is a `property' but a `type' was expected #494

Closed sushihangover closed 9 years ago

sushihangover commented 9 years ago

OS-X 10.10.3 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Mono JIT compiler version 4.0.2 ((detached/198235d Tue Jun 9 14:24:40 EDT 2015) LLVM Git mirror revision 0e8abfa6ed986c892ec723236e32e78fd9c47b88. Clang Git mirror revision 3457cd5516ac741fa106623d9578f5ac88593f4d. CppSharp : HEAD version (commit 2467f06240854fb2213ce8516c1ec57703083afd)

cd build ./premake5-osx gmake cd gmake config=release_x32 make

Results in

Full output in a gist

../../../src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs(9764,37): (Location of the symbol related to previous warning)
../../../src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs(498,21): error CS0118: `CppSharp.Parser.ParserOptions.ASTContext' is a `property' but a `type' was expected
../../../src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs(499,78): error CS0841: A local variable `__result0' cannot be used before it is declared
../../../src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs(501,38): error CS0118: `CppSharp.Parser.ParserOptions.ASTContext' is a `property' but a `type' was expected
ddobrev commented 9 years ago

@sushihangover I know about this, it's a regression because of a new feature I had to add. It is fortunately easy to work around. Just go to the file with the error and either fully qualify or add usings for the missing types.

sushihangover commented 9 years ago

@ddobrev Thanks for the quick reply.

After generating a solution/projects and actually looking at the code, I'm assuming this is a bootstrap issue as:

CppSharp.AST
CppSharp.Parser.CSharp (ARCH dependent)

are generated by CppSharp and you are not checking those files in on each iteration.

I fixed that issue in the gen code for i386 and x64 on OS-X, then a few more issues for x64, and, and.... ;-)

There too many other issues with incorrect dlls refs, premake5 alpha issues, etc.. I don't mind debugging code, expect it in an active/bleeding edge project that has zero release branches/tags in 5 years(?), but debugging install/build issues to get to that point is not getting my original project on track.

Sorry, just frustrated.., this is a really cool project (and REALLY need full QT5 interfaces for some other pending work) and I love llvm and how your using it, but I'll have to go back to swig for this project in order to knock it out. Thanks again.

ddobrev commented 9 years ago

I am not sure I understand. I assume you've fixed the generated code as I suggested and then you got those other errors. I am afraid I cannot offer help about them. CppSharp used to have a build server for both Windows and OS X but it broke because of some configuration problem about eight months ago. I've been asking @tritao to fix it to no avail so far. There's some chance those errors are a result of stacked errors we did not notice on time because of the lack of a build server.

ddobrev commented 9 years ago

I understand your frustration an I would in fact encourage you to look for other solutions if your work is imminent. I am afraid my own QtSharp - a CppSharp-based generator for Qt bindings - still has a way to go before becoming useful. Please let me know if you have success with SWIG. I looked it myself before starting Qt# but it seemed too time consuming to create proper wrappers.

tritao commented 9 years ago

One simple workaround is to just reset to an earlier Git revision for now until I can fix it. I'm sorry you're having those other issues compiling CppSharp, it would be good if you could report them so that we can improve our documentation.

sushihangover commented 9 years ago

@tritao thanks for the reply. I did try multiple prior versions, I even scripted a quick script to loop a checkout on HEAD~1, re-gen/make and it had different build failure points on everyone that was tried, I Ctrl-C after 5 of 6 tries.

@ddobrev I have a real hate relation with no love at all with SWIG as it takes forever to create decent interface files for it to digest and just feeding it header files always fails for one reason or another. There are times that just hand typing the wrappers are way easier and faster. But it does work. :-/

As soon as I am freed up, I'll try to write up the issues, or actually just post some pull requests as I have a couple of more wrapper projects coming up and would like to use CppSharp in that pipeline. Thanks all