473,378 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

C++ STLPort 5.0.2 ,new, vector

I got a problem with eVc4 i STLPort and i dont known why

c:\stlport-5.0.2\stlport\stl\_construct.h(115) : error C2665: 'new' :
none of
the 2 overloads can convert parameter 2 from type 'struct
ns::CPointT<short*'
c:\stlport-5.0.2\stlport\stl\_vector.h(351) : see reference to
function
template instantiation 'void __cdecl stlp_std::_Copy_Construct(struct
ns::CPointT<short*,const struct ns::CPointT<short&)' being compiled
#include <vector>
#include <algorithm>

template <class T>
struct CPointT {
T x;
T y;
CPointT(){};
CPointT( T p_x, T p_y) : x(p_x), y(p_y) {};
};

typedef CPointT<SHORTCPoint16;

std::vector<CPoint16punkty;
vector<CPoint16v1;
CPoint16 a(1,0);
v1.insert(v1.end(),a);

I dig into the STLPort and it fail on that
-----------------------------------------
#define _STLP_PLACEMENT_NEW new
...
template <class _Tp>
inline void _Copy_Construct(_Tp* __p, const _Tp& __val) {
_STLP_PLACEMENT_NEW (__p) _Tp(__val);
}

help
Nov 8 '06 #1
2 3042
Artur Bac wrote:
I got a problem with eVc4 i STLPort and i dont known why

c:\stlport-5.0.2\stlport\stl\_construct.h(115) : error C2665: 'new'
: none of
the 2 overloads can convert parameter 2 from type 'struct
ns::CPointT<short*'
c:\stlport-5.0.2\stlport\stl\_vector.h(351) : see reference to
function
template instantiation 'void __cdecl
stlp_std::_Copy_Construct(struct ns::CPointT<short*,const struct
ns::CPointT<short&)' being compiled

#include <vector>
#include <algorithm>

template <class T>
struct CPointT {
T x;
T y;
CPointT(){};
CPointT( T p_x, T p_y) : x(p_x), y(p_y) {};
};

typedef CPointT<SHORTCPoint16;

std::vector<CPoint16punkty;
vector<CPoint16v1;
CPoint16 a(1,0);
v1.insert(v1.end(),a);

I dig into the STLPort and it fail on that
-----------------------------------------
#define _STLP_PLACEMENT_NEW new
..
template <class _Tp>
inline void _Copy_Construct(_Tp* __p, const _Tp& __val) {
_STLP_PLACEMENT_NEW (__p) _Tp(__val);
}

help
You have written two constructors for CPointT, none of which is a copy
constructor. That means the struct cannot be copied.
Bo Persson

Nov 8 '06 #2
Bo Persson wrote:
Artur Bac wrote:
I got a problem with eVc4 i STLPort and i dont known why

c:\stlport-5.0.2\stlport\stl\_construct.h(115) : error C2665: 'new'
: none of
the 2 overloads can convert parameter 2 from type 'struct
ns::CPointT<short*'
c:\stlport-5.0.2\stlport\stl\_vector.h(351) : see reference to
function
template instantiation 'void __cdecl
stlp_std::_Copy_Construct(struct ns::CPointT<short*,const struct
ns::CPointT<short&)' being compiled

#include <vector>
#include <algorithm>

template <class T>
struct CPointT {
T x;
T y;
CPointT(){};
CPointT( T p_x, T p_y) : x(p_x), y(p_y) {};
};

typedef CPointT<SHORTCPoint16;

std::vector<CPoint16punkty;
vector<CPoint16v1;
CPoint16 a(1,0);
v1.insert(v1.end(),a);

I dig into the STLPort and it fail on that
-----------------------------------------
#define _STLP_PLACEMENT_NEW new
..
template <class _Tp>
inline void _Copy_Construct(_Tp* __p, const _Tp& __val) {
_STLP_PLACEMENT_NEW (__p) _Tp(__val);
}

help

You have written two constructors for CPointT, none of which is a copy
constructor. That means the struct cannot be copied.
No, the compiler should generate a copy constructor automatically. I
tried this code (replacing SHORT with short) on Comeau and Dinkumware's
tests, and it compiled fine. I'd guess it's a problem with STLport.

Cheers! --M

Nov 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gary | last post by:
I am trying to compile the STLPORT 4.5.3 using g++ 3.3 compiler on sun. I have modified the stl_gcc.h file to point to the correct include path for the compiler. I am getting the following errors:...
4
by: Icosahedron | last post by:
I'm sure it's been done. I'm sure that I'm an idiot for even asking the question, but has anyone been successful in getting Comeau 4.3.0.1 to compile STLPort, or even use STLPort in a program...
1
by: pervinder | last post by:
Hi, When i link a C++ test app with stlport, it throws some errors on AIX like Linking ../../output/AIX_32/bin/test "/hm/test/stlport/stl/_fstream.h", line 30.11: 1540-0836 (S) The #include...
2
by: programmer_pete | last post by:
I am trying to switch to STLPort 4.6.2 from the MSVC STL. My project uses Spirit 1.6.0 and MSVC++ 6. I have configured STLPort as follows: #define _STLP_NO_OWN_IOSTREAMS 1 #define...
1
by: mikets | last post by:
I'm using STLport in my project, and now I need to use a library which was compiled using MSVC 6.0 headers. For example, the "library.h" file contains #include <vector>. Apparently, in my...
1
by: Boris | last post by:
Hi, I'm using STLport-4.5.3 with Visual C++ 6.0 on Windows XP. It seems, the module built requires MSVCP60.DLL - which (mostly) contains Streams implementation by Microsoft. So, STLport falls...
7
by: Gernot Frisch | last post by:
Hi, we have to use stlport here, but With a code like this: void DoSomething(int english_version) { // make no use of english_version }
1
by: PangFromChina | last post by:
Platform:window 2000 professional, VC++6.0 +SP5 STLport: STLport 5.0.2 While test STLport following "STLport README for Microsoft Visual C++ compilers." of README.msvc(readme.txt), there is a...
0
by: francois.cppdevs | last post by:
Hi C++ supporters I just wanted to let you know that STLport 5.1.0 has been released, it is available here: https://sourceforge.net/projects/stlport/ Since 5.0 this library implements some...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.