myriambn / geodesic

Automatically exported from code.google.com/p/geodesic
0 stars 0 forks source link

Doesn't compile under Ubuntu 12.10 64bit with gcc, but will with minor amendments (see attachment) #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. g++ -Wall example0.cpp -o test

What is the expected output? What do you see instead?
Expect successful compile. Instead:

In file included from geodesic_algorithm_exact.h:5:0,
                 from example0.cpp:10:
geodesic_memory.h:187:2: error: ‘auto_ptr’ in namespace ‘std’ does not 
name a type
geodesic_memory.h: In member function ‘void 
geodesic::OutputBuffer::clear()’:
geodesic_memory.h:156:3: error: ‘m_buffer’ was not declared in this scope
geodesic_memory.h:156:14: error: ‘auto_ptr’ is not a member of ‘std’
geodesic_memory.h:156:28: error: expected primary-expression before ‘double’
geodesic_memory.h:156:28: error: expected ‘;’ before ‘double’
geodesic_memory.h: In member function ‘T* 
geodesic::OutputBuffer::allocate(unsigned int)’:
geodesic_memory.h:166:4: error: ‘m_buffer’ was not declared in this scope
geodesic_memory.h:166:15: error: ‘auto_ptr’ is not a member of ‘std’
geodesic_memory.h:166:29: error: expected primary-expression before ‘double’
geodesic_memory.h:166:29: error: expected ‘;’ before ‘double’
geodesic_memory.h:170:14: error: ‘m_buffer’ was not declared in this scope
geodesic_memory.h: In member function ‘T* geodesic::OutputBuffer::get()’:
geodesic_memory.h:176:14: error: ‘m_buffer’ was not declared in this scope
In file included from example0.cpp:10:0:
geodesic_algorithm_exact.h: In member function ‘virtual void 
geodesic::GeodesicAlgorithmExact::propagate(std::vector<geodesic::SurfacePoint>&
, double, std::vector<geodesic::SurfacePoint>*)’:
geodesic_algorithm_exact.h:549:63: error: no matching function for call to 
‘max(std::set<geodesic::Interval*, geodesic::Interval>::size_type, unsigned 
int&)’
geodesic_algorithm_exact.h:549:63: note: candidates are:
In file included from /usr/include/c++/4.7/bits/char_traits.h:41:0,
                 from /usr/include/c++/4.7/ios:41,
                 from /usr/include/c++/4.7/ostream:40,
                 from /usr/include/c++/4.7/iostream:40,
                 from example0.cpp:7:
/usr/include/c++/4.7/bits/stl_algobase.h:210:5: note: template<class _Tp> const 
_Tp& std::max(const _Tp&, const _Tp&)
/usr/include/c++/4.7/bits/stl_algobase.h:210:5: note:   template argument 
deduction/substitution failed:
In file included from example0.cpp:10:0:
geodesic_algorithm_exact.h:549:63: note:   deduced conflicting types for 
parameter ‘const _Tp’ (‘long unsigned int’ and ‘unsigned int’)
In file included from /usr/include/c++/4.7/bits/char_traits.h:41:0,
                 from /usr/include/c++/4.7/ios:41,
                 from /usr/include/c++/4.7/ostream:40,
                 from /usr/include/c++/4.7/iostream:40,
                 from example0.cpp:7:
/usr/include/c++/4.7/bits/stl_algobase.h:254:5: note: template<class _Tp, class 
_Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
/usr/include/c++/4.7/bits/stl_algobase.h:254:5: note:   template argument 
deduction/substitution failed:
In file included from example0.cpp:10:0:
geodesic_algorithm_exact.h:549:63: note:   deduced conflicting types for 
parameter ‘const _Tp’ (‘long unsigned int’ and ‘unsigned int’)
geodesic_algorithm_exact.h: In member function ‘void 
geodesic::GeodesicAlgorithmExact::update_list_and_queue(geodesic::list_pointer, 
geodesic::IntervalWithStop*, unsigned int)’:
geodesic_algorithm_exact.h:755:35: error: ‘memcpy’ was not declared in this 
scope
geodesic_algorithm_exact.h:829:40: error: ‘memcpy’ was not declared in this 
scope
geodesic_algorithm_exact.h:872:32: error: ‘memcpy’ was not declared in this 
scope
geodesic_algorithm_exact.h:886:52: error: ‘memcpy’ was not declared in this 
scope
geodesic_algorithm_exact.h:890:48: error: ‘memcpy’ was not declared in this 
scope

What version of the product are you using? On what operating system?
geodesic_cpp_03_02_2008.zip on Ubuntu 12.10, g++ version 4.7.2

Please provide any additional information below.

Issues are fixed by changing 3 lines in 2 files:

geodesic_algorithm_exact.cpp
12  :+       #include <string.h>
137 : change m_queue_max_size type from 'unsigned' to 'long unsigned'

geodesic_memory.cpp
10+ #include <memory>

then all compiles fine (there are still warnings about using chars for array 
indexing and the like but I guess these are things you are already taking into 
consideration).

Many thanks for the code anyway,
James

Original issue reported on code.google.com by jabooth@gmail.com on 14 Feb 2013 at 9:45

Attachments:

GoogleCodeExporter commented 8 years ago
I've put up a repository on github to highlight the changes I have made:
https://github.com/jabooth/exactgeodesic
I've started fixing a few of the warning errors on compilation too.

Best,
James

Original comment by jabooth@gmail.com on 15 Feb 2013 at 10:38