Problems when using Lcc-Win compiler - c

I am new to programming here and pushing my limits to learn C as my first language. I have installed a compiler LCC-Win. However when I created a code with two or more functions and compile it, I always stuck to the problem where "compiler has stopped working" and file not created although the compiler says it is. Is this only me or should I change to other compiler?
By the way I am using a Windows 7 64-bit.
Thank you for advance.

Related

switches in Triangle program

A weeks ago, I started learning about the Triangle program, which is used to generate meshes.
I attach the link from where you can download its zip file and read about it:
http://www.cs.cmu.edu/~quake/triangle.html
I am having trouble running the example using in Linux Ubuntu, which is supposed to be run trivially.
In particular, I don't understand what are exactly the switches that are mentioned in the makefile.
How exactly am I supposed to choose the optimization using switches? Do I need to modify the C source code or is something I need to specify before compiling it on Linux terminal somehow?
Besides, I am required to use the -DLINUX switches in order for arithmetics to run well. I would also need to know where I need to specify this.
If it helps, I am getting errors in the terminal notifying me that there are: "Undefined reference to sqrt" and " "Undefined reference to cos".
I really need help on this because my understanding on Linux and C is quite weak.
Thanks very much.

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.

Using make to compile code in c in terminal on Mac

I'm trying to learn to program in C and I'm getting used to compiling the code after writing it. I'm actually using K&R 2nd edition to start off and they use 'cc' to compile. I originally started using Zed Shaw's Learn C The Hard Way but I've stopped because I haven't heard many good things about it. Zed Shaw's way was to use 'make' to compile code, at least in the beginning.
Is there any technical difference between using 'make' and using 'cc' that I should be concerned about right now?
make simply gives commands to the compiler, such as cc. It automates building a project which has multiple files. To begin, you do not need to concern yourself with those details. Building a single file directly with cc is fine. In fact, you will understand how the compiler works so that you can get the most out of make when you eventually learn it.
I agree with code-apprentice. I would just add that it is important to have a good understanding of different cc command line options before moving on to make. When you reach the point of a more complexe compilation project and the build process of your final binary becomes a pain, that's when you can transition to learning Make!

How can you implement the C language with DrRacket?

Does anyone know how to install the C language or enable it in the DrRacket?
I have installed the C package but I get an error every time I run my program.
The error is:
..\..\Program Files\Racket\collects\racket\system.rkt:181:19:
system*: contract violation
expected: path-string? given: #f
First off: I'm assuming that you're talking about Jay McCarthy's "C" package for Racket. If not, please ignore everything below.
I'm pretty sure that the problem here is that you're running this on Windows. This language level tries to run a C compiler, and Windows is ... not a system that makes it easy to run a C compiler.
I think the right answer here, sadly, is that I wouldn't expect this package to work correctly on Windows. I think the best fix is probably just for the package to signal an error on Windows.
Sorry :(.
Perhaps +jeapostrophe has something to add here?
EDIT: I took a look at the package source, and that's exactly what's going on. I've made a pull request that should at least improve the error message a bit.

Debugging Visual Studio C program from another Visual Studio project

I have a Visual Studio 2012 solution containing several projects, some in C and some in Fortran (using Intel Composer XE 2013). I frequently call from the Fortran code into the C code using the iso_c_binding utility, but I've noticed that I cannot debug the C code effectively. While debugging the Fortran code, I can view the contents of variables just fine, but if I step into the C code, suddenly they lose their sanity. Most variables just claim to be undefined; anything passed to the function will contain incorrect values (but it still does differentiate between pointers and objects/POD).
I can still step through the code; it seems to mostly follow the expected sequence of execution, but sometimes it does jump around a bit, which I'm familiar with from debugging compiler-optimized code on Linux with gdb.
I have a separate solution that also has C and Fortran projects. Both call into the same C project from the first solution, and in both cases, I can again debug successfully until I step into the C project from the first solution, at which point I have the same problems.
What am I doing wrong?
This is the standard bat signal for debugging code that was optimized. You'll need to rearrange you build settings so your Fortran code links to the non-optimized Debug build of the C code.
There are no breadcrumbs in your question as to how that went wrong in the first place. Start by checking which library is getting linked into your Fortran program and make sure that you can see distinct libraries generated for your C project in the Debug and Release builds. You need to link the one created by the Debug build.

Resources