C editor, or C++

General questions regarding the usage of CodeLite
radarblue
CodeLite Enthusiast
Posts: 11
Joined: Tue Feb 17, 2015 6:55 pm
Genuine User: Yes
IDE Question: C++
Contact:

C editor, or C++

Post 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.
Last edited by radarblue on Tue Feb 17, 2015 7:09 pm, edited 1 time in total.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: C editor, or C++

Post 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
Make sure you have read the HOW TO POST thread
Gibbon1
CodeLite Expert
Posts: 167
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: C editor, or C++

Post 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.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: C editor, or C++

Post 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
Make sure you have read the HOW TO POST thread
radarblue
CodeLite Enthusiast
Posts: 11
Joined: Tue Feb 17, 2015 6:55 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: C editor, or C++

Post 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 .
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: C editor, or C++

Post by eranif »

radarblue wrote:mingw32make is not recognized as an internal or external command operable or batch file
Did you install a compiler

Eran
Make sure you have read the HOW TO POST thread
radarblue
CodeLite Enthusiast
Posts: 11
Joined: Tue Feb 17, 2015 6:55 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: C editor, or C++

Post 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 ?
radarblue
CodeLite Enthusiast
Posts: 11
Joined: Tue Feb 17, 2015 6:55 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: C editor, or C++

Post 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 !
spaces
CodeLite Veteran
Posts: 67
Joined: Mon Aug 22, 2011 10:15 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: C editor, or C++

Post 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.
Gibbon1
CodeLite Expert
Posts: 167
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: C editor, or C++

Post 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
Post Reply