Compling C code in Netbeans IDE 6.9.1 - c

Can anyone give me step by step tutorial on how to use netbeans to code and compile C code?
Also i have dev cpp but the formating is sick.
GCC is what i use.
Thanks much

netbeans tutorial: http://cnd.netbeans.org/cnd-tutorial.html
In Ubuntu, I do the following:
- Create a new C/C++ project
- Import the sources
- you already have makefiles (or cmake), netbeans you can configure that in the advanced screen.
- You can turn of automatic builds in the same advanced screen
- and build using the normal build command.

Related

Viewing CPython Code in CLion

Sorry for a question that might appear stupid to more experienced developers: I am still a newcomer to C and C++.
I come from Python/Java development land and am trying to get a better insight into C and C++. I installed JetBrains CLion and cloned CPython mercurial repository. However when I started looking at the source code, I realized that Clion was highlighting a lot of constructs that seemed to be working. For instance:
Or
As far as I can see, Clion seems the have problem with the identation style of Python, C code, but once again, I might be wrong.
How Clion configurations can be altered for it to properly parse the CPython code?
CPython uses GNU Autotools for the build, but that toolset is not supported by CLion. See issues CPP-494 and CPP-193. CLion currently supports only one build system - CMake.
You can create your own CMakeLists.txt file and list the sources in there. This will help CLion to understand the structure of the source tree and allow it to find the headers etc:
cmake_minimum_required(VERSION 3.0)
project(cpython)
file(GLOB SOURCE_FILES
Python/*.c
Parser/*.c
Objects/*.c
Modules/*.c)
include_directories(Include)
add_executable(cpython ${SOURCE_FILES})
For the actual build, use standard build tools from command line. Alternatively, custom command can be added to CMakeLists.txt to call make. See add_custom_command for that.
As mentioned in the above answer you need a CMake Project to allow CLion to build Python.
In fact there is already a CMakeList.txt-files for CPython, that is maintained independently from the official sources:
https://github.com/python-cmake-buildsystem/python-cmake-buildsystem
I didn't test it with CLion but it should do the job...

How to use CUDA 6.0 with XCODE 5

My question may completely be a noob. Sorry, for that but I have been trying to compile my first Cuda code in Xcode and I'm lost where and how I could set up the IDE to invoke NVCC.
I installed the latest CUDA toolkit CUDA 6.0 and have even installed GCC 4.8 using brew. I have XCODE 5.5
When I run my code from XCODE all the directives like global are marked as unidentified.
I don't where and to change the settings to invoke NVCC. I will be really thankful, if anyone could help me with this.
Further, when I created the XCODE project, I created it as a C project. So, I placed the CUDA code in this C file, which is what is giving me the above mentioned errors. I tried to replace this .C file with a .cu file (just change the extension), which too failed badly - XCODE didn't even know what to do with the .cu files
COuld anyone please help me?
Thanks in Advance
I have given it a try. Although I have not completely succeeded I thought I'd post my progress here in hopes of helping others. The steps I took were inspired by this page.
Create a new Xcode project
Under Build Settings add a new user defined setting CC with the value /usr/local/cuda/bin/nvcc.
Add /usr/local/cuda/include to Header Search Paths under Build Settings.
Set Enable Modules (C and Objective-C) to No.
Add /usr/local/cuda/lib/libcuda.dylib to Link Binary With Libraries under Build Phases.
For any C files you create set their extension to .cu in the File Inspector, after you have done that you have to set the type of that file to C source to get syntax highlighting, by going to Editor->Syntax Coloring->C.
Problems with this setup:
- Xcode can't run the executable, at least nog if it is compiled for debugging. However you can make it copy the executable to some reasonable location and run it in the terminal.
- Whenever you try 'Build for running' sometimes Xcode magically destroys the whole project.

C/C++ Run/Debug configuration in Eclipse

I am new to C/C++ development in Eclipse and trying to configure Eclipse. I'm working in a Linux environment with GNU GCC and my toolchain is detected by Eclipse. As given in the Eclipse documentation 1, I opened Run>>Run configurations. But the C/C++ Local tab is not there.
This is all I get.
But when I build a sample helloworld program, it's being built correctly.
Any idea why this happens?
1 http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Ftasks%2Fcdt_t_run_com.htm
I faced same issue as you. I was able to create and build one c/c++ project, but I couldn't run/debug it. Actually, I installed wrong CDT (CDT Visual C++ Support). Next I installed correct CDT (c/c++ development tools) and after one eclipse restart I had c/c++ application inside of Run Configuration.

How to integrate DynamicC compiler(Rabbit Microcontroller/C ) with the Eclipse IDE

I would like to integrate the Dynamic C compiler which is compiler for the RABBIT microcontroller into the Eclipse IDE. I really like eclipse environment and its features.
Is there any method I can use to integrate such external compiler into the Eclipse Environment. Any detailed writeup of howto would be very helpful.
I don't know that compiler, but Eclipse can be configured to use various compilers.
You should create a C project, right-click it and select "Properties". Then take a look at C/C++ Build -> Settings and C/C++ Build -> Tool Chain Editor.
If your compiler is properly installed (i.e. you can build things with it on the command line or through another tool), then you should be able to get the right things set in the "C/C++ Build" options.
Here's the eclipse documentation on managing those settings: Eclipse C/C++ Build

How to run a Simple C Program in Eclipse IDE

I've downloaded Eclipse C/C++ IDE . I need to run a simple c program in this(To print welcome).
While trying to run the program its popping up an error message like "Launch failed: Binary not found" .
Need i install any compiler package. ?
Please help me to do this.
Yes, you have to install a compiler, Eclipse is only an IDE. You can get MinGW here.
http://www.eclipse.org/cdt/
Look at the above link,you will get more idea,on how to do development using C/C++ using eclipse.
You can make use of the documentation which comes along with the IDE.
Just on the start up window in Eclipse click Tutorials and then click on c/c++ development link and then read Before you Begin part.
The program you write must be converted into respective binary which is to be run on that particular architecture.This process is carried out by the compiler as a result compiler is required for eclipse IDE to compile and link the code .
Various compilers are available such as Microsoft Visual C++ MinGW GCC or Cygwin GCC in the form of chaintools in eclipse so as to compile the code.
Eclipse is an IDE.It will help you write applications in c/++,but it will not compile your program as Eclipse does not comes with a compiler pre-configured.
You need to install a compiler to run your application.
Eclipse is capable to use many c/c++ compilers,some are:
1.Cygwin
2.MingW
3.Gross
4.Microsoft Visual C++
I would advise to install mingW OR Cygwin.
If you need more help on running a c/c++ application in Eclipse
visit http://www.ibm.com/developerworks/opensource/library/os-ecc/?S_TACT=105AGX44&S_CMP=ART

Resources