473,763 Members | 8,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

template from MSVC++ to Linux gcc 3.3.4

Hi,
I am compiling a MSVC++ project on linux gcc 3.3.4.
gcc is whimsical about templates. It does understand the declaration
of the template type PointerList. It scream the error : 'PointerList'
is used as a type, but is not defined as a type. from this sources
code:

class TableFormat
{
public:
TableFormat();
~TableFormat();
protected:
private:
PointerList<Row OrCol> m_cols;
PointerList<Row OrCol> m_rows;
PointerList<Cel lFormat> m_cells;


};

whereas the PointerList is

#include <list>

template <class T>
class PointerList : public std::list<T*>
{
public :
/* some overloaded function */
}

finaly the gcc sentence output:
g++ -v -fabi-version=0 -fpermissive
-I/home/marcel/projets/produit/Development/CompilUnix/src/xerces-c-src1_5_2/src
-I/home/marcel/projets/produit/Development/CompilUnix/src/Glance/include
-I/usr/lib/j2se/1.3/include
-I../../xerces-c-src1_5_2/src/validators/DTD/
-I../../xerces-c-src1_5_2/src/validators/schema/ -c -o
.../model/TableUtilities. o ../model/TableUtilities. cpp
Lecture des spécification à partir de
/usr/lib/gcc-lib/i486-linux/3.3.4/specs
Configuré avec: ../src/configure -v
--enable-languages=c,c++ ,java,f77,pasca l,objc,ada,tree lang
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared
--with-system-zlib --enable-nls --without-included-gettext
--enable-__cxa_atexit --enable-clocale=gnu --enable-debug
--enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc
i486-linux
Modèle de thread: posix
version gcc 3.3.4 (Debian)
/usr/lib/gcc-lib/i486-linux/3.3.4/cc1plus -quiet -v
-I/home/marcel/projets/produit/Development/CompilUnix/src/xerces-c-src1_5_2/src
-I../../xerces-c-src1_5_2/src/validators/common/
-I../../xerces-c-src1_5_2/src/validators/datatype/
-I../../xerces-c-src1_5_2/src/validators/DTD/
-I../../xerces-c-src1_5_2/src/validators/schema/ -D__GNUC__=3
-D__GNUC_MINOR__ =3 -D__GNUC_PATCHLE VEL__=4 -D_GNU_SOURCE
.../model/TableUtilities. cpp -D__GNUG__=3 -quiet -dumpbase
TableUtilities. cpp -auxbase-strip ../model/TableUtilities. o -version
-fabi-version=0 -fpermissive -o /tmp/cczugQh5.s
GNU C++ version 3.3.4 (Debian) (i486-linux)
compiled by GNU C version 3.3.4 (Debian).
GGC heuristics: --param ggc-min-expand=64 --param
ggc-min-heapsize=64445
le répertoire « /usr/i486-linux/include » est ignoré car inexistant
le répertoire « ../../Glance/include » est ignoré car présent deux
fois
le répertoire « ../../xerces-c-src1_5_2/src/util/Transcoders/Iconv400
» est ignoré car présent deux fois
la recherche pour #include "..." débute ici :
la recherche pour #include <...> débute ici:
/home/marcel/projets/produit/Development/CompilUnix/src/xerces-c-src1_5_2/src
/home/marcel/projets/produit/Development/CompilUnix/src/Glance/include
/usr/lib/j2se/1.3/include
/usr/lib/j2se/1.3/include/linux
../../LibJPG/jpeg-6b
../../utilities
/usr/local/include
/usr/lib/gcc-lib/i486-linux/3.3.4/include
/usr/include
Fin de la liste de recherche.
Dans le fichier inclus à partir de ../model/TableUtilities. cpp:1:
.../model/TableUtilities. h:14:25: Pointerlist.h : Aucun fichier ou
répertoire de ce type
Dans le fichier inclus à partir de ../model/TableUtilities. h:15,
à partir de ../model/TableUtilities. cpp:1:
.../model/TextValue.h:19: 1: attention : « NULL » redéfini
Dans le fichier inclus à partir de /usr/include/iconv.h:24,
à partir de
/usr/include/c++/3.3/i486-linux/bits/c++locale.h:43,
à partir de /usr/include/c++/3.3/iosfwd:46,
à partir de /usr/include/c++/3.3/bits/stl_algobase.h: 70,
à partir de /usr/include/c++/3.3/memory:54,
à partir de /usr/include/c++/3.3/string:48,
à partir de ../model/TextValue.h:17,
à partir de ../model/TableUtilities. h:15,
à partir de ../model/TableUtilities. cpp:1:
/usr/lib/gcc-lib/i486-linux/3.3.4/include/stddef.h:399:1: attention :
ceci est la localisation d'une précédente définition
Dans le fichier inclus à partir de ../model/ClippedElement. h:15,
à partir de ../model/TableUtilities. h:16,
à partir de ../model/TableUtilities. cpp:1:
.../model/ContextElement. h:127:29: attention : pas de retour chariot à
la fin du fichier
Dans le fichier inclus à partir de ../model/TableUtilities. h:16,
à partir de ../model/TableUtilities. cpp:1:
.../model/ClippedElement. h:68:29: attention : pas de retour chariot à
la fin du fichier
.../model/TableUtilities. h:125: error: 'PointerList' is used as a type,
but is
not defined as a type.
.../model/TableUtilities. h:126: error: 'PointerList' is used as a type,
but is
not defined as a type.
.../model/TableUtilities. h:127: error: 'PointerList' is used as a type,
but is
not defined as a type.
Dans le fichier inclus à partir de ../model/TableUtilities. cpp:1:
.../model/TableUtilities. h:136:29: attention : pas de retour chariot à
la fin du fichier
make: *** [../model/TableUtilities. o] Erreur 1
Jul 22 '05 #1
3 2018

