Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » C++ 11 begin() and end() functions
C++ 11 begin() and end() functions [message #1767409] Wed, 05 July 2017 17:12 Go to next message
Richard Cornish is currently offline Richard CornishFriend
Messages: 1
Registered: July 2017
Junior Member
I am using Eclipse Oxygen and just tinkering around. I am attempting to compile this code:

#include <iostream>
#include <vector>
#include <list>

int main( int argc, char** argv ) {
  int ia[] = { 0, 24, 98, 55, 22, 5, 8, 1, 62 };

  std::vector<int> vec(ia, std::end(ia));
  std::list<int> lst(ia, std::end(ia));

  return 0;
}


I get the error the following errors:
Quote:

13:10:03 **** Build of configuration Debug for project array_it****
make all
Building file: ../array_it.cpp
Invoking: GCC C++ Compiler
g++ -std=c++0x -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"array_it.d" -MT"array_it.o" -o "array_it.o" "../array_it.cpp"
../array_it.cpp: In function 'int main(int, char**)':
../array_it.cpp:16: error: 'end' is not a member of 'std'
../array_it.cpp:17: error: 'end' is not a member of 'std'
make: *** [array_it.o] Error 1

13:10:03 Build Finished (took 320ms)


Any ideas why it's having a problem with the end() function? Thanks for the help in advance!
Re: C++ 11 begin() and end() functions [message #1767570 is a reply to message #1767409] Fri, 07 July 2017 08:13 Go to previous message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
It is working for me:

make all 
Building file: ../src/Hello.cpp
Invoking: GCC C++ Compiler
g++ -std=c++0x -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Hello.d" -MT"src/Hello.o" -o "src/Hello.o" "../src/Hello.cpp"
Finished building: ../src/Hello.cpp
 


I have double checked with g++ 4.8, 5.4 and 6.3 on my system and they all work as expected. It sounds like you have an old version of g++ to me.

Previous Topic:Using my ISP Programmer from the Arduino plugin?
Next Topic:STM32F407 Blink Project
Goto Forum:
  


Current Time: Fri Apr 19 19:07:13 GMT 2024

Powered by FUDForum. Page generated in 0.02720 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top