LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compiler setting in Eclipse for Linux RT

Hi All

 

I have 2 PC, the one is Windows, the another is NI Linux RT on PXI system

I want to create compilation environment using Eclipse 2017 on Windows

so i followed NI tutorial: Getting Started with C/C++ Development Tools for NI Linux Real-Time, Eclipse Edition

and i get the following errors:

 

cannot find crt1.o: No such file or directory
cannot find crti.o: No such file or directory
cannot find crtbegin.o: No such file or directory
cannot find /lib/libc.so.6
cannot find /usr/lib/libc_nonshared.a
cannot find /lib/ld-linux-x86-64.so.2

 

I can find these files and i set path in "include or library path" in Eclipse,

but still not workout.

any ideas?

 

2_Console.jpg

3_Cross GCC Compiler.JPG

4_Includes.JPG

5_Cross GCC Linker.jpg

6_Libraries.JPG

    

0 Kudos
Message 1 of 8
(3,241 Views)

Crosscompilation in Eclipse/GCC should not need to add the target include and library paths  to your project. Instead you need to configure the Cross Settings->Prefix correctly. The Prefix is basically the name of your cross compilation target and there should be an according directory on your harddisk, most probably x86_64-nilrt-linux- from the paths you show. (And yes the hyphen at the end of that prefix name is important!)

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 8
(3,203 Views)

Hi rolfk,

 

Thanks for your reply.

My Cross Complier settings which according NI tutorial,

Prefix:x86_64-nilrt-linux-

Path:c:/build/17.0/x64/sysroots/i686-nilrtsdk-mingw32/usr/bin/x86_64-nilrt-linux

but it's not work, console still show error that ld.exe cannot find library

like this

------------------------------------------------------------------------------------------------------------------------------

c:/build/17.0/x64/sysroots/i686-nilrtsdk-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc

   /x86_64-nilrt-linux/4.9.2/ld.exe: cannot find crt1.o: No such file or directory
c:/build/17.0/x64/sysroots/i686-nilrtsdk-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc

   /x86_64-nilrt-linux/4.9.2/ld.exe: cannot find crti.o: No such file or directory
c:/build/17.0/x64/sysroots/i686-nilrtsdk-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc

   /x86_64-nilrt-linux/4.9.2/ld.exe: cannot find crtbegin.o: No such file or directory
c:/build/17.0/x64/sysroots/i686-nilrtsdk-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc

    /x86_64-nilrt-linux/4.9.2/ld.exe: cannot find /lib/libc.so.6
c:/build/17.0/x64/sysroots/i686-nilrtsdk-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc

   /x86_64-nilrt-linux/4.9.2/ld.exe: cannot find /usr/lib/libc_nonshared.a
c:/build/17.0/x64/sysroots/i686-nilrtsdk-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc

   /x86_64-nilrt-linux/4.9.2/ld.exe: cannot find /lib/ld-linux-x86-64.so.2

------------------------------------------------------------------------------------------------------------------------------

 

i can't figure out...

 

 

0 Kudos
Message 3 of 8
(3,170 Views)

Any luck on this? I'm seeing a similar problem.

0 Kudos
Message 4 of 8
(2,526 Views)

A Google search came up with an obscure linker flag (-lm) that fixed my problem what added.  Good luck.

Message 5 of 8
(2,524 Views)

@ndo wrote:

A Google search came up with an obscure linker flag (-lm) that fixed my problem what added.  Good luck.


That’s not obscure at all. The -l flag tells the gcc linker to search for a library or object file with the name “lib<expression following the l flag>.a/obj”

 

libm.a is the standard library containing mathematic functions such as fmax, fmin, fmod, sqrt, etc. If you use any standard C library function in your code you must make sure to add the according linker library flag to include the necessary library to your make command.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 6 of 8
(2,518 Views)

LOL! Yes.  I came to realize that.  I was including libc expecting the math.h functions to be in there for some reason.

 

--ndo

0 Kudos
Message 7 of 8
(2,515 Views)

@ndo wrote:

LOL! Yes.  I came to realize that.  I was including libc expecting the math.h functions to be in there for some reason.


Nobody ever said that the whole standard C library with its header mess and separation into different libraries was particularly well designed. 😁

 

Instead it is, over the course of 40 years, an organically grown mess that can't be untangled at this time anymore without sacrificing backwards compatibility.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 8 of 8
(2,504 Views)