make fails to compile
autre opened this issue · 4 comments
Hi,
I'm using gyp's revision r1139.
So after installing gyp and git cloning finch:
~$ uname -a
Linux eigen 3.1.4-1-ARCH #1 SMP PREEMPT Tue Nov 29 08:55:45 CET 2011 x86_64 Pentium(R) Dual-Core CPU E5300 @ 2.60GHz GenuineIntel GNU/Linux
~$ g++ --version
g++ (GCC) 4.6.2 20111125 (prerelease)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~$ gyp --depth=1
~$ cd 1
~$ make
CXX(target) out/Debug/obj.target/finch/../src/Base/FinchString.o
../src/Base/FinchString.cpp: In member function ‘int Finch::String::IndexOf(const Finch::String&) const’:
../src/Base/FinchString.cpp:131:59: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
make: *** [out/Debug/obj.target/finch/../src/Base/FinchString.o] Error 1
~$ vim ../src/Base/FinchString.cpp
~$ git diff
diff --git i/src/Base/FinchString.cpp w/src/Base/FinchString.cpp
index 26b37bb..8c95926 100644
--- i/src/Base/FinchString.cpp
+++ w/src/Base/FinchString.cpp
@@ -128,7 +128,7 @@ namespace Finch
{
if (mData.IsNull()) return -1;
- char* found = strstr(mData->chars, other.CString());
+ const char* found = strstr(mData->chars, other.CString());
if (found == NULL) return -1;
return static_cast<int>(found - mData->chars);
~$ make
CXX(target) out/Debug/obj.target/finch/../src/Base/FinchString.o
CXX(target) out/Debug/obj.target/finch/../src/Base/StringTable.o
CXX(target) out/Debug/obj.target/finch/../src/Compiler/CodeBlock.o
In file included from ../src/Compiler/CodeBlock.cpp:1:0:
../src/Compiler/CodeBlock.h:8:20: fatal error: Object.h: No such file or directory
compilation terminated.
make: *** [out/Debug/obj.target/finch/../src/Compiler/CodeBlock.o] Error 1
I can provide you with the generated *.mk files.
I guess I'm probably misusing gyp.
Vassilis
No, I think this is my fault. I'm still learning my way around gyp, and I don't have the right warning levels set for XCode (which is what I use). So there's some stuff the Linux makefile will warn on that I don't see. Should be fixed now.
Thank you for looking into this. It still doesn't compile on my linux machine. Now I get:
~$ # git pull origin, etc
~$ make
CXX(target) out/Debug/obj.target/finch/../src/Base/FinchString.o
CXX(target) out/Debug/obj.target/finch/../src/Base/StringTable.o
CXX(target) out/Debug/obj.target/finch/../src/Compiler/CodeBlock.o
In file included from ../src/Compiler/CodeBlock.cpp:1:0:
../src/Compiler/CodeBlock.h:8:20: fatal error: Object.h: No such file or directory
compilation terminated.
make: *** [out/Debug/obj.target/finch/../src/Compiler/CodeBlock.o] Error 1
Seems the compilation command is missing the proper include (-I) directives.
Hi,
I also tried building https://github.com/springmeyer/hello-gyp, with no luck. So I guess the problem is not with your gyp.
I finally made it build with some manual scripting. Just a heads up: I removed the included "String.h" from FinchParser.h, and added #include in src/Syntax/Lexer.cpp and src/main.cpp (after g++ complained for undeclared symbols strncpy and strncat).
Thanks.
Those sound like valid bugs. "String.h" is definitely a bug. I renamed that file to FinchString.h a while back (specifically to avoid colliding with some system-provided String.h) and I must have missed one place where it was being used.
It you pull down the latest, it should have this fixed in it. Thanks!