Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

GCC and Visual C++...

Posted on 1999-01-11
5
232 Views
Last Modified: 2013-12-14
I am writing various basic programs (sorting algorithms, trees, lists etc.) in MS Visual C++ 6.0 and need to have them compile with the GNU GCC compiler (version 2.7) of UNIX.

Are there any issues I should be aware of? Any tools that make this easy?

Thanks...
0
Comment
Question by:loyaliser
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:yonat
ID: 1181874
Advice no. 1 would be to stick to the standard C++, and not use any Windows specific stuff. (don't #include <windows.h>, don't use stuff like __declspec etc.)

Advice no.2, however, would be to use the standard library instead of writing your own classes - it already has sorting algorithms, lists, a binary  tree and more. For more info see http://www.research.att.com/~bs/3rd_tour2.pdf, or the following:
* http://www.sgi.com/Technology/STL/stl_introduction.html
* http://www.objectplace.com/technology/articles/9508.shtml
* http://www.eckelobjects.com/stlsimpl.html
* http://www.yrl.co.uk/~phil/stl/stl.htmlx
* http://www.cs.brown.edu/people/jak/programming/stl-tutorial/tutorial.html
* http://www.infosys.tuwien.ac.at/Research/Component/tutorial/prwmain.htm
* http://web.ftech.net/~honeyg/articles/eff_stl.htm

0
 
LVL 1

Author Comment

by:loyaliser
ID: 1181875
Cool... you can have the points.
0
 

Expert Comment

by:ahTri
ID: 1181876
beware of the library, especially vector.h is not the same in different compiler (maybe because of the old version)

using namespace std;
this statement dont always work with gcc

the list, algorithm is available but if u are pratising, do it because those library or class provided has lots of redundant functions ( a tree fall in an inhabbited forrest -> it doesnt make a sound)

using iostream and stdio.h : the results may be unpredictable.
0
 
LVL 5

Accepted Solution

by:
yonat earned 20 total points
ID: 1181877
loyaliser, thanks for the points.

ahTri, I do not understand your comments about the STL. You can definitely use it with gcc. There is a very nice portable (and free) version at http://www.metabyte.com/~fbp/stl/
 .
0
 
LVL 1

Author Comment

by:loyaliser
ID: 1181878
Thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question