Page 1 of 1

C editor, or C++

Posted: Tue Feb 17, 2015 7:04 pm
by radarblue
Good day.
I work with electricity and want to get into programming.
I have a book that I study called : X86 Assembly Language and C fundamentals.

I try to write a Hello World program, but getting nowhere.
My book uses C code examples. not C++.

Reading and doing binary arithmetic on paper is one thing, but getting the C code to run in a C++ seems futile. I must admit I have never felt so lost in my entire life.
I am a complete newbie in programming.
Also tested Visual studio but its pure C++ and not my kind of code.

Is codelite a C editor. can I use
Printf and stdio.h
How ?

Where can I find a C editor.

Re: C editor, or C++

Posted: Tue Feb 17, 2015 7:09 pm
by eranif
CodeLite is an IDE See https://en.wikipedia.org/wiki/Integrate ... nvironment
It is not a compiler.
If you want to learn C, its OK - just tell CodeLite to use a C compiler and not a C++ compiler
To change the compiler type, open your project settings->common settings->general->compiler type and select one of the "GCC" family compilers.
If your file is suffixed with ".c" codelite will use gcc (the C compiler), for C++, g++ is invoked

Eran

Re: C editor, or C++

Posted: Wed Feb 18, 2015 3:50 am
by Gibbon1
Wonder if it would make sense to install an example workspace on windows under

C:\Users\gibbon1\AppData\Roaming\CodeLite\Examples\HelloWorld and the Linux equivalent

With C hello world, C++ hello world and gui hello world projects.

That way noobs could just open the workspace, compile, and run. Thus having something functional to mess with.

PS: I was able to build and install codelite under Linux Mint. Seems to work.

Re: C editor, or C++

Posted: Wed Feb 18, 2015 5:54 pm
by eranif
This is a very good idea ( create sample workspaces for the new users )
Can you please post this as feature request here

Eran

Re: C editor, or C++

Posted: Sat Feb 21, 2015 1:49 am
by radarblue
thanks
I have windows 8.
codelite is installed on the C:

I press new workspace. type a name . hellokitty, and place that in a separate folder named kitty on the desktop. I select from file>new project. I select the g++. I give the project a name hellokitty1, and place it in the same folder on the desktop. I choose the C++ compiler. I go to the hellokitty folder on the left of the program window and locate hellokitty>src>main.cpp. and double click. a sample code is coming up on screen. I select from the menu Build>build project.

just like shown here
http://codelite.org/LiteEditor/QuickStart

And I recieve a reply in the build window. mingw32make is not recognized as an internal or external command operable or batch file.
no errors found.

when I from the menu press Build>Build and run project.
I get a prompt window that only says : press any key to continue.
But not text saying " hello kitty "

the same happens when if I from the beginning select a gcc, instead of g++ .

Also tried to change the environment PATH .
I select Settings>environment variables.
press New set.
type in the name Path.
and into the text field I write : VALUE: $(PATH);C:\MinGW\bin

Q: what am I doing wrong .

Re: C editor, or C++

Posted: Sat Feb 21, 2015 12:53 pm
by eranif
radarblue wrote:mingw32make is not recognized as an internal or external command operable or batch file
Did you install a compiler

Eran

Re: C editor, or C++

Posted: Sat Feb 21, 2015 5:31 pm
by radarblue
:D
Obviously I didnt have the correct Compiler.

Your advice on installing the Compiler " TDMgcc4.9.2 " 64 bit for Windows8.
Made the source file compile and display "hello kitty" on screen in a cmd prom like expected.

Hello world !

Big thanks !

I think its wierd that Intel or AMD dont provide a Complier and Multi Language editors along with the CPU. Or atleast a download from their sites ?

Re: C editor, or C++

Posted: Sat Feb 21, 2015 6:28 pm
by radarblue
I managed to write an example off the book and it compiled like expected.

//x86 assembly language and c fundamentals . page107.
//float_mul
//multiplies two floating point numbers in 32bit.

#include <stdio.h>
int main (void)

{
//declare variables inside the brackets, local action.
float a, b;
a= 8.2;
b= 6.7;

//product is expected to be 54.94_10
printf ("product multiplication = %f\n", a * b);
return 0;
}

cmd Prom window displays
product multiplication = 54.93999

I am very satisfied !

Re: C editor, or C++

Posted: Wed Mar 18, 2015 8:05 pm
by spaces
eranif wrote:
radarblue wrote:mingw32make is not recognized as an internal or external command operable or batch file
Did you install a compiler

Eran
Heh, just got here, hope Eran you still check this topic.

Ok my question is what is that "mkdir -p" tomfoolery on that page. If I put that in my settings and it won't compile the project. Or is that just needed for Cygwin but not Mingw?

Ty in advance.

Re: C editor, or C++

Posted: Thu Mar 19, 2015 1:47 am
by Gibbon1
You should make a new thread. However mkdir -p is a unix/linux command, the -p says create parents if they don't exist.

Otherwise it's not clear what web page you're referring to.
Supposedly codelite will work if you start it from inside cygwin or msys.

And native on windows.

Since you mentioned cygwin. Beware if sh.exe is in the path and if you don't specify SHELL=cmd.exe make will try to use sh.exe to process make file command instead of the windows shell cmd.exe.

See the make entry under build settings. Mine is: mingw32-make -j4 SHELL=cmd.exe