kekyo / IL2C

IL2C - A translator for ECMA-335 CIL/MSIL to C language.
Apache License 2.0
401 stars 36 forks source link

Linux build-runtime compilation error #88

Closed 0x0015 closed 3 years ago

0x0015 commented 3 years ago

OS: Manjaro Linux x86_64

NOTE: For some reason I don't have the command 'arch' installed so I replaced it with 'uname -m' in build-runtime.sh. Doesn't seem to be related to the error, but I thought I should mention it anyway.

$ sh build-runtime.sh

///////////////////////////////////////////////
// Build IL2C.Runtime (gcc-linux-$Platform-$Configuration)

-- The C compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/Desktop/IL2C/IL2C.Runtime/build.cmake/gcc-linux-x86_64-
[1/62] Building C object src/CMakeFiles/il2c-gcc-linux-x86_64-.dir/Platform/no-threading.c.obj
FAILED: src/CMakeFiles/il2c-gcc-linux-x86_64-.dir/Platform/no-threading.c.obj 
/usr/bin/cc -D_LIB -I../../cmake/../include -I../../src -I../../src/../include -pipe -g2 -Wall -Werror -Wstrict-prototypes -Wno-unused -fdata-sections -ffunction-sections -Wl,--gc-sections -O0 -D_DEBUG -pipe -g2 -Wall -Werror -Wstrict-prototypes -Wno-unused -fdata-sections -ffunction-sections -Wl,--gc-sections -O0 -D_DEBUG -MD -MT src/CMakeFiles/il2c-gcc-linux-x86_64-.dir/Platform/no-threading.c.obj -MF src/CMakeFiles/il2c-gcc-linux-x86_64-.dir/Platform/no-threading.c.obj.d -o src/CMakeFiles/il2c-gcc-linux-x86_64-.dir/Platform/no-threading.c.obj -c ../../src/Platform/no-threading.c
../../src/Platform/no-threading.c:1:10: fatal error: il2c_private.H: No such file or directory
    1 | #include <il2c_private.H>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
[14/62] Building C object src/CMakeFiles/il2c-gcc-linux-x86_64-.dir/Platform/strings.c.obj
ninja: build stopped: subcommand failed.
kekyo commented 3 years ago

@0x0015 Thanks your reports, I feel it's a bit mistake indicated line '.H' extension :) Could you fix with extension '.h' and try to build?

0x0015 commented 3 years ago

Okay, replacing i2lc_private.H to .h it builds now. So I have the IL2C folder in the bin of my c# project(just the getting started sample), so how do I want to build it? The getting started only explains v++, with visual studio.

kekyo commented 3 years ago

Thanks your suggestion, I applied it.

And yes, the getting started contains only VC++, and I feel it's very bad situation too...

(I'm switching linux on mainly my development environment from windows between few days. I was an old unix man in lives Sun OS generation :)

Would you try to build manually directly uses with gcc? The runtime builder made libil2c-gcc-linux-x86_64-Debug.a in IL2C.Runtime/lib, so we have to do:

If it can do, we can use cmake scripts at IL2C.Runtime/cmake next, but it's not tested well on linux environment.

kekyo commented 3 years ago

@0x0015 I fixed cmake scripts for Calculator sample code inside samples directory. Could you try to it?

(execute build.sh and you can find Calculator executable into build/Debug directory.)

0x0015 commented 3 years ago

I cloned pulled the devel branch, ran bulid-runtime.sh and build.sh in the calculator demo, and it worked! Thanks for the help.