Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT complains of missing host gcc and g++ for a cross-compile
CDT complains of missing host gcc and g++ for a cross-compile [message #1844954] Thu, 30 September 2021 17:29 Go to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
I have a set-up without native C/C++ compilers, but with needed cross-compilers.

When creating a cross-compile project with properly set paths and prefixes to the compiler tools, the CDT complains of missing native compilers and refuses to do anything. Is this a bug?

index.php/fa/41053/0/


--

Tauno Voipio
Re: CDT complains of missing host gcc and g++ for a cross-compile [message #1844977 is a reply to message #1844954] Fri, 01 October 2021 13:19 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Could be an attempt to get the compiler built-ins.
I altered the built-ins command and got something similar.
What's in the Location and Type fields?

index.php/fa/41060/0/

I also allocated a console for it and got [slightly edited]
florb -E -P -v -dD /home/dvavra/workspaces/2021-09/Passwords/
.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.cpp 
Cannot run program "florb": Unknown reason

Error: Program "florb" not found in PATH
Re: CDT complains of missing host gcc and g++ for a cross-compile [message #1844986 is a reply to message #1844977] Fri, 01 October 2021 16:33 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Yes, it is.

I took the settings page and added the prefix to the command line and the complaints disappeared, but then the real compile commands got the prefixes in double. I cannot make the ends meet here.


--

Tauno Voipio
Re: CDT complains of missing host gcc and g++ for a cross-compile [message #1844988 is a reply to message #1844986] Fri, 01 October 2021 17:15 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Not sure what you did.
Sounds like you changed the compiler in tool settings.
If so, maybe use the non-cross compile buiilt-in provider but
change its command to <prefix>-$(COMMAND)
or if there's a variable holding the prefix: $(<prefix var>)$(COMMAND)

You can do this locally for a project.

Re: CDT complains of missing host gcc and g++ for a cross-compile [message #1844989 is a reply to message #1844988] Fri, 01 October 2021 19:33 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
I tried both. It got rid of the complaints, but destroyed compilation, as there is no arm-linux-gnueabihf-arm-linux-gnueabihf-gcc.


--

Tauno Voipio
Re: CDT complains of missing host gcc and g++ for a cross-compile [message #1844992 is a reply to message #1844989] Sat, 02 October 2021 03:25 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
I'm still confused about what you've done.
The built-ins provider uses the commands from the toolchain.
Including the path and prefix.

index.php/fa/41064/0/
For the g++ built-ins:
23:02:03 **** Running scanner discovery: CDT Cross GCC Built-in Compiler Settings ****
not-a-prefix-g++ -E -P -v -dD /home/dvavra/workspaces/2021-09/Passwords/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.cpp 
Cannot run program "not-a-prefix-g++": Unknown reason

Error: Program "not-a-prefix-g++" not found in PATH
PATH=[/home/opt/ARM/gcc-arm-none-eabi-10-2020-q4-major/bin:/home/dvavra/bin:/home/dvavra/.local/bin:/opt/perl/5.34.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin]


I would think you are getting a double prefix because you altered the
toolchain compiler commands.

Such as when I changed the cross compile settings to
index.php/fa/41065/0/
and the compiler in the toolchain:
index.php/fa/41066/0/

I get:
23:20:14 **** Running scanner discovery: CDT Cross GCC Built-in Compiler Settings ****
not-a-real-prefix-some-other-prefix-g++ -E -P -v -dD /home/dvavra/workspaces/2021-09/Passwords/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.cpp 
Cannot run program "not-a-real-prefix-some-other-prefix-g++": Unknown reason

Error: Program "not-a-real-prefix-some-other-prefix-g++" not found in PATH
PATH=[/opt/ARM/gcc-arm-none-eabi-10-2020-q4-major/bin:/home/dvavra/bin:/home/dvavra/.local/bin:/opt/perl/5.34.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin]


Re: CDT complains of missing host gcc and g++ for a cross-compile [message #1844999 is a reply to message #1844992] Sat, 02 October 2021 12:51 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Take fresh Kubuntu 20.04LTS with Raspbian toolkit in /opt/raspbian/. Note that neither gcc nor g++ are there.

index.php/fa/41071/0/

Select File -> New -> C/C++ Project, C Managed Build, name the project, select Hello World ANSI C and Cross GCC, three times Next. Set up cross compiler on the configuration screen (the toolkit is there):

index.php/fa/41072/0/

We get a fresh project with the error cross:

index.php/fa/41073/0/


--

Tauno Voipio
Re: CDT complains of missing host gcc and g++ for a cross-compile [message #1845005 is a reply to message #1844999] Sat, 02 October 2021 14:11 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
I found that the "normal" gcc built-in provider used with
the cross compile tool chain ignores the prefix and path.
You have to use the cross-compile provider.

Did you? You didn't show doing so.

Re: CDT complains of missing host gcc and g++ for a cross-compile [message #1845014 is a reply to message #1845005] Sat, 02 October 2021 15:57 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Do you mean this:
index.php/fa/41074/0/


--

Tauno Voipio
Re: CDT complains of missing host gcc and g++ for a cross-compile [message #1845015 is a reply to message #1845014] Sat, 02 October 2021 20:54 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Yes
Previous Topic:Problems with keyboard after Hello World Project
Next Topic:CDT
Goto Forum:
  


Current Time: Fri Apr 19 05:26:27 GMT 2024

Powered by FUDForum. Page generated in 0.02162 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top