"Thomas Casanova" <th************ *@serli.com> wrote in message
Hi,
I am compiling a MSVC++ project on linux gcc 3.3.4.
gcc is whimsical about templates. It does understand the declaration
of the template type PointerList. It scream the error : 'PointerList'
is used as a type, but is not defined as a type. from this sources
code:

class TableFormat
{
public:
TableFormat();
~TableFormat();
protected:
private:
PointerList<Row OrCol> m_cols;
PointerList<Row OrCol> m_rows;
PointerList<Cel lFormat> m_cells;


};

whereas the PointerList is

#include <list>

template <class T>
class PointerList : public std::list<T*>
{
public :
/* some overloaded function */
}


I don't see any problem other than the fact that you need a semicolon after
the class definition (assuming other things are correct).
template <class T>
class PointerList : public std::list<T*>
{
public :
/* some overloaded function */
}; // Semicolon here

Sharad

PS - Be carefule when inheriting from STL containers.


Jul 22 '05 #2
Thomas Casanova wrote:
Hi,
I am compiling a MSVC++ project on linux gcc 3.3.4.
gcc is whimsical about templates. It does understand the declaration
of the template type PointerList. It scream the error : 'PointerList'
is used as a type, but is not defined as a type. from this sources
code:
<code snipped>


It looks to me like there are other errors before the one you mention.
You should always fix the first error that appears first, as this may be
causing a knock-on effect, and often later errors will change or
disappear once the first ones are fixed.

Chris
Jul 22 '05 #3
"Sharad Kala" <no************ *****@yahoo.com > wrote in message news:<2v******* ******@uni-berlin.de>...
PS - Be carefule when inheriting from STL containers.


Just don't do it, except privately and if do than never cast up internally.
Jul 22 '05 #4

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

Similar topics

3
1986
by: Michael T Decerbo | last post by:
The code below compiles without warnings or errors under g++ 3.2.1 on Solaris, gcc 3.2.2 on Linux, and MSVC 6.0 on Windows. Under g++ (GCC) 3.3.2, it produces the following errors: % g++ -Wall testme_std.cpp testme_std.cpp:24: error: no `I LblID<I, MaxInd>::add(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)' member function declared in class `LblID<I, MaxInd>' testme_std.cpp:24: error: template...
6
2158
by: Nobody | last post by:
This is sort of my first attempt at writing a template container class, just wanted some feedback if everything looks kosher or if there can be any improvements. This is a template class for a binary search tree. Note there is a requirement for this to be a Win32/MFC "friendly" class, thus the use of CObject and POSITION. There is also a requirement for there not to be a separate iterator class. template <class TYPE, class ARG_TYPE =...
5
1644
by: Gianni Mariani | last post by:
The code below compiles on gcc 3.4.0 and Comeau's 4.3.3 but MSVC++ 7.1 dies complaining about somthing <unknown>. Is this valid ? More to the point, is there any way of doing this that is supported across all 3 compilers ? I want a template to take a parameter and make it it's friend. <code>
1
1465
by: icedac | last post by:
I have some questions about template and c++ itself. ///////////////////////////////////////////////////////////////////////// q1) see follow c++ code, and compile. it's works only IntelC++8.1 but VC71. Do you know why? Which compiler's activity is C++STANDARD? And I wanna be feed back some explain. :)
14
2904
by: Bart Samwel | last post by:
Hi everybody, I would really like some help explaining this apparent discrepancy, because I really don't get it. Here is the snippet: void foo(int&); void foo(int const&); template<typename T>
22
6029
by: Ian | last post by:
The title says it all. I can see the case where a function is to be called directly from C, the name mangling will stuff this up. But I can't see a reason why a template function can't be given extern "C" linkage where it is to be assigned to a C function pointer. Ian
13
1503
by: Thomas J. Clancy | last post by:
I was just wondering. After all these years of working on Visual C++, why hasn't Microsoft yet seen fit to fully implement the template portion of the C++ standard when so many other vendors, both free and commercial, have, or at least have come very close to doing so. I write code in pure C++ and I so often have to ifdef the heck out of my code just to get it to work in Visual C++. Here is a simple example of what I mean:
11
3097
by: Niels Dekker - no reply address | last post by:
The following attempt to pass my template "Base" as a template template argument was rejected by Microsoft VC++ 8.0 (2005), while it still works on VC++ 7.1 (2003). Is it correct C++? And is there a workaround? template <typename T> class Base { }; template <typename U, template <typename> class TempTemp> class Derived;
16
2016
by: xman | last post by:
I defined namespace hpc in main.cpp, so not to clash with other libraries. But I found that, in namespace boo, instantiating a template with a class in namespace hpc, causes compilation errors by clashing the functions in the two namespaces. Is it a compiler bug? or intended C++ behavior? Appreciate if any one can shed some lights for me. See following:
0
9564
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9387
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10002
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9823
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.