jggtrujillo / or-tools

Automatically exported from code.google.com/p/or-tools
0 stars 0 forks source link

compilation problem: std::vector no data member #1

Closed GoogleCodeExporter closed 9 years ago

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

What is the expected output? What do you see instead?

./constraint_solver/constraint_solver.h: In member function ‘void 
operations_research::IntVar::RemoveValues(const std::vector<int64, 
std::allocator<int64> >&)’:
./constraint_solver/constraint_solver.h:2095: error: ‘const class 
std::vector<int64, std::allocator<int64> >’ has no member named ‘data’
./constraint_solver/constraint_solver.h: In member function ‘void 
operations_research::IntVar::SetValues(const std::vector<int64, 
std::allocator<int64> >&)’:
./constraint_solver/constraint_solver.h:2103: error: ‘const class 
std::vector<int64, std::allocator<int64> >’ has no member named ‘data’
constraint_solver/alldiff_cst.cc: In member function 
‘operations_research::Constraint* 
operations_research::Solver::MakeAllDifferent(const 
std::vector<operations_research::IntVar*, 
std::allocator<operations_research::IntVar*> >&, bool)’:
constraint_solver/alldiff_cst.cc:139: error: ‘const class 
std::vector<operations_research::IntVar*, 
std::allocator<operations_research::IntVar*> >’ has no member named ‘data’

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

Please provide any additional information below.

Macos 10.5.8
i686-apple-darwin9-g++-4.0.1

To make some progress with the compilation on Macos 10.5.8
I had to remove  -DARCH_K8 from the CFLAGS definition in the makefile.

Then I'm having troubles with the vector class. The data() method is not 
recognized.
Is data() a standard method from the stl vector?

Original issue reported on code.google.com by psch...@gmail.com on 16 Sep 2010 at 7:44

GoogleCodeExporter commented 9 years ago
Actually, only xcode 2.3.2 is supported.
Can you try with gcc 4.2 or above?

Original comment by lper...@google.com on 16 Sep 2010 at 9:20

GoogleCodeExporter commented 9 years ago
I've got the same error with gcc 4.2.

It is still the same error coming from values.data()

void SetValues(const vector<int64>& values) {
    SetValues(values.data(), values.size());
}

I've got Xcode Version 3.1.2 but I don't see any .xcodeproj file.

Thank you in advance,

Pierre

./constraint_solver/constraint_solver.h:2103: error: ‘const class 
std::vector<long long int, std::allocator<long long int> >’ has no member 
named ‘data’
constraint_solver/alldiff_cst.cc: In member function 
‘operations_research::Constraint* 
operations_research::Solver::MakeAllDifferent(const 
std::vector<operations_research::IntVar*, 
std::allocator<operations_research::IntVar*> >&, bool)’:
constraint_solver/alldiff_cst.cc:139: error: ‘const class 
std::vector<operations_research::IntVar*, 
std::allocator<operations_research::IntVar*> >’ has no member named ‘data’

Original comment by psch...@gmail.com on 16 Sep 2010 at 10:09

GoogleCodeExporter commented 9 years ago
Two comments: xcode <= 4.2 is not implementing the STL correctly. 
It is probable we will not fix it.

There is a Makefile that is working under Mac OS X. I will look at xcode 
project.

Original comment by lper...@google.com on 16 Sep 2010 at 3:01

GoogleCodeExporter commented 9 years ago
Note that with gcc4.3 the compilation goes further on MAC OS but I have 
troubles with the linking of nqueens because of std::_Rb_tree_increment which 
is not recognized. 
I'll try with gcc4.4 then.

Original comment by psch...@gmail.com on 17 Sep 2010 at 7:31