🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

moving from MSVC to GCC

Started by
9 comments, last by cnirrad 23 years, 1 month ago
I have recently setup Linux and I would like to start writing programs with linux. However, I have only used IDE''s such as Visual C++, and now I don''t know how to compile my programs on a command line compiler such as gcc. I was able to comile small programs successfully, but I recently tried to compile an application that uses QT. I''m pretty sure my problem is that I''m not linking to QT''s library correctly. How do I do this?? Thanks in advance.
Advertisement
All I can say is get Kdevelop 1.4. Its looks and feels just like MSVC++. It can be DL from here -> www.kdevelop.org It works with QT and OpenGL. I can''t get into using command line based development tools.

Windows SUCKS! Deal with it!
if(windows crashes)
run Linux
else
yea right!!

Resist Windows XP''s Invasive Product Activation Technology!
I don''t know what library to use for qt but this is how you link it

gcc filename.c -L/qtlibraryDir -lqtlibraryfile
Hello from my world
Im not sure why you all think command line development is so difficult, for small projects I can easily type out the gcc command or write a quick shell script to compile it© For larger more complex projects then a makefile or autotools configure script works well too© Is it really too hard to type "make" and wait for it to compile automatically?
CorsairK8@Fnemesis.comLinux Debian/GNU RulezThis is my signitory!C Is Tha Best!
Im not sure why you all think command line development is so difficult, for small projects I can easily type out the gcc command or write a quick shell script to compile it© For larger more complex projects then a makefile or autotools configure script works well too© Is it really too hard to type "make" and wait for it to compile automatically?
CorsairK8@Fnemesis.comLinux Debian/GNU RulezThis is my signitory!C Is Tha Best!
I agree with CorsairK8, it is not that bad, actually I am moving from VC++ to GCC for windows (www.mingw32.org), and I like to use the GCC-Emacs Convination (yes there are versions for windows).
I havent used Kdevelop . . . mostlly because I thought it was more for developing KDE apps, but I will try it.

flame_warrior is right, you do it like he said, in order to find a library though you must know that development libraries in linux have a lib refix and an .a extension but you dont lint to them as the whole name, I am not sure, but I think the QT library is libqt.a so you would compile with -lqt
I recomend you try that add -lqt at the end.
I programming using nothing but commandline tools.
I don''t have X at all. I use vim for all my coding (c/c++), and handwrite my own makefiles. very easy and faster than any crappy IDE. i do debugging using gdb without a frontend, as well. hi-res console is the only way to go on linux.

kdevelop has too much qt-specific stuff that gets in your way of trying to code an actual application.

saai
quote: Original post by flame_warrior

I don''t know what library to use for qt but this is how you link it

gcc filename.c -L/qtlibraryDir -lqtlibraryfile


Most QT apps require that you create a meta-file of sorts with moc

2 other points

Kdevelop looks really neat anti-aliased ( I''ve been looking for somewher to say this, "KDE 2.2 is awesome if not just for the anti-aliasing alone!!!" )

The Kdevelop package contains some very readable docs, tutorials and paths for making QT and KDE code.
The only thing I would want in addition is a good link on how to use autoconf/automake even though Kdevelop does that for you. It just seems to be one of those important things to know somehow...

However, one thing that Kdevelop does not have is the text-editing shortcuts of emacs (or vi--I''ve seen some people do stuff awefully fast with vi). Until Kdevelop gets some emacs shortcuts (or code completion ) I will have to use emacs and ditch an IDE.



joeG

joeG
One other point, Kdevelop, at least in the 2.2-alpha1 release is at 2.0 (and very usable if I might add).

joeG

joeG
QT may not be the best toolkit to write games with, since
QT is more of an application widget set.

You might want to look into GLUT or SDL for starters.

To link to a library, say libXpm, just add -lXpm to the
compiler line (note that the lib prefix is omitted).

If you have libraries in places where they are not checked
normally, ie in /usr/X11R6/lib, then you need to add
a -L/usr/X11R6/lib argument as well to the gcc line.
Tara Milana - WP Entertainmenthttp://wolfpack.twu.net/Comp graphics artist and programmer.

This topic is closed to new replies.

Advertisement