CLion Cygwin (32 bit) version 2.11.2 GDB Debugging Error 0xc0000135 - c++

EDIT 1
This seems to be related to linking to the mono library, once I remove any kind of reference to mono code and remove the linking to the library from my CMakeList.txt file, debugging works as expected.
EDIT 2
Okay, I've discovered something interesting. This actually might not have anything to do with how I am linking libraries, it appears to be directly related to how I am initialising a class in my unit test. For whatever reason, if I use my normal syntax of TypeDeclaration variableName; the unit test fails immediately with the error code 0xc0000135, but if I change it to read TypeDeclaration variableName(); the code will run. Only problem is that I then get a warning stating empty parenthesis interpreted as a function declaration. I came from linux using g++ to compile my code and there was never an issue, now all of a sudden trying to compile on windows using cygwin or mingw means I can't use the normal standard c++ syntax to actually do work...
Edit 3
I've discovered that this issue is occurring because the libraries I am dependent on aren't actually being copied into the build directory of my unit test project. If I manually copy the required libraries into my build directory debugging works as expected, will need to learn how to express this requirement in CMakeList.txt
More Details
CLion Specifics
CLion 2018.3.1
Build #CL-183.4588.63, built on December 5, 2018
JRE: 1.8.0_152-release-1343-b16 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Toolchain Settings
Cygwin 32 bit version 2.11.2
CMake version 3.13.1
Make version 4.2.1
gcc version 7.3.0
Debugger Cygwin GDB version 8.1.1
catch.hpp for unit testing.
Problem
When debugging a unit test, CLion reports the following error:
During startup program exited with code 0xc0000135.
Google returns a lot of Qt and netbeans related results, everyone suggests to add C:\mingw\bin to the system PATH variable. However I am not using mingw I am using cygwin. I tried adding C:\cygwin\bin to my PATH directory but that does not help. I also tried switching toolchain to use mingw to see if that would help. but the same problem occurs with debugging.
Not sure what else I can do to proceed in resolving this one, any ideas would be most welcome.

Related

Can't build and run in C++ Codeblocks

So I just recently downloaded a C++ IDE called Code::Blocks and made a new project. But when I tried to Build and Run it, the code gave some errors. I know that it isn't a problem with syntax or anything like that because I ran the default code that Code::Blocks provided. The error is the following:
Project/Target: "firstcpp - Debug":
The compiler's setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler.
Probably the toolchain path within the compiler options is not setup correctly?!
Do you have a compiler installed?
Goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup.
Tried to run compiler executable 'C:\MinGW/bin/gcc.exe', but failed!
Skipping...
Nothing to be done (all items are up-to-date).
It seems to me like there is some kind of issue with the C++ compiler, but I thought Code::Blocks already came with a C++ compiler, so I'm not too sure what the issue here. I also followed their instructions to go to Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables, but I'm not too sure what they mean by fix the compiler. Here is a screenshot of what I'm seeing:
Also here's info on my PC if you need it:
At this point I'm not too sure what to do to fix this problem. I have asked my friends about this problem(they have already successfully downloaded and used Code::Blocks), and they said that they never encountered this problem while they were installing it.
You need to ensure that you have a working installation of the GNU Compiler Collection, and that the paths you select for your toolchain exist.
If you don't already have GCC Installed, the easiest way would be to download a Code::Blocks distribution that comes pre-bundled with MinGW from the download site. However, it's also possible for you to install GCC through other means, such as:
Installing GCC with MinGW through msys2, or
Installing GCC with scoop install gcc on Windows
In either case, you need to select the installation path that contains the bin directory when setting up the toolchain in Code::Blocks.
In case you didn't notice, C::B formed the path to compiler with both "\" back slashes and "/" slashes, which simply isn't a valid Windows path !!
Slashes are used in Linux not Windows! But for some reason C::B is not getting this. And probably your Mingw is well set !!
C:\MinGW/bin/gcc.exe should be C:\MinGW\bin\gcc.exe
I had pretty hard time trying to fix this in win 7 32 bit/C::B version 20.03 but with no success, i checked all available options and settings, and actually i started to think that it's a bug.

GCC x64 on Windows

I tried installing CygWin64, but I cannot find any executables to build my code with in the C:\cygwin64 directory created.
I tried Win-Builds but the setup doesn't load with any mirror I give it. It tries to connect 3 times then aborts.
I tried MinGW-W64-Builds, but I cannot figure out how to install it. I can see a .sh file there, but I believe that is for Linux, so I do not know why because it says it is for Windows
Is there even a way to use 64-bit GCC on Windows? I am trying to tie it to a Code::Blocks IDE as that one only comes with the 32-bit version of MinGW.
Check out out the MinGW-w64 + GCC personal build at http://winlibs.com/.
No installation required, just unzip.
Examples on how to use are on the site, including on how to integrate with Code::Blocks IDE.

Trying to build c++ for a remote arm device on QtCreator, executable is 64bit

I have a board with zynq chipset and Armv7 processor and Ubuntu 12.04. I want to remotely build and debug a c++ program on it with QtCreator.
I tried to create a kit for building the program using this link. added the compiler in the toolchains of board and added qt version 4.8.1 to the kit (version of qt on the board is 4.8.1).
The code builds successfully. the problem is the binary is not executable on my board because it seems it is a 64bit binary and my board is not 64bit.
Am I missing something?
how can I check if my config for compiling qt everywhere source was correct and it resulted in the qmake I wanted?
btw my own OS is Ubuntu 16.04 64bit.
The instruction on the Xilinx's page instruct how to build a cross compiler for ARM, however I belive they assumed you're going to follow these steps on 32-bit Linux platform. On the other hand -xplatform qws/linux-arm-gnueabi-g++ option should produce 32bit compiler.
Are you sure your code is build with right compiler build with right option? have you trie to build any minimal example from command line and check what file command is telling you about the binary produced? For me it looks like, do don't really cross-compile your project.
after hours and hours of searching and trying different things I found the reason. First of all as #michal-f said I installed 32-bit Ubuntu. making in terminal was resulting in ARM binary but QtCreator just compiled for intel proccessor.
as stupid as it seems the reason was that I did not know that Qt variables is not related to system variables and though I had added CROSS_COMPILE variable in terminal, I should have added it to my kit environmental variables too.
so the phrase ${CROSS_COMPILE}g++ in MakeFile was simply g++ and the output was a binary compile with system g++.
I know it was something I should have found sooner, but something this stupid should have been somewhere on internet for beginners like me. So hopefully next person encountering this same problem will find this post.

What do I have to do to set C++ development in eclipse?

I am currently trying to set my eclipse so that I can start c++ development on my Windows computer. However, I am stuck with some errors. But first, here is what I did so far:
Installed the CDT for Eclipse
Installed Cygwin (with the additional packages gcc, gcc and make)
Added all "paths for headers" in Eclipse
The problem is that when I try to run my Hello World program, I get Launch failed. Binary not found.
I already build and rebuild the project but the program is still not running. It must be because of these errors that I have:
/bin/sh: g++: command not found
make: ***[src/HelloWorld.o] Error 127
What can I do to solve these errors?
Try running the Cygwin setup.exe again and select the packages for g++. Search for that and make sure those are installed. It should be under the name gcc-g++. The C++ compiler is installed separately from the C compiler.
Ok, I figured it out by myself. Since this really freaked me out, I want anyone else who has this problem to know how I solved it.
So apparently, since I had g++, gcc and all that installed, it had to be a problem with the path.
So what I did was check my path. If you don't know how to edit it, check this link http://www.computerhope.com/issues/ch000549.htm
So in there, I chose Path under the System variables and clicked on Edit.... What I noticed was that instead of C:\cygwin64 it said C:\cygwin. All I did was append the 64 (since I had installed the 64-bit version of cygwin) and I was done.
I restarted Eclipse, cleaned and built the project and the errors where gone!

