473,546 Members | 2,244 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Correct C++ tutorial part 5 "How to use libraries" available (Windows, mingw/msvc/std)

The fifth part of my attempted Correct C++ tutorial is now available,
although for now only in Word format (use free Open Office if no Word), and
also, it's not yet been reviewed at all -- comments welcome!

"How to use libraries"
<url: http://home.no.net/dubjai/win32cpptut/w32cpptut_01_05 .doc>

General URL:

<url: http://home.no.net/dubjai/win32cpptut/html/>

which provides parts 1 and 2 as web-pages (HTML) in addition to the
original Word documents of parts 1 through 5.

This fifth part is very concrete, very tool-oriented, and is therefore
possibly more difficult (it was far more difficult and time-consuming
to write than the earlier parts), and I think therefore also has a higher
chance of containing errors, sub-optimal ways of doing things, etc.

Contents, part 5:
1 [Background:] Classes, members & optional arguments.
2 Use library-specified types.
3 Find a library (or: find a set of libraries...).
4 Use a make-tool to build a library (long).
5 Use a Unix-like build environment for the GNU tools (long).
6 Do the same things for a second library (it's easier now!).
7 Create a library manually (the third time's the charm!).
8 Fix invalid C++ source code (the "old iostream" problem).
9 Use a library: create a picture programmaticall y.
10 Use header file wrappers (introducing the C++ preprocessor).
11 Use compiler response files.

As before, the point of inviting comments is to _fix_ anything incorrect, or
the presentation, or whatever; your input is valuable, and you can thereby
help those who stumble across this tutorial and use it to learn C++.

Thanks in advance,

- Alf

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #1
10 2039
Alf P. Steinbach wrote:
The fifth part of my attempted Correct C++ tutorial is now available,
although for now only in Word format (use free Open Office if no Word), and also, it's not yet been reviewed at all -- comments welcome!

"How to use libraries"
<url: http://home.no.net/dubjai/win32cpptut/w32cpptut_01_05 .doc>

General URL:

<url: http://home.no.net/dubjai/win32cpptut/html/>

which provides parts 1 and 2 as web-pages (HTML) in addition to the
original Word documents of parts 1 through 5.

This fifth part is very concrete, very tool-oriented, and is therefore possibly more difficult (it was far more difficult and time-consuming
to write than the earlier parts), and I think therefore also has a higher chance of containing errors, sub-optimal ways of doing things, etc.


Howdy Alf, this is very good, but don't you think you should dive into
the bbasics of e.g. classes and other language semantics before going
into creating libraries etc...?
I would prefer if this was chapter 10 maybe instead of chapter 5...

Thomas

--
www.frostinnovation.com THE Pocket PC Service System Provider

Jul 23 '05 #2
* Thomas Hansen:

Howdy Alf, this is very good, but don't you think you should dive into
the bbasics of e.g. classes and other language semantics before going
into creating libraries etc...?
Well it's either that or use very platform-specific examples (e.g.
Windows API metafiles) or only very very dull examples or, write some
articially easy-to-use support libraries, perhaps with installer...

I did write a simple XBM image generator (an XBM image file is pure text,
actually C source code, which means std::cout is all the tool you need to
generate an XBM image file), but black/white is boring and Internet
Explorer 6.x doesn't seem to support the format, although reportedly
almost all other browsers do. I know earlier versions supported XBM for
internal web-page scripting. Perhaps IE 6 does still, haven't checked.

But the main reason I decided to go "out on the net" to fetch a library
was to _get real_, because it's the actual requirements of using real
code that drives the learning curve (in my experience, that is): which
features and tools and techniques need to be introduced and in what order.
Generating a PNG picture is trivial in C# + .NET, a beginner's task. It
shouldn't be that hard in C++, and it really isn't: it's just the tool
usage to (once) install the necessary libraries that is a bit complex.

I would prefer if this was chapter 10 maybe instead of chapter 5...


Heh. :-)

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #3
al***@start.no (Alf P. Steinbach) wrote in message news:<42******* *******@news.in dividual.net>.. .
* Thomas Hansen:

