473,471 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem with vectors in g++

I am trying to use "User-difned allocator " but on compilation it is
giving conflicts for memcopy
declarations with in string.h .

Please refer the below compile error log:

any suggestions how to resolve this???

g++ -g -DUNIX -DLINUX -DX86 -DCONIC_X86 -DCOMP_X86 -DDRAW_X86 -
DDR_X86 -DDEBUG -DDEBUGforCDC -DDEBUG_COMMANDLOG -DSUPPORT_IPS -
DTARGET_IRIPS -DTARGET_06S -DUSE_MEMCPY -DBUGFIX_RPCS_SPL_FLUSH -
DBUGFIX_POLYLINE_CLIP -I. -I../src -I../include -I../../include -I../
include/gps -I../../libge/include -I../../libdraw3/include -I../../
libipa/inc -I../../libdi/inc -c -o render.o ../src/render.c
In file included from /usr/include/g++-3/stl_algobase.h:48,
from /usr/include/g++-3/vector:30,
from ../include/pr_internal.h:15,
from ../include/object.h:9,
from ../include/spool.h:13,
from ../src/render.c:27:
/usr/include/string.h:242: declaration of C function `void memcpy
(void
*, const void *, unsigned int)' conflicts with
/usr/include/string.h:42: previous declaration `void *memcpy (void *,
const void *, unsigned int)' here

Feb 13 '07 #1
3 2031
On Feb 13, 2:43 am, "JeanDean" <rohits...@gmail.comwrote:
I am trying to use "User-difned allocator " but on compilation it is
giving conflicts for memcopy
declarations with in string.h .

Please refer the below compile error log:

any suggestions how to resolve this???

g++ -g -DUNIX -DLINUX -DX86 -DCONIC_X86 -DCOMP_X86 -DDRAW_X86 -
DDR_X86 -DDEBUG -DDEBUGforCDC -DDEBUG_COMMANDLOG -DSUPPORT_IPS -
DTARGET_IRIPS -DTARGET_06S -DUSE_MEMCPY -DBUGFIX_RPCS_SPL_FLUSH -
DBUGFIX_POLYLINE_CLIP -I. -I../src -I../include -I../../include -I../
include/gps -I../../libge/include -I../../libdraw3/include -I../../
libipa/inc -I../../libdi/inc -c -o render.o ../src/render.c
In file included from /usr/include/g++-3/stl_algobase.h:48,
from /usr/include/g++-3/vector:30,
from ../include/pr_internal.h:15,
from ../include/object.h:9,
from ../include/spool.h:13,
from ../src/render.c:27:
/usr/include/string.h:242: declaration of C function `void memcpy
(void
*, const void *, unsigned int)' conflicts with
/usr/include/string.h:42: previous declaration `void *memcpy (void *,
const void *, unsigned int)' here

Jean,

There are a couple options:
1) Rename your function to something other than memcpy.
2) Don't include strings.h in a file where you use your memcpy
function.
3) Place your version of memcpy in a namespace and access it with the
fully qualified namespace.
4) Place your version of mempcy in an object if it makes sense.

The option you should go with is probably option 1. Naming a function
the same as a standard function is generally a Bad Idea (TM).

HTH,
Paul Davis

Feb 13 '07 #2
On Feb 13, 6:03 pm, "paul.joseph.da...@gmail.com"
<paul.joseph.da...@gmail.comwrote:
On Feb 13, 2:43 am, "JeanDean" <rohits...@gmail.comwrote:
I am trying to use "User-difned allocator " but on compilation it is
giving conflicts for memcopy
declarations with in string.h .
Please refer the below compile error log:
any suggestions how to resolve this???
g++ -g -DUNIX -DLINUX -DX86 -DCONIC_X86 -DCOMP_X86 -DDRAW_X86 -
DDR_X86 -DDEBUG -DDEBUGforCDC -DDEBUG_COMMANDLOG -DSUPPORT_IPS -
DTARGET_IRIPS -DTARGET_06S -DUSE_MEMCPY -DBUGFIX_RPCS_SPL_FLUSH -
DBUGFIX_POLYLINE_CLIP -I. -I../src -I../include -I../../include -I../
include/gps -I../../libge/include -I../../libdraw3/include -I../../
libipa/inc -I../../libdi/inc -c -o render.o ../src/render.c
In file included from /usr/include/g++-3/stl_algobase.h:48,
from /usr/include/g++-3/vector:30,
from ../include/pr_internal.h:15,
from ../include/object.h:9,
from ../include/spool.h:13,
from ../src/render.c:27:
/usr/include/string.h:242: declaration of C function `void memcpy
(void
*, const void *, unsigned int)' conflicts with
/usr/include/string.h:42: previous declaration `void *memcpy (void *,
const void *, unsigned int)' here

Jean,

There are a couple options:
1) Rename your function to something other than memcpy.
2) Don't include strings.h in a file where you use your memcpy
function.
3) Place your version of memcpy in a namespace and access it with the
fully qualified namespace.
4) Place your version of mempcy in an object if it makes sense.

The option you should go with is probably option 1. Naming a function
the same as a standard function is generally a Bad Idea (TM).

HTH,
Paul Davis
Actually it is conflicting in the string.h itself.
Line number 242 and 42 of string.h
Line 242 in string.h

#if defined __USE_BSD
/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
extern void bcopy (__const void *__src, void *__dest, size_t __n)
__THROW;
Line 42 in string.h

