Eclipse CDT Cygwin error - c++

i have a problem with eclipse CDT and cygwin, when i try to build a simple hello world project i have this error:
make all
Building file: ../src/test.cpp
Invoking: Cygwin C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/test.d" -MT"src/test.d" -o "src/test.o" "../src/test.cpp"
C:\shell.w32-ix86\make.exe: *** [src/test.o] Error 1
14:37:48 Build Finished (took 178ms)
Cygwin is in the path and commands like 'g++' or 'make' works fine.
Thank in advance for your help.

Follow this tutorial to properly set up cygwin with Eclipse CDI. After completing all the steps, add one more path dependency on: Project Properties -> C/C++ General -> Paths and Symbols -> Includes GNU C++ with the value to : ${CYGWIN_HOME}/usr/i686-pc-cygwin/sys-root/usr/bin. This solved all the issues arising on Eclipse CDT with CYGWIN.

Related

Binary is never build

I can't get the following code to run:
#include <iostream>
int main()
{
std::cout << "Hello World" << std::endl;
return 0;
}
There are no compile errors.
The build output:
18:18:58 **** Incremental Build of configuration Debug for project First Project ****
Info: Internal Builder is used for build
g++ "-Ic:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include\\c++" "-Ic:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include\\c++\\mingw32" "-Ic:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include\\c++\\backward" "-Ic:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include" "-Ic:\\mingw\\include" "-Ic:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include-fixed" -O0 -g3 -Wall -c -fmessage-length=0 -o Hello.o "..\\Hello.cpp"
18:18:58 Build Finished (took 166ms)
I get the dreaded "Launch failed. Binary not found." dialog. I've been over google for hours now, but nothing works.
In my project folder, a debug or release folder are created (depending on what I set it to) but it's always empty. No 'binaries' folder is created, as some posts mentioned it should.
No proposed solution worked, and disabling the antivirus didn't solve it.
How do I fix this? Thank you.
EDIT
Eclipse Version Kepler Severive Release 1
Build id: 20130919-0819
CDT Version: 8.3.0.201402142303
I'm using MinGW
EDIT2
Changing the "current builder" in properties>c/c++ build>tool chain editor from CDT internal builder to Gnu Make Builder does generate a makefile.
Output:
13:57:41 ** Auto Build of configuration Debug for project First Project **
make all
Building file: ../Hello.cpp
Invoking: GCC C++ Compiler
g++ -I"c:\mingw\lib\gcc\mingw32\4.8.1\include\c++" - I"c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\mingw32" - I"c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\backward" -I"c:\mingw\lib\gcc\mingw32\4.8.1\include" -I"c:\mingw\include" -I"c:\mingw\lib\gcc\mingw32\4.8.1\include-fixed" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Hello.d" -MT"Hello.d" -o "Hello.o" "../Hello.cpp"
make: * [Hello.o] Error 1
13:57:42 Build Finished (took 881ms)
Which compiler are you using? It appears that you are only compiling your code, not linking it too. You must build and link in order for it to work.
The -c flag only compiles the source file. It doesn't link with the object file into an executable. Add this:
g++ -o "..\\Hello.exe" "..\\Hello.o" && "..\\Hello.exe"
Just remove -c flag from your compile line and change -o Hello.o to -o Hello.exe (guess you use Windows).

Eclipse on Mac C/C++

I'm having a big problem on Eclipse Kepler for Mac!!
Please, help me!!
**** Incremental Build of configuration Debug for project Working ****
make all
Building file: ../hello.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"hello.d" -MT"hello.d" -o "hello.o" "../hello.cpp"
dyld: Library not loaded: /usr/local/lib/libmpc.3.dylib
Referenced from: /Users/Saulo/hpc-gcc/bin/../libexec/gcc/x86_64-apple-darwin13.1.0/4.9.0/cc1plus
Reason: image not found
g++: internal compiler error: Trace/BPT trap: 5 (program cc1plus)
My question is: How can i resolve this?
Thanks!!
Set the variable DYLD_LIBRARY_PATH to the location of libmpc library. To do this, you have to go to Run/Run Configurations and then select Environment tab, then add the variable DYLD_LIBRARY_PATH and finally set its value to the path to the required dylib.

Still getting "Binary Not Found" error even after building (Eclipse OSX Mtn. Lion)

I recently installed Eclipse for C/C++ on my mac. Whether I'm compiling C or C++, I still get every time: Binary Not Found even after I've built with no errors. I have Xcode installed with the Command Line Tools and GCC and G++ work perfectly fine from the mac terminal. Compiling is fine, at least to my knowledge, in Eclipse but running it won't work. The executable that eclipse creates, however, under the Debug folder of my project, also runs fine. Here's what Eclipse puts in the console when building
`make all
Building file: ../test1.c
Invoking: Cross GCC Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"test1.d" -MT"test1.d" -o "test1.o" "../test1.c"
Finished building: ../test1.c
Building target: test1
Invoking: Cross GCC Linker
gcc -o "test1" ./test1.o
Finished building target: test1`
I have my artifact set to executable and have tried everything I can think of.
Thanks in advance!
Preferences > c/c++ > new c/c++ project wizard
click on Cross GCC or MacOSX GCC then click on make toolchain(s) preferred

problem building cpp project in eclipse

I have installed minGW and msys. In eclipse CDT I created c++ project that uses cross gcc toolchain.
Eclipse created make file which I can use through command line, so if I run make all project is correctly compiled, but if I use eclipse to build, it fails with following message
**** Build of configuration Debug for project cpp ****
make all
Building file: ../src/main.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/main.d" -MT"src/main.d" -o "src/main.o" "../src/main.cpp"
make: *** [src/main.o] Error 1
**** Build Finished ****
I have chosen wrong toolchain in project, changed to mingw gcc and now it works

eclipse compiling error

I just installed cygwin and eclipse on my win7 x64 machine, and after importing my code from svn, I get this weird error:
**** Build of configuration Default for project platform ****
make all
g++ -O2 -g -Wall -fmessage-length=0 -c -o platform.o platform.cpp
process_begin: CreateProcess(C:\cygwin\bin\g++.exe, g++ -O2 -g -Wall -fmessage-length=0 -c -o platform.o platform.cpp, ...) failed.
make (e=5): Access is denied.
make: *** [platform.o] Error 5
I've tried running eclipse as administrator, but that doesn't make any difference. Any clue how to fix this?
My windows PATH variable is C:\WinAVR-20100110\bin;C:\WinAVR-20100110\utils\bin;c:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jre6\bin\;C:\cygwin\bin
C:\cygwin\bin\g++.exe is a Cygwin symbolic link pointing to either g++-3.exe or g++-4.exe. Native Windows functions such as CreateProcess() don't understand Cygwin symbolic links though. Hence you need to configure Eclipse to execute g++-3.exe or g++-4.exe directly.