LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-14-2010, 07:48 AM   #1
Zac Matthew Joseph
LQ Newbie
 
Registered: Sep 2008
Distribution: pendrive- ubuntu, mandriva
Posts: 21

Rep: Reputation: 15
Cool HELP! C/C++ on netbeans


I installed netbeans on ubuntu9.10 and also installed the C/C++ plugin. But when i run the code for "HELLO WORD" an error is shown. I also tried to declare conio.h but output comes as header file not found.

I guess i gota install the header libraries.
Please help me in this.
 
Old 03-14-2010, 01:21 PM   #2
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Rep: Reputation: 37
Could you show your code?

conio.h sounds just wrong either way...

EDIT: yeah, seems that conio.h is header file used in DOS/Windows. Stick to standard libraries and try again.

Last edited by Zmyrgel; 03-14-2010 at 01:23 PM. Reason: quick wiki trip
 
Old 03-14-2010, 09:51 PM   #3
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Does the following c++ code work?
Code:
#include <iostream>
int main(){ std::cout << "Hello, world." << std::endl;}
Evo2.
 
Old 03-19-2010, 02:04 AM   #4
Zac Matthew Joseph
LQ Newbie
 
Registered: Sep 2008
Distribution: pendrive- ubuntu, mandriva
Posts: 21

Original Poster
Rep: Reputation: 15
Smile

--ok i dint know that conio.h is for windows platform.
I used iostream.h and compilation is ok but when i run it, terminal opens and its written :
"Press [ENTER] to close the terminal"

--But theres no "Hello word"


Kindly also tell me how can I export my compilation as an executable file on linux and for windows(.exe).

Last edited by Zac Matthew Joseph; 03-19-2010 at 02:26 AM.
 
Old 03-20-2010, 05:23 AM   #5
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Rep: Reputation: 37
Quote:
Originally Posted by Zac Matthew Joseph View Post
--ok i dint know that conio.h is for windows platform.
I used iostream.h and compilation is ok but when i run it, terminal opens and its written :
"Press [ENTER] to close the terminal"

--But theres no "Hello word"
Could you show the code?


Quote:
Kindly also tell me how can I export my compilation as an executable file on linux and for windows(.exe).
You need to compile the executable on Windows to get Windows executable and same for Linux.
 
Old 04-07-2010, 10:48 PM   #6
Zac Matthew Joseph
LQ Newbie
 
Registered: Sep 2008
Distribution: pendrive- ubuntu, mandriva
Posts: 21

Original Poster
Rep: Reputation: 15
i know basic c programming on windows and conio.h is important header for scanf function.
But on linux i cannot use that cause its not ment for linux.

But i need to use scanf function on linux using stdio.h header but everytime i get an error. There are some other functions like sscanf and others and im confused. I cannot get any help from google.

Its the fundamental function of C so linux people must be aware of this!
 
Old 04-07-2010, 10:57 PM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,244

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Zac you seem to have missed the 2 requests asking you to show your code???

btw the statement:

Quote:
Its the fundamental function of C so linux people must be aware of this!
is completely erroneous. I know plenty of people using linux who do not know any programming
languages at all, never mind C
 
Old 04-08-2010, 06:50 AM   #8
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Install manpages-dev package and then just "man sscanf" or whatever function to find what header to include.

Quote:
Originally Posted by Zac Matthew Joseph View Post
Its the fundamental function of C so linux people must be aware of this!
Your problem seems to be with netbeans, which I would think very few linux c coders would use.

Evo2.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
netbeans for C++ iqbala Ubuntu 3 10-05-2009 12:35 PM
Netbeans 6.7 sniff SUSE / openSUSE 0 07-25-2009 04:59 PM
netbeans 6 minhajhussan Linux - Software 2 04-26-2008 05:35 AM
in netbeans gobicse Linux - Newbie 2 12-21-2007 06:48 AM
LXer: Sun Announces the Latest in Open Source Tools with the Availability of NetBeans Visual Web Pack and NetBeans C/C++ Development Pack LXer Syndicated Linux News 1 12-31-2006 08:37 AM


All times are GMT -5. The time now is 01:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration