Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Studio and GNU compilers

Status
Not open for further replies.

Haunter

Programmer
Jan 2, 2001
379
US
I would like to use the assest of Visual Studio for development but I would like to compile my code with the GNU Complier gcc. Is this possible? If so does anyone know of a tutorial for the setup?

Thanks


haunter@battlestrata.com
 
Why do you want to compile with gcc, it doesn't even has an optimizer. If you want to compile on a unix machine, I suppose that makes sense, but otherwise I can't see a reason. Anyway, it shouldn't be hard, just learn to create a gcc makefile, and as long as you don't use any MS-only C++ stuff (like __int64) you shouldn't have too much trouble, just copy the source files and do it like you normally would.
 
I am part of an open source project in which part of the specification is to be portable as possible. The Admin of the project is using GNU tools for the compiling of the code. It is not my own concotion to do it this way. I am just trying to make my life a little simpler by keeping the IDE the same. I am very UNFAMILIAR with GNU tools. I have not ever compiled a project with Autotools before. I was just hoping for a simple solution. Any detailed help is apprectiated.

Thanks


haunter@battlestrata.com
 
> Why do you want to compile with gcc, it doesn't even has an optimizer.
Huh?
gcc optimisations

@Haunter
Two things I can think of.
1. ask the rest of your open source project to see if any of them have ideas. If it's a large group, chances are someone else is in the same position.

2. You can customise external tools (in VC6 at least), which can easily be made to invoke 'make' to do all the work of invoking the compiler for all the files in the project.

I assume you've already downloaded a gcc compiler and a make tool?

--
 
I saw benchmarks a while back of gcc code vs VC++ 7 code and VC++ 7 was faster. Someone told me that gcc didn't have an optimizer, but I guess they were wrong. Thanks for pointing this out.
 
Going the other way is a lot easier... Making it for gcc will make it comply with ANASI C99 standards (as long as you don't use any POSIX stuff like pthread), and so it is easier to move. Getting good with a decent Unix/Linux editor (preferably onw with a DOS/Windows port) can make life as simple as VC++'s bloated IDE.

timmay, benchmarks are often skewed by what paces they put the put the code/machine/ect through. gcc was deveoped on Unix/Linux and any dos port will be slower. Comparing VC++ code on a different OS than g++ means that there are a lot of other variables to take into account. Where the benchmarks for GUI programs? Then you'd also have to take into account the windowing enviroment. I can create a benchmark test that will yeild whatever result I want, so always look at who hired the people running the benchmark. Different compilers do different things better, if you plan to take advantage of things you know one is better at then the other your benchmark is no longer fair. Next your going to tell me that the most important factor in buying a computer is the clock speed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top