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

Error in compiling CppSharp on Linux #625

Closed
nubby109 opened this issue Feb 26, 2016 · 2 comments
Closed

Error in compiling CppSharp on Linux #625

nubby109 opened this issue Feb 26, 2016 · 2 comments

Comments

@nubby109
Copy link

I am using ubuntu 14.04 . I am new to open source community. I am trying to compile CppSharp but i am getting the error'/usr/include/wchar.h(39,11): fatal: 'stdarg.h' file not found CppSharp has encountered an error while parsing code.' again and again. Could someone please tell me its a error from my side or some bug.
This is what happens in the terminal

anubhav@anubhav:~/gitfolder/CppSharp/build$ ./premake5-linux-64 gmake
Using debug LLVM build: /home/anubhav/gitfolder/CppSharp/build/scripts/llvm-f79c5c-linux-Debug
Using release LLVM build: /home/anubhav/gitfolder/CppSharp/build/scripts/llvm-f79c5c-linux-Release
Building configurations...
Running action 'gmake'...
Done (492ms).
anubhav@anubhav:~/gitfolder/CppSharp/build$ make -C gmake config=release_x64
make: Entering directory `/home/anubhav/gitfolder/CppSharp/build/gmake'
==== Building CppSharp.AST (release_x64) ====
make[1]: Nothing to be done for `all'.
==== Building CppSharp.Runtime (release_x64) ====
make[1]: Nothing to be done for `all'.
==== Building CppSharp.CppParser (release_x64) ====
==== Building CppSharp.Parser.CSharp (release_x64) ====
make[1]: Nothing to be done for `all'.
==== Building CppSharp (release_x64) ====
make[1]: Nothing to be done for `all'.
==== Building CppSharp.Generator (release_x64) ====
make[1]: Nothing to be done for `all'.
==== Building CppSharp.Generator.Tests (release_x64) ====
make[1]: Nothing to be done for `all'.
==== Building StandardLib.Native (release_x64) ====
==== Building StandardLib.Gen (release_x64) ====
make[1]: Nothing to be done for `all'.
==== Building NamespacesBase.Native (release_x64) ====
==== Building NamespacesBase.Gen (release_x64) ====
make[1]: Nothing to be done for `all'.
==== Building NamespacesDerived.Native (release_x64) ====
==== Building NamespacesDerived.Gen (release_x64) ====
make[1]: Nothing to be done for `all'.
==== Building NamespacesBase.CSharp (release_x64) ====
Running prebuild commands
mono --debug "../lib/Release_x64/NamespacesBase.Gen.exe"

Generating bindings for NamespacesBase (CSharp)
Looking for tests in: /home/anubhav/gitfolder/CppSharp/tests/NamespacesBase
Parsed 'NamespacesBase.h'
Generated 'NamespacesBase.cs'
==== Building NamespacesDerived.CSharp (release_x64) ====
Running prebuild commands
mono --debug "../lib/Release_x64/NamespacesDerived.Gen.exe"

Generating bindings for NamespacesBase (CSharp)
Looking for tests in: /home/anubhav/gitfolder/CppSharp/tests/NamespacesBase
Parsed 'NamespacesBase.h'
Generated 'NamespacesBase.cs'

Generating bindings for NamespacesDerived (CSharp)
Looking for tests in: /home/anubhav/gitfolder/CppSharp/tests/NamespacesDerived
Parsed 'NamespacesDerived.h'
Generated 'NamespacesDerived.cs'
==== Building NamespacesDerived.Tests.CSharp (release_x64) ====
==== Building CLI.Native (release_x64) ====
==== Building CLI.Gen (release_x64) ====
make[1]: Nothing to be done for `all'.
==== Building Common.Native (release_x64) ====
==== Building Common.Gen (release_x64) ====
make[1]: Nothing to be done for `all'.
==== Building Common.CSharp (release_x64) ====
Running prebuild commands
mono --debug "../lib/Release_x64/Common.Gen.exe"

Generating bindings for Common (CLI)
Looking for tests in: /home/anubhav/gitfolder/CppSharp/tests/Common
Parsed 'AnotherUnit.h'
Error parsing 'Common.h'
/usr/include/wchar.h(39,11): fatal: 'stdarg.h' file not found
CppSharp has encountered an error while parsing code.

Generating bindings for Common (CSharp)
Looking for tests in: /home/anubhav/gitfolder/CppSharp/tests/Common
Parsed 'AnotherUnit.h'
Error parsing 'Common.h'
/usr/include/wchar.h(39,11): fatal: 'stdarg.h' file not found
CppSharp has encountered an error while parsing code.
make[1]: *** No rule to make target `../gen/Common/AnotherUnit.cs', needed by `../lib/Release_x64/Common.CSharp.dll'.  Stop.
make: *** [Common.CSharp] Error 2
make: Leaving directory `/home/anubhav/gitfolder/CppSharp/build/gmake'
@tritao
Copy link
Collaborator

tritao commented Feb 26, 2016

This is a bug in our pre-built CI packages, I will take a look at properly fixing later.

For now, you can look at the workaround we have put into place here:

if (Environment.GetEnvironmentVariable("TRAVIS_OS_NAME") == "linux")

Comment the if so its not just restricted to Travis CI, and make sure you edit the include path to match the one in your system and it should work.

            //if (Environment.GetEnvironmentVariable("TRAVIS_OS_NAME") == "linux")
                options.addSystemIncludeDirs("/usr/lib/gcc/x86_64-linux-gnu/(your_gcc_version)/include");

@nubby109
Copy link
Author

it worked

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

No branches or pull requests

2 participants