Howdy Alf, this is very good, but don't you think you should dive into
the bbasics of e.g. classes and other language semantics before going
into creating libraries etc...?


Well it's either that or use very platform-specific examples (e.g.
Windows API metafiles) or only very very dull examples or, write some
articially easy-to-use support libraries, perhaps with installer...

Might initial reaction was that I can't think of any sort of audience
that would have the patience to go through all the steps required to
download 2 or 3 separate libraries, configure/produce makefiles to
build them (even with a helping hand), and even modify the source to
get it to compile, but would not know what a member function was, or
even how to write a function (which you mention as the "next step" at
the end).

Having said that, I actually appreciate the fact that this tutorial
doesn't try to make everything look super simple - it all-too-honestly
recognises and addresses many of the typical complications that
programmers have to face when developing applications of any level of
sophistication. But Thomas is right, it's basically a chapter 10
tutorial, not a chapter 5 one.

Yes, it's unfortunate that there isn't a very very simple graphics
format that could both be generated by the most basic of C++ programs
and that most Windows users would be able to view without downloading
additional software, but if you really are keen to get users to
generate graphical images that soon, then I'd suggest having to
download an XBM or PNM viewer for Windows is a loss less work than
everything you're currently expecting of the poor novice programmer!
Jul 23 '05 #4
* Dylan Nicholson:
al***@start.no (Alf P. Steinbach) wrote in message news:<42******* *******@news.in dividual.net>.. .
* Thomas Hansen:

Howdy Alf, this is very good, but don't you think you should dive into
the bbasics of e.g. classes and other language semantics before going
into creating libraries etc...?
Well it's either that or use very platform-specific examples (e.g.
Windows API metafiles) or only very very dull examples or, write some
articially easy-to-use support libraries, perhaps with installer...

Might initial reaction was that I can't think of any sort of audience
that would have the patience to go through all the steps required to
download 2 or 3 separate libraries, configure/produce makefiles to
build them (even with a helping hand), and even modify the source to
get it to compile, but would not know what a member function was, or
even how to write a function (which you mention as the "next step" at
the end).


The description is incorrect: there's no "configure/produce makefiles".

The makefiles are made by those who created the libraries.

Also, why on Earth should a _patient_ person necessarily know about
C++ member functions?

Having said that, I actually appreciate the fact that this tutorial
doesn't try to make everything look super simple - it all-too-honestly
recognises and addresses many of the typical complications that
programmers have to face when developing applications of any level of
sophistication.
"all-too-honestly"?

But Thomas is right, it's basically a chapter 10
tutorial, not a chapter 5 one.


There are no prerequisites apart from a little patience and "can do" attitude.

People do not get more patient and "can do" as they learn more C++, they do
not develop new personality traits (except for a slight tendency to mutter
hexadecimal phrases), and knowing more C++ won't help in installing libraries.

Hence there's no good reason to wait.

Why should the reader be denied the tools to actually _do_ something?

What is accomplished by waiting, like no sex before marriage?

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #5
Alf P. Steinbach wrote:
The description is incorrect: there's no "configure/produce makefiles".

The makefiles are made by those who created the libraries.

Also, why on Earth should a _patient_ person necessarily know about
C++ member functions?

I am a newcomer to Windows programming and do not use any makefiles. In
fact I do not know what exactly they are. So I suppose makefiles is a
system dependent thing, and I think a C++ tutorial should not be
concerned with implementations but only with ISO C++.

And BTW keep it as simple as possible.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #6

Alf P. Steinbach wrote:
* Thomas Hansen:

Howdy Alf, this is very good, but don't you think you should dive into the bbasics of e.g. classes and other language semantics before going into creating libraries etc...?


Well it's either that or use very platform-specific examples (e.g.
Windows API metafiles) or only very very dull examples or, write some
articially easy-to-use support libraries, perhaps with installer...


Well, you could have progressed pretty far beyond branching by just
doing things like this first:
class Base
{
public:
virtual void foo()
{
std::cout << "Base::foo( )";
}
};

