Results 1 to 4 of 4
Let me explain first what I do not need. I do not, at this time, need help learning C++, nor how to compile. Since I started on microprocessors in 1974, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-24-2003 #1
- Join Date
- Apr 2003
Where to find source so I can modify it?
Let me explain first what I do not need. I do not, at this time, need help learning C++, nor how to compile. Since I started on microprocessors in 1974, I have dealt with a lot of languages of various sorts, usually as an aid for troubleshooting embedded systems, not as a programmer. I have played with Ansi-C, and did produce for fun a simple one page impedance transformation program which was eventually authorized for official use in the contract defense plant where I retired, and assume I can start on my own with C++, perhaps with a tutorial or maybe that $13 package Sam's Club has for sale, and with elbow grease I can at least do simple things. My goals are not high, but I would at least like to see what the linux development guys really do.
No, what I am trying to understand is probably a very simple thing for you guys, but I just can't visualize it, and have been putting this off for several years becaused I can't visualize it. In my experience, when this happens, it's usually a simple thing that I am missing. Sigh.
I want to know generically where to find the existing source in the source packages available for download so I can study/modify it (Um, okay, mostly study it.) I assume it will be in the format produced by an editor, pico or emacs or vi or whatever, before the compile (gcc or whatever). If I have a source package for a linux app of some sort, how will I know it when I look at the files? I have seen *.o and *.h files and probably other files that I forget. Will it be the .o files? I am guessing .h files are libraries like those one specifies at the beginning of a C routine?
And, if I download an "automatic" source rpm for Drake, which apparently starts to compile and install itself instead of loading the files where there name states, how on earth do I access the source for this rpm? Do I run <rpm -qpl rpmname> and go where the files are listed?
I am admittedly slow, but I am steady, as the old saying goes. If I can find the files that look like the ones you guys show when you have a problem, I am confident I can learn the rest. Weird but true.
- 04-24-2003 #2
- Join Date
- Oct 2001
- Täby, Sweden
Uhmm... are you sure that you know ANSI C properly, consider what you said about .h files? Maybe you should take your time and read through this old post, especially the post I made 03 Feb. It will also tell you about the .o files, and why they are certainly not the ones you want to look at.
Anyway, those source RPMs are pretty worthless. Pretty much all they install is the source tarball (.tar.gz) in /usr/src/redhat/SOURCES. You'll have to go there to unpack it. However, you can just as well just download the tarball directly from the project's offical website. For example, if you want the source for GCC, go to http://www.gnu.org/software/gcc/ and download the tarball from there.
Let's just say that I can really understand that you didn't find the sources when you installed the source RPMs. I really don't remember how I found them in the first place.
When you download one of these "automatic" source RPMs, you won't find the source. It's deleted as soon as the rebuilding process is complete.
Also, several guys on this forum might unanimously agree that I'm not the one to speak of these issues, but don't learn C++! IMHO. Anyway, most programs in Linux are written in C, not C++.
- 04-24-2003 #3
- Join Date
- Apr 2003
I believe I did not say I "know" Ansi C well, speaking in the present tense. I did play with it a few years ago and wrote an impedance transformation program which was approved for use in a contract defense plant. When I have not used a language in that many years, I need to start over, though I usually find I am better off than if I had never played with it at all.
As I also said, I am slow but steady. So, if I can find the source stuff, I can take the tutorials (I downloaded one already and they have a $13 one at Sam's Club) and play with it, studying the existing source stuff. It takes time, but there is sort of a linear learning curve. It might be flatter than for you real smart guys, but I still enjoy it.
1. Okay, so I can't find it in the automatic rpm's because it's not there. That does agree with my inability to find it!
2. I can deal with tarballs, bz2's all sorts of stuff. Slow but steady, remember? And, I will look for the tarball in source areas.
Yes, I will look at your old post. Thanks for the tip. If I still can't find the source files, I will be back. I sure don't want to write something from scratch when there is only a minor change to make.
I was surprised at your statement that C is used for most linux stuff. The forums I have been visiting ALWAYS refer to C++. Well, if I can find the suckers, it will be obvious by looking, won't it? Thanks again. I would actually prefer C. When I played with it before, I bought a Borland Dos pack which had both C and Turbo C++, and definitely felt C was more logical and easy to deal with. So, I will not be disappointed if my source is in C.
I was really amused several years later when the original developer of C finally admitted it was written as a practical joke to use left over funds in an account.
- 04-24-2003 #4
- Join Date
- Apr 2003
I went to the tarball, as you said, and this time the .cpp source files were obvious. So, in this case, it will be C++. I am confident I can now do whatever my time and ability enable me to do. Thanks so much.
By the way, I went to your old posting, and learned that .h files were what is listed at top as includes as I remembered, but are header files, not library files. I saved that thread, hope it's not a major federal crime to read it later at my convenience.