Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Cross Compiling - Ubuntu / Windows - MinGW(Build Error: /bin/sh: 1: i686-w64-mingw32-g++: not found)
icon5.gif  Cross Compiling - Ubuntu / Windows - MinGW [message #1492541] Sat, 29 November 2014 23:35 Go to next message
Pen Umbra is currently offline Pen UmbraFriend
Messages: 2
Registered: November 2014
Junior Member
Hello,

I am trying to set-up Eclipse CDT to cross compile for Windows. I have Eclipse installed on Ubuntu. I have installed MinGW by using "sudo apt-get install mingw-w64" and I think I've correctly configured Eclipse, including adding "i686-w64-mingw32-" as the prefix in Cross Settings.

I succesfully built a helloworld program for running on Linux/Ubuntu but when building for use on Windows I run into problems. The build fails and in the console the following is displayed:

18:10:01 **** Incremental Build of configuration Debug-Win for project HelloC++2 ****
make all
Building target: HelloC++2
Invoking: Cross G++ Linker
i686-w64-mingw32-g++ -o "HelloC++2" ./HelloCPP.o
/bin/sh: 1: i686-w64-mingw32-g++: not found
make: *** [HelloC++2] Error 127

18:10:01 Build Finished (took 337ms)


No doubt I have failed to configure something correctly, but am at a loss, despite spending several hours scouring the web looking for a solution.

I am quite new to c programming and Eclipse. Any help offered will be greatly appreciated - even if just pointing me in the direction of a suitable tutorial on this topic.

Regards,

[Updated on: Sun, 30 November 2014 20:59]

Report message to a moderator

Re: Cross Compiling - Ubuntu / Windows - MinGW [message #1506533 is a reply to message #1492541] Wed, 10 December 2014 23:20 Go to previous messageGo to next message
Daniel Graham is currently offline Daniel GrahamFriend
Messages: 1
Registered: December 2014
Junior Member
Pen Umbra wrote on Sat, 29 November 2014 23:35

i686-w64-mingw32-g++ -o "HelloC++2" ./HelloCPP.o


Hopefully you have figured out your problem already. I'll offer a few suggestions... Try running the above quoted line on the command line. That may help shine some light on whether the problem is the eclipse setup or Linux. If it works, it is your eclipse setup can't find i686-w64-mingw32-g++. If not, it may not be installed or you may have to add a directory to your PATH environment variable. You can also try the absolute path name for the mingw g++.
Re: Cross Compiling - Ubuntu / Windows - MinGW [message #1509984 is a reply to message #1506533] Sat, 13 December 2014 18:27 Go to previous messageGo to next message
Pen Umbra is currently offline Pen UmbraFriend
Messages: 2
Registered: November 2014
Junior Member
Thank you for your reply. I tried what you suggested, but without luck. My system does not seem to recognize that i686-w64-mingw32-g++ is already installed. Please see the below command line text:

user1@system1:~$ i686-w64-mingw32-g++ -o "HelloC++2" ./HelloCPP.o
The program 'i686-w64-mingw32-g++' is currently not installed. You can install it by typing:
sudo apt-get install gcc-mingw-w64
user1@system1:~$ sudo apt-get install gcc-mingw-w64
[sudo] password for user1:
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc-mingw-w64 is already the newest version.
The following packages were automatically installed and are no longer required:
thunderbird-globalmenu gir1.2-ubuntuoneui-3.0 firefox-globalmenu
libubuntuoneui-3.0-1 openjdk-7-jre-lib
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 50 not upgraded.
user1@system1:~$i686-w64-mingw32-g++ -o "HelloC++2" ./HelloCPP.o
The program 'i686-w64-mingw32-g++' is currently not installed. You can install it by typing:
sudo apt-get install gcc-mingw-w64
user1@system1:~$

Your comments to this problem are appreciated.
----------------------------------------------------------------------------------

I have managed to resolve this issue. I simply removed and reinstalled MinGW, for both 32 and 64 bit - i686... & x86...

Thanks

[Updated on: Sun, 14 December 2014 17:49]

Report message to a moderator

Re: Cross Compiling - Ubuntu / Windows - MinGW [message #1511833 is a reply to message #1509984] Mon, 15 December 2014 07:49 Go to previous messageGo to next message
Joost Kraaijeveld is currently offline Joost KraaijeveldFriend
Messages: 273
Registered: July 2009
Senior Member
On 13/12/14 19:27, Pen Umbra wrote:
> Thank you for your reply. I tried what you suggested, but without luck.
> My system does not seem to recognize that i686-w64-mingw32-g++ is
> already installed. Please see the below command line text:
>
> user1@system1:~$ i686-w64-mingw32-g++ -o "HelloC++2" ./HelloCPP.o
> The program 'i686-w64-mingw32-g++' is currently not installed. You can
> install it by typing:
> sudo apt-get install gcc-mingw-w64
> user1@system1:~$ sudo apt-get install gcc-mingw-w64
> [sudo] password for user1: Reading package lists... Done
> Building dependency tree Reading state information... Done
> gcc-mingw-w64 is already the newest version.
> The following packages were automatically installed and are no longer
> required:
> thunderbird-globalmenu gir1.2-ubuntuoneui-3.0 firefox-globalmenu
> libubuntuoneui-3.0-1 openjdk-7-jre-lib
> Use 'apt-get autoremove' to remove them.
> 0 upgraded, 0 newly installed, 0 to remove and 50 not upgraded.
> user1@system1:~$
>
> Your comments to this problem are appreciated.

Please install g++-mingw-w64 if you need c++


Cheers,

Joost
Re: Cross Compiling - Ubuntu / Windows - MinGW [message #1512448 is a reply to message #1511833] Mon, 15 December 2014 19:14 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Ubuntu install installs all the flavours of GCC if the Mingw compiler is installed. The Mingw installation of the OP was hosed.

--

Tauno Voipio
Previous Topic:Eclipse console does not print standard error
Next Topic:Problem for running SPlint
Goto Forum:
  


Current Time: Fri Apr 19 13:34:13 GMT 2024

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

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

Back to the top