LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   where is information/howto for building a project (https://www.linuxquestions.org/questions/programming-9/where-is-information-howto-for-building-a-project-508070/)

fatblueduck 12-06-2006 10:22 PM

where is information/howto for building a project
 
Hi,

I'm interested in writing a small project for the sake of learning how to do it. I would like to use c++ and glade.

I've been downloading source code for other projects as reference and would like to know a few things.

- what are *.h header files? Are they written or generated?
- I can't find a main or parent *.cpp file for running the application in any of the source code that I've downloaded (inkscape and ktoon). Is there a main file? Where should I be looking for it? If there is not a main file, how does the application know what to do when it is started?
- I'm not able to find any file(s) containing window or gui information. Should there be a file there? What should I be looking for? How is the gui generated?

Thanks for any information that you might provide related to these or any other things that I ought to know about.

Penguin of Wonder 12-06-2006 11:23 PM

Header files in C++ are written by you. They generally contain your classes and such. Helps the keep the code organized as opposed to having a GIANT main.cpp.

There isn't always a main.cpp. Well, there is a cpp file that starts the program, but its rarely called main in real programs. At least the program I've looked through the code for.

There are files that contain the GUI information, though I don't know where they're at or what they're called. Outside of VB I've never actually coded a GUI.

How familiar are you with C++ and programming in general? I think it would be best if you stepped back and looked at some simpler code. Taking a course or buying a book would a nice start.

matthewg42 12-06-2006 11:34 PM

If you're not familar with C++, I would urge you to consider another language to start with. C++ is a very complex language, and the learning curve may be a little daunting.

If you are certain you want to use C++, try looking at simpler examples than inkscape (I'm not sure about ktoon). This is a pretty big app, and you'll quickly get lost in the code if you're not careful.

fatblueduck 12-07-2006 03:01 AM

Thanks for the responses.

I am familiar with c++ to the extend that I have taken a class in it. The problem is that I've only written one file for each program that I've written. In order to get the 'real world' c++ experience I want to make something larger. I have written some small c++ files that use glade/gladmm to create an interface. These only consist of one file, and so I haven't invested any time in tying the event-handlers to any process. I understand how that works and I just want to know the answers to these other questions.

I do understand inkscape's and ktoon's code. I need to know where the parent/main file is that is, the one that is calling the various classes and functions, in order to _fully_ understand how everything is working. **edit, I found inkscapes main *.cpp file. It resides as src/application/application.cpp

Now I just need to know more about how the gui is being generated. obviously inkscape does not use glade.


All times are GMT -5. The time now is 06:26 AM.