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.
Related
I am trying to use gdb to debug an hdf5 C++ application that I have written. The h5 package that I am using was installed using conda. The command that I am using is:
h5c++ hdf5.cpp
This generates an executable which I then run with gdb as follows:
gdb a.out
gdb launches alright. But when I add breakpoint using:
b 10
or any line number, it gives a message: No line 10 in file "init.c"
When I press run, it runs the whole program at once (which I don't want) and exits. The h5c++ -show command gives the following output:
x86_64-conda_cos6-linux-gnu-c++ -I/i3c/hpcl/sms821/software/tensorflow/anaconda2/include -D_FORTIFY_SOURCE=2 -O2 -g -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -I/i3c/hpcl/sms821/software/tensorflow/anaconda2/include -fdebug-prefix-map==/usr/local/src/conda/- -fdebug-prefix-map==/usr/local/src/conda-prefix -L/i3c/hpcl/sms821/software/tensorflow/anaconda2/lib /i3c/hpcl/sms821/software/tensorflow/anaconda2/lib/libhdf5_hl_cpp.a /i3c/hpcl/sms821/software/tensorflow/anaconda2/lib/libhdf5_cpp.a /i3c/hpcl/sms821/software/tensorflow/anaconda2/lib/libhdf5_hl.a /i3c/hpcl/sms821/software/tensorflow/anaconda2/lib/libhdf5.a -L/i3c/hpcl/sms821/software/tensorflow/anaconda2/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-rpath,/i3c/hpcl/sms821/software/tensorflow/anaconda2/lib -L/i3c/hpcl/sms821/software/tensorflow/anaconda2/lib -g -lrt -lpthread -lz -ldl -lm -Wl,-rpath -Wl,/i3c/hpcl/sms821/software/tensorflow/anaconda2/lib
I think this has to do with the compiler the compiler that it is using. I tried replacing x86_64-conda_cos6-linux-gnu-c++ with my native g++ compiler in the h5c++ script but that gives linker error.
Please suggest how should make my h5 application work with gdb. Should I install hdf5 from source since I don't have sudo access? I am working on a Linux machine.
I simply installed hdf5 from the source files. While configuring the installation I turned the --enable-build-mode and --enable-symbol switches. Hdf5 has a dependency on szip which I also installed from source code. My exact configuration was as follows:
./configure --prefix=<hdf5 install directory> --enable-cxx --enable-build-mode=debug --enable-symbols=yes --enable-profiling=yes --with-szlib=<szip install directory>
The above solution worked and I was able to compile my h5 application using h5c++ hdf5.cpp and also use gdb to debug it.
So I recently installed Theano on a python 2.7 environment within Anaconda 3, on windows 10. Theano passed theano.test() at least. I am using example code from deeplearning.net. I heva sucessfully run the first block on the linked page which defines a Theano function. When I go to install pylab via pip install pylab so that I can use skimage for the second block, my installer quits while doing some gcc call for the portion that looks like it says "shared geometry". One thing I noticed right away is the -DEBUG flag is misspelled -DDEBUG. Could this be the cause? Does it have something to do with msvcr90.dll and if so what is that and what do I need to do about it? Also, probably important, I'm using a slightly (6 months or so) outdated TDM-GCC which is 4.9 something. Here is the line in question, as well as a few others that might be interesting:
`copying skimage\_shared\tests\__init__.py -> build\lib.win-amd64-2.7\skimage\_shared\tests
running build_ext
Looking for python27.dll
Cannot build msvcr library: "msvcr90d.dll" not found
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
building 'skimage._shared.geometry' extension
compiling C sources
C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\skimage
creating build\temp.win-amd64-2.7\Release\skimage\_shared
compile options: '-DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -I"C:\Users\USE DIS\Anaconda3\envs\py27\lib\site-packages\numpy\core\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\PC" -c'
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -I"C:\Users\USE DIS\Anaconda3\envs\py27\lib\site-packages\numpy\core\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\PC" -c skimage\_shared\geometry.c -o build\temp.win-amd64-2.7\Release\skimage\_shared\geometry.o
Found executable C:\Users\USE DIS\Anaconda3\envs\py27\Scripts\gcc.bat
'C:\Users\USE' is not recognized as an internal or external command,
operable program or batch file.
error: Command "gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -I"C:\Users\USE DIS\Anaconda3\envs\py27\lib\site-packages\numpy\core\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\include" -I"C:\Users\USE DIS\Anaconda3\envs\py27\PC" -c skimage\_shared\geometry.c -o build\temp.win-amd64-2.7\Release\skimage\_shared\geometry.o" failed with exit status 1
----------------------------------------
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.
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).
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