LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-16-2004, 09:56 AM   #1
ben_build#2.1.0
Member
 
Registered: Apr 2004
Distribution: Fedora Core 3
Posts: 240

Rep: Reputation: 30
What are the differences between windows C++ and linux C++?


I learned the basics of programming in C++ using Microsoft Visual C++ 6.0, but due to some inconviences I've stopped for a while. Now that I have linux on this computer, I am getting excited about programming again, but this time with linux.

I was wondering what are some differences between windows C++ and linux C++? (common, I know there has to be some) I was also wondering if the syntax was any different, and what compiler would you choose? So far I've only found out about intel's C++ compiler and the GNUC compiler. Does anybody have any suggestions on an easy to use gui based C++ compiler for Fedora Core 1?

Thanks

Ben
 
Old 05-16-2004, 11:06 AM   #2
jalal
Member
 
Registered: Aug 2003
Location: .bh
Distribution: Gentoo
Posts: 188

Rep: Reputation: 30
Hi,

Most people use gcc. You may want to look at http://kdevelop.kde.org
 
Old 05-16-2004, 11:10 AM   #3
pdug
LQ Newbie
 
Registered: Feb 2004
Posts: 20

Rep: Reputation: 0
(X)emacs is a powerful + flexible choice, if who have the guts to learn it.

As Visual C++ user you might prefer kdevelop. It stresses on KDE/QT GUI application development, and managing cross platform projects.

Eclipse (IMHO the best Java IDE) has a C/C++ plugin named CDT. I recently tried CDT 2.0. My first impression was good. (It was a beta version, and behaved like one. Release of 2.0 is said to be in June; there is a stable 1.2 version.)

There is a gnome ide named anjuta. Don't know about it.
 
Old 05-16-2004, 11:13 AM   #4
Rajahuroman
Member
 
Registered: May 2004
Location: Romania; Arad
Distribution: Archlinux
Posts: 91

Rep: Reputation: 15
Every instruction that is ANSI compliant is the same. But there are other libraries in Linux that worth learning. Try GTK+ for visual programming. And the Glade Interface designer. You can find tutorials for these on www . gnome . org. Also download the tutorial for the Glade Interface designer. I think you'll like it.
 
Old 05-16-2004, 11:54 AM   #5
pdug
LQ Newbie
 
Registered: Feb 2004
Posts: 20

Rep: Reputation: 0
Quote:
Originally posted by Rajahuroman
Every instruction that is ANSI compliant is the same. But there are other libraries in Linux that worth learning. Try GTK+ for visual programming. And the Glade Interface designer. You can find tutorials for these on www . gnome . org. Also download the tutorial for the Glade Interface designer. I think you'll like it.
ANSI compliant C/C++ is seldom to find, isn't it?

There are some cases where Microsoft renamed methods. E.g.:
strcmpi(s1, s2) -- gnu
_strcmpi(s1, s2) -- ms-windows

The MS-WIN compiler appered a little more rigid to me - it fails faster.

There are big differences developing + accessing dynamic libreries (*.dll, *.so)
With MS-WIN it is quite complicated to import/export symbols.
With MS-WIN you cannot import 'unknown' symbols.
Under Linux you can do that. You will get runtime errors later, if symbols are still missing.
I.e: In Windows you have to choose dynamic libs on compile time, in Linux you do that on runtime.
DLLs are a means to re-use code. Linux/UNIX *.so are - additionally - capable of building interfaces
 
Old 05-16-2004, 01:58 PM   #6
g07Hh4XX0r
LQ Newbie
 
Registered: May 2004
Location: Wherever I can get free WiFi
Distribution: Fedora Core 1
Posts: 4

Rep: Reputation: 0
There isn't really supposed to be Windows c++ or Linux c++. It is all supposed to comply with the ANSI standards, but different compilers will do different things. I use Anjuta, because it is the only GDE I could find for Linux that would run. As Rajahuroman said, all ANSI-compliant commands will be identical. As long as you find a working compiler, it shouldn't be too hard to transfer. Just don't do like I did and try to include the <windows.h> header to do window work......
 
Old 05-16-2004, 04:12 PM   #7
ben_build#2.1.0
Member
 
Registered: Apr 2004
Distribution: Fedora Core 3
Posts: 240

Original Poster
Rep: Reputation: 30
how in-depth is GTK+?

I think my first project is going to be a bare bones modem connection speed reader that sits on my desktop so I won't have to read gkrellm's small print

Would that be possible in GTK+?

and do you know of any good websites that has driver information, or where I can learn how to use C++ to interact with my modem to find the readings?
 
Old 05-17-2004, 11:10 AM   #8
Rajahuroman
Member
 
Registered: May 2004
Location: Romania; Arad
Distribution: Archlinux
Posts: 91

Rep: Reputation: 15
http://www.easysw.com/~mike/serial/serial.html
This is the link I used to learn about serial port programming and modems.
GTK+ is used to build graphical user interfaces, I'm sorry if I made you think otherwise. I didn't mean to creat confusion.http://www.easysw.com/~mike/serial/serial.html
 
Old 05-17-2004, 12:49 PM   #9
lramos85
Member
 
Registered: Sep 2003
Location: Riverside, Ca
Distribution: Gentoo, FC3
Posts: 125

Rep: Reputation: 15
Visual C++ is not fully ANSI-compliant (You know...Windows doing something and then calling it the "Default" or the "Right Way"), I've discover several things that VC++ lets you do that g++ doesn't (Things that you shouldn't do anyways).
 
Old 05-17-2004, 01:34 PM   #10
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
Quote:
Originally posted by lramos85
Visual C++ is not fully ANSI-compliant (You know...Windows doing something and then calling it the "Default" or the "Right Way"), I've discover several things that VC++ lets you do that g++ doesn't (Things that you shouldn't do anyways).
Actually, g++ isn't fully ANSI/ISO compliant either. I don't know of any compiler that is 100% ANSI compliant. VC++ 6.0 is pretty bad when it comes to ANSI-compliancy, but they made a lot of changes to VC++ .Net 2003 that make it a lot more ANSI compliant, but still not fully...

To answer the original post, like others have said, it's mostly about how you write your code. It's not even so much about if you write code that is ANSI-compliant, it's about what libraries you use. Almost nobody is going to create full GUI apps from the ANSI libraries alone. (Even if you could do that somehow, you'd have to interact with the OS differently for each OS.)There are many libraries that work across platforms, though.

Obviously, you're not going to be able to use the Win32 API on Linux, or Xlib on Windows, but if you choose APIs that work for both, you should be able to easily have code that compiles both in Windows and Linux.

Last edited by deiussum; 05-17-2004 at 01:38 PM.
 
  


Reply



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
The real differences between using Windows and using Linux... aysiu General 37 05-25-2006 05:07 AM
The Fundamental Differences Between Linux and Windows Charred Linux - News 23 10-30-2005 01:50 AM
Linux Vs. Windows.....what are the differences??? arctic123 General 40 09-28-2004 08:15 AM
fundamental differences bewteen linux and windows gatomeno Linux - Newbie 5 10-23-2003 12:31 AM
C++ differences between Windows and Linux?(and book Q) JediPunk Programming 7 09-09-2003 10:49 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:12 AM.

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
Open Source Consulting | Domain Registration