ld.exe has stopped working - c

I am using Dev-C++ V(4.9.9.2) and trying to build a solution that performs some system based programming specifically that calls the Windows Service Manager. Now whenever I try to build my application, it halts with a message
ld.exe has stopped working and the application stops. I don't understand why this is happening when everything else falls right in place.

Don't use Dev-C++. It is ancient and so is its compiler.
Use a modern compiler environment like those available at http://mingw-w64.sourceforge.net/, or get an IDE with a newer MinGW(-w64) compiler, like Qt Creator, CodeBlocks, or even http://sourceforge.net/projects/orwelldevcpp/, etc...

Related

Getting error while run the program in C language

Getting warning each time while run the program in C.
This is not Error this is just a Warning .
Save the file every time before you Build and Run. This is the solution to your warning.This warning happens when you edit the program and tries to run it without saving.
Also your IDE Turbo C++ is very outdated Programming environment.I recommend CodeBlocks . Code::Blocks is a free C, C++ and Fortran IDE built to meet the most demanding needs of its users. It is designed to be very extensible and fully configurable.You can download it from here.
It seems like you are running this application in some sort of emulator.
Restart the program and try running that.
It should work.
Turbo C is terribly out of date and is probably even older than you.
I suggest you to upgrade to a IDE like Code::Blocks.
If, you are a beginner I suggest you compile using GCC command line compiler.
Save the file before you run/compile your code.

Can you code a shell for Linux using Windows OS and Dev-C++ IDE? Do shells work the same way for both operating systems?

I'm studying computer engineering and we have a class called operating systems where they lecture us about how OSes handle stuff etc. This week we were given a homework which requests us to code a shell that works on Linux. The problem is, they tought us literally nothing on how to code a shell so we are supposed to do some research and figure it out.
I found this guide online and it seemed perfect to me: link
Code, with explanations, what else could I ask for.
Now, I'm using a Windows PC and I use Dev-C++ IDE with GCC compiler. Can I code a shell that works on Linux with my current setup or do I have to install Linux? Are there any major differences between how shells run on these OSes?
If you want to write a shell for Linux, you want to target GNU/Linux which is basically POSIX with some extensions.
Dev-C++ by default uses MinGW GCC as its compiler, providing a Win32 API.
Win32 and POSIX are completely and fundamentally different. A shell written for one will not even slightly resemble the other.
Instead, you have several options:
Dev-C++ can optionally use Cygwin GCC, providing a more GNU/Linux-like experience on Windows. You need to take great care not to rely on any Cygwin-specific functionality like how it automatically translates pathnames and line terminators. You'll still need access to a Linux install to verify that it works.
Windows 10 lets you install WSL, a more modern Linux compatibility layer for Windows. Dev-C++ doesn't explicitly states it support it, so you may need to edit and compile separately, and may lose debugging functionality. You'll still need access to a Linux install to verify that it works.
Just run Linux in a VM. The only thing to care about is getting your shell working.
I would suggest saving yourself a ton of trouble right now and just download/install an Ubuntu image in VirtualBox.

WP8 C++ Runtime Component: Debug vs Release

I make some C-style functions in WP8 C++ runtime component. Every function take ponters for const input and output arrays. Debug version work great, but in Release some functions works wrong. The magic consist in simple thing: this functions have the same interface and works with pointers in the same way, but some functions work correct and other functions work wrong.
Which are standart problem exists with switching from Debug to Release in WP8 SDK Visual Studio 2012?
The problems are the same as any other C/C++ Debug/Release build configuration - the exact issues will depend on your Debug/Release settings and what your code does.
Typically:
the optimizer will move code and data around and/or remove code.
Release code will also typically run faster due to the optimizer, so you will notice changes due to race-conditions.
You will need to get used to debugging in Release configuration on a real device. Getting the same code to run on the Emulator reliably will also help you with some race conditions too (as the x86 Emulator is faster than the ARM devices).
See "Release /Debug hell, with V-studio C++ project", "Separate 'debug' and 'release' builds?".

can anyone suggest a good program for debugging a C program?

I need to debug a C program that includes posix threads, socket programming (udp client, server). I use ubuntu 12.04 and as IDE/SDK, Qt Creator 2.4.1 and Netbeans IDE 7.1.2. I know they use gdb for debugging.
When I start to debug my program, the program stops running after 5 min or so and neither Qt Creator or Netbeans output any error or warning, although I use debugging feature and my program suppose to listen for a UDP port.
I use printf for all line of my code, and I can see that my program works as it suppose to and listen the UDP port and waits. I can not figure the problem out why it stops without any reason and since IDEs that I am using do not show any debug error, warning, I can not think any reason.
I wonder if anyone can suggest me a debug program that monitors all/some variables and threads during the run time. Thank you.
An old, but reliable tool is ddd, which is basically the gdb GUI wrapper. Although, I usually do debugging directly with Emacs, ddd is the tool that you'll be able to run on almost all *nix platforms.
gdb isn't too comfortable but always available.
To do runtime analysis of different types, especially checking memory access, Valgrind (see here for docs) might be the tool of choice.
Update: I'm referring to *IX systems. For Windows gbd also works in the cygwin enviroment. Nativly there is VC Express, which is free and includes IDE and debugger.
I'm not quite sure what debugger is used for your kind of application. The only debugger I know about on Linux is gdb. It along with printf statements is all I need.
gdb is simple, though not "too comfortable" as #alk said, but seems to be ubiquitous.
There is also Eclipse, and that's quite a nice development and debugging platform, too.

Compiling a GTK+ application for windows from linux

I'm new to linux and have been learning gtk+ the past couple of days, and was wondering how you would go about compiling an application to run on windows instead of linux (ubuntu). I found this while doing a quick search but my knowledge of linux is non-existent at the moment so not sure how to proceed with the tutorial. Are there any alternative methods to do this?.
I've only compiled on Windows and used Cygwin to test 'nix versions (before going right into a 'nix OS and compiling), but looks like this might get you started.
Compiling in other OS does not make sense while you can't disribute your binary without testing it on the target platform.
Then why not to compile on the same platform?

Resources