class Derived : public Base
{
public:
virtual void foo()
{
std::cout << "Derived::foo() ";
}
};

int main()
{
std::auto_ptr<B ase> ptr( new Derived() );
ptr->foo();
return EXIT_SUCCESS;
}

....
Just my two cents...
But I like to learn the language semantics before I learn how to use
third part libraries/tools/etc...

All though that chapter is pretty importent I think it's wise to first
learn how to crawl, then to walk and then to think things like "why
walk when I can drive"...
;)
..t

Jul 23 '05 #7
* Ioannis Vranos:
Alf P. Steinbach wrote:
The description is incorrect: there's no "configure/produce makefiles".

The makefiles are made by those who created the libraries.

Also, why on Earth should a _patient_ person necessarily know about
C++ member functions?

I am a newcomer to Windows programming and do not use any makefiles. In
fact I do not know what exactly they are. So I suppose makefiles is a
system dependent thing,


Makefiles originated, as far as I know, with the Unix system, but are
now supported on all major platforms.

A typical makefile specifies how to build something, by listing
goals to be achieved (typically files to be produced), dependencies
between goals (the make tool checks the modification times of files
and infers from that and the dependencies which goals to pursue in
which order to do the minimum necessary for the top-level goal), and the
commands to be executed to achieve each goal.

Makefiles, or some other build automation such as Ant or your
favorite IDE's build command (which probably uses a generated makefile!)
are necessary to create things that consist of more than one C++ source
file, and/or to create things that are to be more-or-less _portable_,
to automate the (re)build process.

In medium or large projects makefiles can be preferred over IDE "projects"
because they can work with almost any tools, and are independent of IDE.

But in the same way as with C++ it's possible to write non-portable and
tool-specific makefiles.

and I think a C++ tutorial should not be
concerned with implementations but only with ISO C++.
Well, as I see it it's in the nature of a tutorial to be concerned with the
in-practice, but that doesn't mean to teach some dialect of C++: I think
you'll find that so far it's been only straight ISO C++.

And BTW keep it as simple as possible.


I'm trying -- but no simpler... ;-)

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #8
* Thomas Hansen:

.... you could have progressed pretty far beyond branching by just
doing things like this first:
class Base
{
public:
virtual void foo()
{
std::cout << "Base::foo( )";
}
};

class Derived : public Base
{
public:
virtual void foo()
{
std::cout << "Derived::foo() ";
}
};

int main()
{
std::auto_ptr<B ase> ptr( new Derived() );
ptr->foo();
return EXIT_SUCCESS;
}

...
Just my two cents...
But I like to learn the language semantics before I learn how to use
third part libraries/tools/etc...

All though that chapter is pretty importent I think it's wise to first
learn how to crawl, then to walk and then to think things like "why
walk when I can drive"...
;)


I agree with the premises but I think they support and imply the exact
opposite conclusion... ;-)

Namely, learn how to use things that are designed to be easy to use before
learning to create them, which can be very difficult and can involve a really
staggering amount of detail unrelated to the immediate goals. For example,
learn how to drive a car before learning to design one. Would you rather
start with learning how to modify the engine to support faster driving?

There's an amount of trust involved, I think. The reader must trust that I
know of what I'm talking about and the way I'm pointing out and leading the
party onwards on. Explaining all the time that this will make sense later is
in my view an exercise in futility, since that's exemplified again and again;
but if the basic trust isn't there to begin with it might seem continually
surprising (e.g., the personell manager in a large consulting firm once asked
me right out whether I intentionally said and wrote things that only made
sense -- i.e. to some other persons -- some time later down the road, and
that's one price to pay for doing things right in the first place; to get a
_consensus_ that something is right, when one isn't in a position of being a
recognized authority, the issues must first be demonstrated and experienced
personally by the involved persons, and that can have a huge cost).

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #9
al***@start.no (Alf P. Steinbach) wrote in message news:<42******* *********@news. individual.net> ...
* Thomas Hansen:

All though that chapter is pretty importent I think it's wise to first
learn how to crawl, then to walk and then to think things like "why
walk when I can drive"...
;)


