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.
I have relatively large piece of source code that needs to be built in the Linux Environment. The code originally written in MS VS in Windows. We used QT functions for easy portability. The source files are scattered through the folder structure. Project's sources are not located in one source folder. (I didn't write the software).
Now I need to decide how to build the software on Linux. I thought Makefiles would be best. I saw some tutorials that made them seem easy. I do know if a makefile was successfully created, this will save time during the build process. Control Management are not software engineers and easily lead towards confusion. "What do you mean by ..." With a make file, they just need to type a line! However, another coworker claimed they were super difficult and error prone and suggested using Eclipse C/C++ to create the build.
I installed Eclipse C/C++. There is seemingly no way to add source code in different folders to one project. If this is true, Eclipse will be a pain. I wanted to maintain folder structure and link to .cpp files. This will prevent duplicates of files. However, once the Eclipse projects are set up, debugging will be easy. Also, the other engineers are used to GUIs/IDEs instead of command prompts, vim, and other native Linux programs.
Both solutions seem to have pros and cons. What have your experiences been? I also would like some opinions beyond my co-worker.
I normally use an IDE for large projects with deep directory trees (I consider any more than three levels deep for source trees).
Makefiles are one of the more cryptic aspects of *nix programming -- and one of the very few places where white space matters.
Tabs do not equal spaces in a makefile (they've overloaded the whitespace operator )
That being said, I also frequently modify makefiles by hand.
I'd have a look at other largish projects for makefile examples.
Qt has its own make file program qmake. This is available for both windows and Linux (and Mac of course) qmake is well documented and typically easier to set up than make. The IDE can then be configured to use the "make" file. I alternate between using KDevelop and QDevelop, the later being an IDE written using QT and is thus available on your target OS (whatever that may be) both IDEs allow me to use multiple directories, I can't talk for Eclipse since I rarely use it but I would be surprised if it didn't manage project files scattered all asunder.
As graemef already mentioned, qt has its' own qmake-build system (based on *.pro files), which is cross-platform. So the best idea would be using that syste where it is possible.
However, if you want something different...
Quote:
Originally Posted by Katherine
IHowever, another coworker claimed they were super difficult and error prone and suggested using Eclipse C/C++ to create the build.
I don't think you really want to use raw hand-written makefiles for large projects. Idea of ide is also bad.
Using scons with it's SConstruct scripts, or gnu autotools would be better. Both those systems are "higher level" when compared to raw makefiles.
project file (*.pro) for qmake are really easy to understand and write by hand, then qmake transforms your pro file into makefile.
That said, eclipse is not too bad for developing Qt applications, but you'll need the Qt plugin you can found on the trolltech site.
However, I prefer work without IDE, just gvim + ctags + svn and pro files by hand because I know how to use these tools and, my little experience with eclipse and svn plugin wasn't great, I've wasted so many time by trying to resolve some issues, and worst, I don't find the way to have more than one application target in the same eclipse project...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.