Sign in to follow this  
ronnybrendel

visualstudio-made code portable?

Recommended Posts

I want to start new project now, because i now have the time and motivation :D I want to make my programm with qt so i can compile it under linux windows and other systems. My Question is how to get a visual studio project into compilable form for gcc and friends? imo visualstudio creates no real makefiles or anything ... i know microsoft compiler isnt that good, but i still like the gui of visual studio, with the integrated help and stuff ... at the moment i think about using dev c++. with this tool i have the posibility to use own makefiles (in this case created by qmake) easily, and it uses gcc so it will work on linux too ... summary^^: - can i get a makefile for gcc out of a vc project ? - can i use qt-makefiles in my visualstudio? (because otherwise i cant compile it with qt libraray) - is there any better gui tool than dev c++ ? for this purpose (for free) oneword: i want to work under windows for some reasons [Edited by - ronnybrendel on June 30, 2005 7:39:53 AM]

Share this post


Link to post
Share on other sites
Hi ronnybrendel.

First, you can export makefile with MS Visual Studio 6. Menu "Project/Export makefile...". Unfortunaly, this makefile is for the MS compilers. I don't think you can use it for others compilers.

Second, qt can be compiled with MS Visual Studio, so don't be afraid of using it.

Third, I know Eclipse http://www.eclipse.org/ whitch I used in Java and it is good. Combined with the CDT http://www.eclipse.org/cdt/ Eclipse become a ide for C++. I didn't use it yet, so I can't say if it is good.
Another possibility is use plain text editor (like texpad http://www.textpad.com/, it gives syntax color) and a command line compiler. I agree it is not the best environment, but if you can use it, you will be able to deel with all environments, from the most primitive to the five stars ide.

Last thing. If you like MS Visual Studio, fell good to use it. If you use a portable libraries (like qt) and if you use nothing MS specific, your code will compile on any platform. And, re-write a project file, or a makefile, it is not a big deel (50 lines) for a graphical program (at least 5000 lines).

Please don't mind my English, it is not my first language.

I hope I helped you.
Ghyslain Abel

Share this post


Link to post
Share on other sites
Quote:
Original post by Ghyslain
Third, I know Eclipse http://www.eclipse.org/ whitch I used in Java and it is good. Combined with the CDT http://www.eclipse.org/cdt/ Eclipse become a ide for C++. I didn't use it yet, so I can't say if it is good.


I have, I can, and it is good :-). Graphical debugger frontend for GDB and everything. If you create an "Managed C++ Make Project", it'll automatically create/mantain/use your makefiles - ever since I upgraded from the 2.1 branch to 3.0 I havn't touched a makefile. I run it on Windows atop the MinGW GCC (although I recently installed Cygwin for some of the other tools - mainly *nix versions of normal commands - e.g. installing rm so Eclipse won't complain about it missing, makefiles of some libraries, etc). Since it's written in Java, and assumes it layers atop a *nix-eqsue toolset (make, g++, and rm) you should have no problems running it under Linux.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ghyslain
Second, qt can be compiled with MS Visual Studio, so don't be afraid of using it.

Quote:
Original post by Ghyslain
Last thing. If you like MS Visual Studio, fell good to use it. If you use a portable libraries (like qt) and if you use nothing MS specific, your code will compile on any platform. And, re-write a project file, or a makefile, it is not a big deel (50 lines) for a graphical program (at least 5000 lines).


are you sure?

because to compile qt programs you need that tool called "moc" and i doubt visual studio will realize this.... moc translates some qt specific code in normal c++ (moc is a source to source translator)

i ll check out that export makefile...

at the moment i got qt with mingw ...

i dont know eclipse^^ .. i ll try out :O

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i've written tons of applications that compile and run on multiple platforms(win32, macosx, linux) in msvc. hell, most of them even used ms-specific stuff. it's usually not much more than using some #ifdef's, some os-specific implementations of some base-interfaces, and/or some custom makefiles.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i've written tons of applications that compile and run on multiple platforms(win32, macosx, linux) in msvc. hell, most of them even used ms-specific stuff. it's usually not much more than using some #ifdef's, some os-specific implementations of some base-interfaces, and/or some custom makefiles.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
i've written tons of applications that compile and run on multiple platforms(win32, macosx, linux) in msvc. hell, most of them even used ms-specific stuff. it's usually not much more than using some #ifdef's, some os-specific implementations of some base-interfaces, and/or some custom makefiles.


would be interessting howto compile qt with vs .. if you know
by the way i haven´t written tons of apps ... because i am a newbie :>

Share this post


Link to post
Share on other sites
Good news for you (maybe) is that Qt 4 was recently released, including a GPL version for windows. All kinds of visual studio integration (a -lot- more so then Qt 3 had it seems)

Even with Qt3 noncommercial (which you could get with a book, I believe), it added a "moc" button to visual studio where you just selected the file that needed moc-ing and hit the button and then VS handled it from there on out via post/pre compile options.

Seems with Qt4, they added all the UI design stuff to Visual Studio as well. (good thing too, I never really liked qt designer...)

http://www.trolltech.com/products/qt/vs-integration.html

Share this post


Link to post
Share on other sites
Quote:
Original post by ronnybrendel
i know microsoft compiler isnt that good, but i still like the gui of visual studio, with the integrated help and stuff ...

Last time I checked it was still the most compliant compiler out there.

Share this post


Link to post
Share on other sites
"http://www.trolltech.com/products/qt/vs-integration.html"
i read this ^^ but anyways thank you for trying to help

one problem: "... das Framework erstmalig auch unter Windows unter der GNU General Public License (GPL[4]) zu haben sein. In dieser Variante fehlen allerdings einige Treiber für kommerzielle Datenbanken sowie die Integration der Qt-Design- und Entwicklungswerkzeuge in Visual Studio[5] .NET 2003."

is news-press from ger^^:
means:
only NON opensource-qt4 will have this plugin integration for visualstudio ...
:( bad news

i keep an eye on it and search a bit ... hopefully i find some integration for this ...

Share this post


Link to post
Share on other sites
In most versions of Visual Studio, you can tell it "use my custom makefile command to build instead of the Visual Studio build stuff". In Visual Studio .Net (all versions so far), these options are in the project preferences.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i cant find options to use custom makefiles or anything in my vs 2003 ...

anyone can help?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
i cant find options to use custom makefiles or anything in my vs 2003 ...

anyone can help?
You have to create a makefile-based project from the start, tweaking a few settings on an active project won't be enough.
Beware that maintaining dependency rules manually is quite error-prone..

Share this post


Link to post
Share on other sites
awesome!

thanks for the hint^^

would have never found this...


edit:::::::::::::

it works. nice
thanks to all replyers

i now use make and gcc + qt-stuff for compiling ... works great after little setup

[Edited by - ronnybrendel on July 2, 2005 6:59:54 AM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this