I agree with the premises but I think they support and imply the exact
opposite conclusion... ;-)

Namely, learn how to use things that are designed to be easy to use before
learning to create them, which can be very difficult and can involve a really
staggering amount of detail unrelated to the immediate goals. For example,
learn how to drive a car before learning to design one. Would you rather
start with learning how to modify the engine to support faster driving?

Nifty analogy, but your current tutorial goes at great lengths to
explain which shops sell cars, where to find them, how to purchase
one, how to get it home, then all the various
adjustments/customizations you might need to make to it before you can
even start it. I wouldn't normally consider this part of "learning to
drive".

So ideally the user shouldn't need to worry about how the library gets
on to their machine, and getting it ready for use should be a
no-brainer. Unfortunately this isn't really possible unless you
severely limit the number of possible platforms - but it seems you
have already done this anyway. Is it not possible/legal for you to
just provide the libraries already built and ready-to-go for download,
along with the most basic instructions necessary to link them into the
application?

Anyway, at the end of the day, you need to test-drive the tutorial on
some newbies. If you find that they are happy to follow all the
instructions you give just to create their first
programmaticall y-generated image, then all's well and good, and you
can ignore our carping cynicism!
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5353
by: Pete Mahoney | last post by:
Ok I use a textarea to store data input by the user, and then upon them clicking the submit button I store this data to a database. The problem is once the user inputs too much data (about 3 paragraphs or 2020 characters) when they click on the submit button nothing happens. When I say nothing happens I mean just that, nothing at all happens...
5
4372
by: John Oliver | last post by:
I'd like the email produced by FormMail to show a specific From: address rather than postmaster@server.host.name Googling isn't helping me... not sure what to look for :-( -- * John Oliver http://www.john-oliver.net/ * * California gun owners - protect your rights and join the CRPA today! * * ...
20
2714
by: John Bailo | last post by:
http://www.joelonsoftware.com/articles/APIWar.html "So you've got the Windows API, you've got VB, and now you've got .NET, in several language flavors, and don't get too attached to any of that, because we're making Avalon, you see, which will only run on the newest Microsoft operating system, which nobody will have for a loooong time....
44
4161
by: Tolga | last post by:
As far as I know, Perl is known as "there are many ways to do something" and Python is known as "there is only one way". Could you please explain this? How is this possible and is it *really* a good concept?
1
2246
by: uli2003wien | last post by:
Dear group, i am a seasoned DB2-veteran (6 years exp.) on the Windows- and Linux-Server platform. Once in a while i had a look into DB2 on the mainframe but mostly only watching other people do the job. Currently i have an offer to go into a very big shop which runs DB2 on the mainframe (OS is not yet specified, but they talk about VSAM,...
6
2553
by: Chris Stankevitz | last post by:
At link time, MSVC determines some of my libraries are unused and doesn't link them into my exe. This undesirable feature causes problems when I employ the factory pattern. With the factory pattern, the app decides at run time which code to use. Is there a link option to turn of this feature? MSVC 7.1 .net 2003 69462-270-0000007-18536 ...
0
1092
by: eljainc | last post by:
Hello, I'm looking for an imaging library that is compatible with Visual Studio 2005 that has imaging/display capabilities to that of ITunes. What I mean is the part of the ITunes program that shows all of the album art in a collection, and allows the user to scroll through a collection of images (similar to a Jukebox) or manipulate it in...
2
2363
by: anon.asdf | last post by:
Hello! 1) =============================== When trying to define an array of std::string ... func( (std::string ) { std::string("ab"), std::string("cd"), std::string("ef") } , 3 ); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ....g++ tells me: "invalid use of non-lvalue array"
26
3861
by: Jake Barnes | last post by:
I did a search on the newsgroup comp.lang.javascript. I was searching for "how to play a sound with Javascript". I'm somewhat suprised that the majority of entries are from the 1990s, and there are almost no posts from the last 3 years: ...
0
7435
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7698
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7461
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7794
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3492
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1922
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.