Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7743573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:34:11+00:00 2026-06-01T09:34:11+00:00

I need to use the vector container in my native application (it’s cocos-2dx framework)

  • 0

I need to use the vector container in my native application (it’s cocos-2dx framework)
So, I’ve added

APP_STL := stlport_static

to Application.mk
Then

#include <vector>

in header file for the class which uses vector
Define the variable as

std::vector<cocos2d::CCPoint*> *m_VertexAnchors;

And then do this

m_VertexAnchors->push_back(point);

point here is actually CCPoint* point
And when I run my app I just see the black screen than it disappears after 2-3 sec without any message.
The last message in logcat is (filter by application name and with verbose level)

04-01 13:22:57.068: D/dalvikvm(2939): GC_EXTERNAL_ALLOC freed 64K, 47%
free 2887K/5379K, external 0K/0K, paused 40ms

and there are no errors before just messages about loading libs. And I’ve not seen anything strange in the main log.
Then when I commented out

m_VertexAnchors->push_back(point);

the app works fine.

So, is there anything I’ve missed, if no how could I debug this (I use Eclipse with sequoyah plugin)

Will appreciate any help or suggestions, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:34:14+00:00Added an answer on June 1, 2026 at 9:34 am

    Before using m_vertexAnchors you must initialize it correctly:

    m_VertexAnchors = new std::vector<cocos2d::CCPoint*>();
    

    you must remember to delete it when no longer required.

    If you can avoid dynamically allocating the vector then declare it as:

    std::vector<cocos2d::CCPoint*> m_VertexAnchors;
    

    and use it:

    m_VertexAnchors.push_back(point);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to use a function on a vector that does not take a
I need a container of containers like: class Widget { ... }; ... std::vector<std::list<Widget>
I'm in need of a container that has the properties of both a vector
I need a vector container to be shared between two threads of the same
I have an application where I get a vector<string> . I need to iterate
Say I need a new type in my application, that consists of a std::vector<int>
Let's say I have a container (std::vector) of pointers used by a multi-threaded application.
So, I need use this event so I can navigate trought blog posts. I
Need to use own imaged markers instead built-in pins. I have several questions. 1.
i need to use the animate property for a less than usual activity. i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.