xunzhang / gflags

Automatically exported from code.google.com/p/gflags
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

DEFINE_string does not work if string is not in global namespace #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.

a.cc:

#include <google/gflags.h>

DEFINE_string(example, "314", "example");

int main(int argc, char** argv) {
  google::ParseCommandLineFlags(&argc, &argv, true);
}

2.

g++ -o a.o -c a.cc

3.

What is the expected output? What do you see instead?
Should compile, instead:
a.cc:3: error: expected initializer before '*' token
a.cc:3: error: 'FLAGS_noexample' was not declared in this scope

What version of the product are you using? On what operating system?

glags 0.9
ubuntu 7.10 
g++ (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

Please provide any additional information below.

some std:: are missing from gflags.h, gflags.h.in etc. This is a problem if
string is not declared in global namespace by using namespace std or using
std::string. 

Original issue reported on code.google.com by marton.m...@gmail.com on 13 Aug 2008 at 10:44

GoogleCodeExporter commented 9 years ago
Doh!  I just left out a std::.  (I only found one missing, if you see any more 
please
let me know.)

I'll try to get out a new version of gflags, with this fix, later tonight if i 
can,
but at least this week.

Original comment by csilv...@gmail.com on 19 Aug 2008 at 1:45

GoogleCodeExporter commented 9 years ago
Fixed in gflags 1.0rc1.

Original comment by csilv...@gmail.com on 21 Aug 2008 at 12:56