Eclipse Ganymede and MinGW in Windows

I'm trying to get eclipse to work with MinGW.
I've done the following:
Downloaded CDT for eclipse.
Installed MinGW.
Added C:\MinGW\bin to my path.
Opening a command prompt (CMD) and typing g++ or alike works fine.
I run eclipse, create a "New C++ Project", and only get the option saying "other toolchains".
There's a MILLION tutorials out there saying eclipse should identify MinGW on its own. It doesn't, and I don't know what to do. I've tried reinstalling everying in just about every order posible. Still no luck.
I've also noted some tutorials say something about creating a "Managed C++ Project". I've no such option, all I get is "C++ Project" and "C Project"
edit:
I have eclipse ganymede, windows x86_64, version 3.4.2
http://download.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/index.php
Running the "Eclipse IDE for C/C++ developers" fails, since there's no x64 version for windows. The x86 version requires x86 JAVA installed as well, and installing two versions of java, gave nothing but trouble in the past.
The instructions for setting up MinGW in Ganymede are located here.
The following are instructions and
links on how to install the current
version of MinGW. Note that these
links may become inaccurate over time
as new versions of MinGW components
are introduced. Please check the MinGW
File Release section for the latest
versions.
Download and run the MinGW setup program, MinGW-5.1.3.exe.
Select download and install the MinGW base tools and the g++ compiler.
You may select the Current or
Candidate version of these tools. You
may also install any of the other
available compilers as well.
Do not install the MinGW Make feature as the MSYS version of make
from step 5 is a more complete
implementation of make.
The MinGW setup program currently does not install the gdb
debugger. To install the debugger,
download the file from the following
location: gdb-6.6.tar.bz2
Extract the contents of the file gdb-6.6.tar.bz2 to the same location
where you installed MinGW.
If you want to use Makefile projects, download and run the setup
program from the following location:
MSYS-1.0.10.exe. MSYS provides an
implementation of make and related
command line tools. This is not
required for other types of projects
with the MinGW toolchain, which use
CDT's internal build tools to perform
the build.
Following this process resolved any problems I had.
I had the same exact problem with Eclipse Galileo and CDT 6.0.1. It turns out that CDT only recognized MinGW when it's located under c:\mingw. I had it in c:\msys\mingw so that was the problem. After I changed that everything worked fine.
The distinction between managed make projects and makefile project was removed in CDT 4.x, I think. Now there is only one type of project, but you can select different builders. CDT includes an internal builder which does not use makefiles and another one which does.
First, save yourself the effort of "reinstalling in every order possible". That is also known as trial-and-error, and will only make you more frustrated. Apply the normal problem-solving skills you have as a programmer.
Given that you have MinGW installed, what happens if you download "Eclipse IDE for C/C++ developers", start eclipse.exe, and try to create a C++-project with a MinGW toolchain?
EDIT: remember: the key in getting help with problems like these is to produce a minimal example which fails. Also, it would help if you provided URLs to the packages you installed (MinGW, Eclipse, etc.).
EDIT: I just installed CDT using the Ganymede update site, downloaded and installed MinGW from here, and restarted Eclipse, and everything worked fine. I know that doesn't help you, but it does prove that the toolchain detection isn't completely broken. Something is weird on your side.
You could try Wascana Desktop Developer. Its a distribution of Eclipse CDT configured specifically for developing on Windows.
I had the same problem (i.e. Eclipse not finding MinGW on the PATH) after I removed some of the unused files/folders from MinGW. It was ~600 MB and I was tasked to trim it down before adding to source control. I got it down to a workable ~200 MB. When I tried to re-create an Eclipse workspace afterwards, MinGW disappeared from available toolchains. It reappeared after I put the original MinGW install on the path.
HTH