/* Copy N bytes of SRC to DEST. */
extern void *memcpy (void *__restrict __dest,
__const void *__restrict __src, size_t __n)
__THROW;
/* Copy N bytes of SRC to DEST, guaranteeing
correct behavior for overlapping strings. */
extern void *memmove (void *__dest, __const void *__src, size_t __n)
__THROW;

Feb 13 '07 #3
JeanDean wrote:
On Feb 13, 6:03 pm, "paul.joseph.da...@gmail.com"
<paul.joseph.da...@gmail.comwrote:
>On Feb 13, 2:43 am, "JeanDean" <rohits...@gmail.comwrote:
>>I am trying to use "User-difned allocator " but on compilation it is
giving conflicts for memcopy
declarations with in string.h .
Please refer the below compile error log:
any suggestions how to resolve this???
g++ -g -DUNIX -DLINUX -DX86 -DCONIC_X86 -DCOMP_X86 -DDRAW_X86 -
DDR_X86 -DDEBUG -DDEBUGforCDC -DDEBUG_COMMANDLOG -DSUPPORT_IPS -
DTARGET_IRIPS -DTARGET_06S -DUSE_MEMCPY -DBUGFIX_RPCS_SPL_FLUSH -
DBUGFIX_POLYLINE_CLIP -I. -I../src -I../include -I../../include -I../
include/gps -I../../libge/include -I../../libdraw3/include -I../../
libipa/inc -I../../libdi/inc -c -o render.o ../src/render.c
In file included from /usr/include/g++-3/stl_algobase.h:48,
from /usr/include/g++-3/vector:30,
from ../include/pr_internal.h:15,
from ../include/object.h:9,
from ../include/spool.h:13,
from ../src/render.c:27:
/usr/include/string.h:242: declaration of C function `void memcpy
(void
*, const void *, unsigned int)' conflicts with
/usr/include/string.h:42: previous declaration `void *memcpy (void *,
const void *, unsigned int)' here
Jean,

There are a couple options:
1) Rename your function to something other than memcpy.
2) Don't include strings.h in a file where you use your memcpy
function.
3) Place your version of memcpy in a namespace and access it with the
fully qualified namespace.
4) Place your version of mempcy in an object if it makes sense.

The option you should go with is probably option 1. Naming a function
the same as a standard function is generally a Bad Idea (TM).

HTH,
Paul Davis

Actually it is conflicting in the string.h itself.
Line number 242 and 42 of string.h
Line 242 in string.h

#if defined __USE_BSD
/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
extern void bcopy (__const void *__src, void *__dest, size_t __n)
__THROW;
Line 42 in string.h

/* Copy N bytes of SRC to DEST. */
extern void *memcpy (void *__restrict __dest,
__const void *__restrict __src, size_t __n)
__THROW;
/* Copy N bytes of SRC to DEST, guaranteeing
correct behavior for overlapping strings. */
extern void *memmove (void *__dest, __const void *__src, size_t __n)
__THROW;
That's pretty weird, since on line 242 you have 'bcopy'
and not 'memcpy'. Maybe someone happily #defined bcopy to memcpy?

HTH,
- J.
Feb 13 '07 #4

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

Similar topics

10
by: Michael Aramini | last post by:
I need to represent 1D and 2D arrays of numeric or bool types in a C++ program. The sizes of the arrays in my intended application are dynamic in the sense that they are not known at compile time,...
5
by: Pratyush | last post by:
Hi, Suppose there is a vector of objects of class A, i.e., std::vector<A> vec_A(N); The class A satisifies all the STL vector requirements. Now I wish to add some attributes for each of the...
1
by: Dennis | last post by:
Hi I'm trying to implement a vector of vectors where find can be used to find a vector<double> in the vectors of vectors, that is hard to understand i guess. What I mean is that I got a vector...
5
by: Computer Whizz | last post by:
I was reading through Accelerated C++ at work when I read through the first mention of Vectors, giving us certain functions etc. Is there any benefit of Arrays over Vectors? Since all Vectors...
0
by: rokuingh | last post by:
ok, so i've been working on this one for quite a while, and the code is very big so i'm just going to give the relevant parts. this is a program that builds polymers (chemical structures of repeated...
5
by: madhu | last post by:
http://msdn2.microsoft.com/en-us/library/fs5a18ce(VS.80).aspx vector <intv1; v1.push_back( 10 ); //adds 10 to the tail v1.push_back( 20 ); //adds 20 to the tail cout << "The size of v1 is " <<...
3
Digital Don
by: Digital Don | last post by:
I have a problem sending the Vectors as Referencial parameters..i.e. I am having a struct vector struct board { int r; int c; };
4
by: 9966 | last post by:
Greetings, I'm currently facing a problem on how to compare 2 vector's elements. For example, assuming we have declared 2 integer type vectors: vector <int> v1; vector <int> v2; and both...
4
by: demonbunny666 | last post by:
I'm trying to get this program to work, but I am running into a problem and as hard as I try I can't figure it out. It compiles fine( VS Studio 6.0) but when it executes a problem occurs, something...
2
by: joeme | last post by:
How would one using STL do the following tasks: 1) merge 2 sorted vectors with dupes, result shall be sorted 2) merge 2 sorted vectors without dupes, result shall be sorted 3) merge 2...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.