Re: [Dev-C++] Export keyword problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <h.r...@gm...> - 2002-06-15 11:08:41
|
> >The book C++ Primer, 3rd edition, Lippmann and Lajoie, speaks on two
> >models of compilation: separation and inclusion. The separation model
> >defines a function in a separate file and it becomes available with the
> >keyword export. I tested this in the Dev and it did not work. The
>
> I do not have this book available, but in a fair number of years of C and
> C++ programming, I have never heard of the "export" keyword, except for
> DLL
> creation in Microsoft compilers. The closest I can think of is the
> "extern" keyword, but it is used to import things from other compilation
> units, and it is _not_ needed to get access to functions.
>
> Could you give one or more quotes from your book, preferably with small
> code examples if possible?
>
Hi,
here a codesnip from "The C++ Programming Language", B. Stroustrup, 3.
German Edition ,
p. 374:
//out.h
template<class T> void out(const T& t);
//out.c
#include <iostream>
#include "out.h"
export template<class T> void out(const T& t) {std::cerr << t; }
Because the missing (until now) of the export keyword in mingw you have to
write the template definition in the header. Perhaps it will be better in
mingw based on gcc 3.1.
greetings
Horst
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
|