Search code examples
c++vectorincludetizentizen-native-app

What library to include for std::vector in Tizen?


I want to use an std::vector for an app that I'm creating with Tizen and I can't find the right library to include to make my std::vector be recognized... I have a syntax error... Is there an equivalent to std::vector specific to Tizen? I searched the web but I didn't find anything...

I tried #include <vector> Tizen doesn't recognize it, that's what my problem is because in "normal" C++ it works fine. Only I'm using Tizen with Tizen IDE (Eclipse plug-in) and it doesn't recognize the library so I'm wondering which library I need to include instead (I got a fatal error: file not found when I use the include I mentioned).

I can't post images so here's a transcript of the error message:

type name requires a specifier or qualifier
syntax error
expected expression"

All of which regarding this line:

std::vector<int> vect;

OK, I found my answer. It seems Tizen is using C and not C++... I didn't see it because some libraries I sometimes use when I code in C++ were included like they should. Anyway I'm just gonna have to find the C equivalent of vector now and my problem will be solved.


Solution

  • https://developer.tizen.org/dev-guide/2.2.0/

    The Tizen C++ application supports C++ based on the Standard C++ ANSI ISO 14882 2003, which includes the Standard Template Library (STL). This helps developers migrate the pre-existing standard library based applications to the Tizen platform with minimum effort.

    More specifically, Tizen supports complete set of libstdc++v3 comprising of standard C++ functions specified in the Standard C++ ANSI ISO 14882 2003 and the entire Standard Template Library (http://www.sgi.com/tech/stl/).

    These methods can be used by including the relevant header file in a standard manner, for example, "#include <stdio>". Support for standard C++ library extended to complete set of libstdc++v3 modules, namespaces and classes. For more information, refer to this Web site.

    Remarks: The locale based feature is not supported in Tizen.

    So #include <vector> should work fine.

    Since you say that you can't include any C++ headers, I suspect the problem is that the compiler is compiling your code as C instead of C++. Affirm that your file has the .cpp extension, and view the file's properties in the project to confirm that the IDE is treating the file as C++. (I don't know where that setting is, I don't have Eclipse). This link says to delete your project and create a C++ project instead of a C project, then re-import your files. This link says you can set the "File Type", but also implies it doesn't quite work.