Author Topic: keyword 'export' not implemented; 'wcout' undeclared  (Read 6417 times)

Francesco

  • Guest
keyword 'export' not implemented; 'wcout' undeclared
« on: April 19, 2007, 04:46:34 pm »
Hi all,
during the build of a program, C::B reported the following messages:

warning: keyword 'export' not implemented

And this seems quite clear.
The questions are:
Is this feature missing from C::B or from the compiler?
How can I use this feature inside C::B?

error: 'wcout' undeclared

And this is less clear.
Of course, I have included the <iostream> header, and "wcout" should be visible (just like "cout" is).
The questions are:
Am I missing some part of the STL?
Can I upgrade it?

All in all, you can guess that I am not a pro.
I've just bought the Stroustrup's book and learnt from practice, with the help of an experienced programmer, but now I am stuck in the templates and in the wchar thing.

The first problem can be worked around including the definitions of the templates in the unit where I am using them, but I'd like to do things better and include only the declarations.

About the second problem, I have no idea.

I have already searched the forum, but I wasn't able to find any topic about these issues.

Thank you for your attention.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: keyword 'export' not implemented; 'wcout' undeclared
« Reply #1 on: April 19, 2007, 05:06:21 pm »
Both of these issues are to do with the MinGW compiler rather than Code::Blocks.

For the "export" keyword issue, the solution is to include the entire definition of the template class in the header file. This entry in the C++ FAQ Lite helps explain things.

For the wcout issue, you might be able to fix it by adding "_GLIBCXX_USE_WCHAR_T" (sans quotes) as a preprocessor #define (see line 68 of iostream). The reason this is necessary is that the version of GCC that MinGW distributes doesn't fully support Unicode (wide-char) functionality; setting the _GLIBCXX_USE_WCHAR_T macro enables what functionality there is.

Cheers,
JohnE / TDM
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Francesco

  • Guest
Re: keyword 'export' not implemented; 'wcout' undeclared
« Reply #2 on: April 19, 2007, 05:48:19 pm »
I have added that #define line, but "wcout" still results to be undeclared, so I think there is no chance to make it work on my system. Not that bad, it was just the desire of trial and error of the apprentice.

About the "export" issue, I'll go on including the definitions.

Thank you for your quick and clear reply, TDragon.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: keyword 'export' not implemented; 'wcout' undeclared
« Reply #3 on: April 19, 2007, 06:05:44 pm »
Actually, after further experimentation of my own, I have discovered that wide-char support is missing from MinGW's Standard C++ Library, so although it's in the headers the linker won't be able to find it.

Good luck!
- JohnE / TDM
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Francesco

  • Guest
Re: keyword 'export' not implemented; 'wcout' undeclared
« Reply #4 on: April 19, 2007, 08:43:02 pm »
Quote from: Francesco
I have added that #define line, but "wcout" still results to be undeclared
What a silly creature am I... it was still undeclared because I have defined the macro after having included the iostream header...

Actually, after further experimentation of my own, I have discovered that wide-char support is missing from MinGW's Standard C++ Library, so although it's in the headers the linker won't be able to find it.

Good luck!
- JohnE / TDM

...in fact, now I have swapped those two statements and it gives another error inside of a STL source file.

Thank you again for the informations, TDragon.