473,414 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Problems using omanip

Hi,

I am having some difficulties compiling a library written by someone else,
and was hoping someone could indicate what's wrong! I have cut the code
down to what I believe to be the relevant part. If anyone can suggest how
to make the following code compile it would be greatly appriciated.

#include <iostream>
#include <iomanip>

std::ostream& ket(std::ostream& os, char* ket_val)
{
return os << " |" << ket_val << '>';
}

std::omanip<char*> ket(char* ket_val) //Error occurs here
{
return std::omanip<char*> (ket, ket_val);
}

From the compiler (g++ 3.3.1) I get:

test.cc:9: error: syntax error before `(' token

I believe the code was supposed to compile on earlier versions of the
compiler. I have made small changes such as removing '.h' from the headers
and putting 'std::' before some classes.

Thanks in advance for any help you can give,

David
Jul 22 '05 #1
2 2023
"David Williams" <es***@yahoo.co.uk> wrote...
I am having some difficulties compiling a library written by someone else,
and was hoping someone could indicate what's wrong! I have cut the code
down to what I believe to be the relevant part. If anyone can suggest how
to make the following code compile it would be greatly appriciated.

#include <iostream>
#include <iomanip>

std::ostream& ket(std::ostream& os, char* ket_val)
{
return os << " |" << ket_val << '>';
}

std::omanip<char*> ket(char* ket_val) //Error occurs here
There is no template "omanip" in C++ standard library.
{
return std::omanip<char*> (ket, ket_val);
}

From the compiler (g++ 3.3.1) I get:

test.cc:9: error: syntax error before `(' token

I believe the code was supposed to compile on earlier versions of the
compiler. I have made small changes such as removing '.h' from the headers
and putting 'std::' before some classes.


It doesn't make a class standard if you simply put 'std::' before it.

If you've been using some kind of library extension and want to keep
using it, please talk to GCC people. In the Standard C++ there is no
'omanip'.

Victor
Jul 22 '05 #2
Ok, if it's not standard C++ I'd probably rather not be using it anyway.
I'll probably try to replace it with my own code to do something similar.
Thanks for your help.

David

Victor Bazarov wrote:
"David Williams" <es***@yahoo.co.uk> wrote...
I am having some difficulties compiling a library written by someone
else, and was hoping someone could indicate what's wrong! I have cut the
code down to what I believe to be the relevant part. If anyone can
suggest how to make the following code compile it would be greatly
appriciated.

#include <iostream>
#include <iomanip>

std::ostream& ket(std::ostream& os, char* ket_val)
{
return os << " |" << ket_val << '>';
}

std::omanip<char*> ket(char* ket_val) //Error occurs here


There is no template "omanip" in C++ standard library.
{
return std::omanip<char*> (ket, ket_val);
}

From the compiler (g++ 3.3.1) I get:

test.cc:9: error: syntax error before `(' token

I believe the code was supposed to compile on earlier versions of the
compiler. I have made small changes such as removing '.h' from the
headers and putting 'std::' before some classes.


It doesn't make a class standard if you simply put 'std::' before it.

If you've been using some kind of library extension and want to keep
using it, please talk to GCC people. In the Standard C++ there is no
'omanip'.

Victor


Jul 22 '05 #3

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

Similar topics

0
by: Jerome Lefebvre | last post by:
Hello, Hope this will interest a few. I been working with a friend on the problems given out during the "International Collegiate Programming Contest" (ICPC) http://icpc.baylor.edu/icpc/ ....
14
by: Jim Hubbard | last post by:
Are you up to speed on the difficulties in using the 1.1 .Net framework? Not if you are unaware of the 1,596 issues listed at KBAlertz (http://www.kbalertz.com/technology_3.aspx). If you are...
26
by: jamesbeswick | last post by:
I've been using Access since version 97 and I've migrated to 2003. I've noticed a substantial number of strange ActiveX/OLE and code corruption problems when writing databases. The only solution...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
0
by: Peter R. Vermilye | last post by:
I am involved on a web application that is using a third party set of APIs for remote database access (middleware). I've been brought in because of my background in programming, thus I'm new to...
3
by: Andreas | last post by:
Hi! I'm currently developing a DLL that makes use of C++ and .net (mixed) using Visual Studio 2003. Now, as I wanted to move to the new Visual Studio 2005, I converted this project into the...
2
by: Mike | last post by:
Hi, I am new to C and having problems with the following program. Basically I am trying to read some files, loading data structures into memory for latter searching. I am trying to use structres...
9
by: =?Utf-8?B?SG93YXJkIFNtaXRo?= | last post by:
I am using VC++ 6.0 (with SP5 installed). When using WinXP this is with SP2 installed. I am developing an instrumentation system comprising a set of networked PCs connected using TCP/IP TCP links....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.