NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues compiling C code using Cygwin and gcc 6.3 toolchain (oecore 6.0)

Hi, I am trying to use the latest toolchain for windows host (6.0 with gcc 6.3)

 

GNU C & C++ Compilers for x64 Linux (Windows host) 2018

 

with cygwin. I'm having problems compiling a simple code:

 

#include <stdio.h>

int main(void)
{
printf ("Hello from your first program!\n");
return 0;
}

 

if I use absolute unix-like path for sysroot. For example, after setting up the environment variables I issue a command like this: 

 

x86_64-nilrt-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/cygdrive/c/Users/Public/build/18.0/x64//sysroots/core2-64-nilrt-linux -O2 -pipe -o Test Test.c

 

I get this error:

 

Test.c:1:20: fatal error: stdlib.h: No such file or directory
#include <stdlib.h>
^
compilation terminated.
make: *** [MakeProgram:11: Test] Error 1

 

While if I use a relative path for sysroot and issue something like this:

 

x86_64-nilrt-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=../../../Public/build/18.0/x64/sysroots/core2-64-nilrt-linux -O2 -pipe -o Test Test.c

 

everything works fine. 

Is it an expected behavior with cygdrive virtual directory? Is there anything I can do to avoid moving all absolute paths to relative ones?

 

Thanks

Fabio M.
NI
Principal Engineer
0 Kudos
Message 1 of 1
(2,172 Views)