What are the differences between windows C++ and linux C++?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
(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.
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.
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
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......
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?
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).
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.