Error: Multiple declaration
Hi all,
We have an issue occuring only in solaris-sparc platform(not on gcc/linux).
In a source file(.cpp) we have many variables declared and defined, when try complile all of these variables give the following error:
Error: Multiple declaration <variable>
The compilation unit(headers and file) contains templates(function and class),specialization.
When these variable declaration is moved to header, then it works also when variables are put into include once using (#ifdefs like header file) it works
Is there any technique/processing compiler does and goes thru the cpp file twice? Anything specific to solaris? Any pointers would be of great help!
I am using Sunstudio 11
Thanks in advance for all your help!
Thanks,
Qrio
You are probably running into a program organization issue regarding placement of template declarations and definitions. Different compilers have different rules.
The topic is discussed in detail in Chapter 5, Program Organization, of the C++ Users Guide:
[http://docs.sun.com/app/docs/doc/819-5267/bkaep?a=view]
(This pointer is for Sun Studio 12, but this property of Sun C++ has not changed.)
Briefly: If a header file foo.h contains template declarations, the compiler will look for foo.cc (or foo.C, foo.cpp, foo.c, etc) expecting to find template definitions, and include foo.cc automatically. Consequently, if foo.h contains template declarations, foo.cc must contain only definitions for templates declared in foo.h. It can also contain declarations needed for those definitions that are not available when foo.h is included, but no other definitions.
Similar Messages
-
Forte C++ error: Multiple declaration for std::tm
I am trying to compile a program (in standard mode) a program that used
to compile OK in SC4.2 and still compiles OK in compat (but I need
to compile it standard mode). Forte C++ 6.0 gives me the error:
CC -c -O -mt -KPIC -D_REENTRANT ... file.c
"/usr/include/time.h", line 30: Error: Multiple declaration for std::tm.
"/usr/include/wchar.h", line 21: Error: Multiple declaration for std::tm.
2 Error(s) detected.
I include time.h, but wchar.h is included from the chain:
/opt/SUNWspro/WS6/include/CC/iostream.h
/opt/SUNWspro/WS6/include/CC/Cstd/./istream
/opt/SUNWspro/WS6/include/CC/Cstd/./ios
/opt/SUNWspro/WS6/include/CC/Cstd/rw/rwlocale
/opt/SUNWspro/WS6/include/CC/Cstd/./string
/opt/SUNWspro/WS6/include/CC/std/wchar.h
So can't I include iostream.h and time.h together?Why are you using major include files with dot-h extentions in Standard Mode? Don't you mean to use #include <ctime> and #include <iostream>?
-
Forte C++:error: Multiple Declaration for std::exception
Hi,
I am trying to compile code written in C++ 4.2/solrais 2.6 with Forte 6 C++ compiler on Solaris 7. Getting the following error.
/opt/SUNWspro/WS6/include/CC/exception.h Line 17: Multiple Declaration for std::exception.
Tried running only the preprocessor using -E option and noticed from the output that both "exception" and "exception.h" contents included.
Any help!I got this same error and was able to fix it by eliminating
#include <math.h> in my code.
As it turned out this #include was not needed.
It then compiled in standard mode.
Hope this helps. -
How to resolve multiple declaration error in libraries
Hi All,
I have one C Application, it links to two libraries. There is one variable with same name defined in two different libraries. These two libraries are third party libraries and i don't have access to their source code.
Compiler gives multiple declaration of same variable error.
Please let me know how to resolve this error.
Thanks in Advance.
Regards,
VasuPlease, show your compilation line as well as error that you get.
Are these static or shared libraries?
Are we talking about Solaris here?
regards,
Fedor. -
Error:xml declaration may only begin enttties
my problem is that the code by the name DomEcho01.java in this tutorial
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
compiles fine but at run time it gives me an error saying
"error:xml declaration may only begin enttties "
can ne1 tell me y is this happenin
thanx
sam<?xml version='1.0' encoding='utf-8'?>
<!-- A SAMPLE set of slides -->
<slideshow
title="Sample Slide Show"
date="Date of publication"
author="Yours Truly"
>
<!-- TITLE SLIDE -->
<slide type="all">
<title>Wake up to WonderWidgets!</title>
</slide>
<!-- OVERVIEW -->
<slide type="all">
<title>Overview</title>
<item>Why <em>WonderWidgets</em> are great</item>
<item/>
<item>Who <em>buys</em> WonderWidgets</item>
</slide>
</slideshow>i am using the same xml file that is given in the tutorial -
Error when declaring IDOC segments in program
I am getting error when declaring IDOC segments in my program.
Below is how I declared.
data: wa_e1vfkonk like e1vfkonk.
For the same syntax few segments are showing as properly declared and few are showing error that 'eqvfkonk' does not exist.
How ever this structure does exist when i check it.
Help appreciated.Hi Prasad,
I think the segment that you are declaring in the program doesn't exist in SAP system as standard.
Maybe you mean E1VFKONX, finishing with "X" instead "K"?
Reward points if useful.
Roger -
Error : Multiple Abends while Installing OES SP8
I got following error while installing Open Enterprise Server SP8 on DELL Optilex 990.
Error " Multiple Abends on Processor 0. System Halted "
Pl help me for solving above error while installing OES.
Thanks in Advance
RajendraOn 09/02/2013 09:36, ycmou cmc wrote:
> I got following error while installing Open Enterprise Server SP8 on
> DELL Optilex 990.
>
> Error " Multiple Abends on Processor 0. System Halted "
>
> Pl help me for solving above error while installing OES.
Why are you installing NetWare on this hardware? It is a desktop PC not
a server and released after general support for NetWare 6.5 has ended.
If this is for testing I would try installing VMware ESXi on the PC and
then virtualising NetWare as a guest.
HTH.
Simon
Novell/SUSE/NetIQ Knowledge Partner
Do you work with Novell technologies at a university, college or school?
If so, your campus could benefit from joining the Novell Technology
Transfer Partner (TTP) program. See novell.com/ttp for more details. -
Eclipse error : The declared package does not match the expected package
I'm trying to setup an Eclipse project on some existing code but I can't get past this error. The source files are in the following directories:
d:\mycompany\coolstuff
d:\mycompany\neatstuff
The source files in the coolstuff directory have a package statement:
package mycompay.coolstuff
The source files in the neatstuff directory have a package statement:
package mycompany.neatstuff
I create a new Eclipse Java project, specify the existing directoy of d:\mycompany. When Eclipse tries to build, it gives the following error:
The declared package "mycompany.coolstuff" does not match the expected package "coolstuff"
I've tried everything I can think of short of modifying every package statement since they seem correct based on the Java documentation. What am I missing?All the source builds just fine using a command
nd line and a classpath=.\That's meaningless, since classpath=.\ is just setting the classpath to the current directory.
d:\mycompany\coolstuff
d:\mycompany\neatstuff
The source files in the coolstuff directory have a
package statement:
package mycompay.coolstuff
The source files in the neatstuff directory have a
package statement:
package mycompany.neatstuff
I create a new Eclipse Java project, specify the
existing directoy of d:\mycompany.When you use the package statement "package mycompay.coolstuff" Eclipse looks in the directory above mycompany for mycompay\coolstuff\<classname>, and that directory is d:\, not d:\mycompany.
When Eclipse
tries to build, it gives the following error:
The declared package "mycompany.coolstuff" does not
match the expected package "coolstuff" -
Reg : "Error multiple Receivers are not allowed for Synchronous calls"
Hi All,
Can somebody tell me why I am getting this error "Error multiple Receivers are not allowed for Synchronous calls" when I am using Synchronous Soap Request to WebService and the response from webservice is being sent to multiple receivers which are Business services based on Receiver determination condition(Services W/o Party).Hi , If you are simply looking up data (and not updating tables ) using RFC you can use RFC Lookup APIs to create a java mapping
The source message has to be a RFC request message interface and target should be RFC response message interface.
Also you can use three step mappings in a single interface mapping.
1. from your request message to RFC request message mapping
2. java mapping which will do the lookup and give you rfc response back
3.rfc response to your target response mapping.
PS: RFC lookup can be used if there are not may hierarchy in the RFC Response structure. (i.e. may be 3 or 4 level nesting permitted)
To help you further
The following is a link which gives you access to a ready made source code. you just need to compile it and create a jar and import the mapping in imported archive
http://knowhowsapxi.synthasite.com/rfc-loolup.php
Edited by: Progirl Progirl on Oct 31, 2008 1:33 PM -
Security Error : Multiple hosts referenced in resources
Hi,
Im attempting to use the abbot maven plugin that can download an application via webstart and run GUI tests against it.
I have got this working before, and am setting it up again, but get a webstart error that I have not seen before/can see in the forums.
Title: SystemTest1
Vendor: mycompany, inc.
Category: Security Error
Multiple hosts referenced in resources
JNLPException[category: Security Error : Exception: null : LaunchDesc: null ] at com.sun.javaws.LaunchDownload.checkJNLPSecurity(Unknown Source) at com.sun.javaws.Launcher.downloadResources(Unknown Source) at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source) at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thr
Could anyone shead some light as to where this error comes from/why??
Thanks
Jamesin any given jnlp file, all the resources must be downloaded from the same download host. In this way the SecurityManager can assign one permission collection to all the code loaded from that jnlp file (allowing socket permission only to that host).
If you have a jnl;p file with multiple resources loaded from differant hosts, re-factor the jnlp file so all of the resources loaded from a seperate host are in one component extension jnlp file.
/Andy -
Error: "div" declaration conflicts with "std::div(long, long)"
I am using the STLport downloaded from http://www.stlport.com/ on a Solaris 9 machine having sun_studio 11. I am getting the following compilation errors related to STL. The same code used to compile with the sun_studio 9 compiler.
/builds/isv/solaris/STLport/4.5/stlport/cstdlib", line 92
: Error: "div" declaration conflicts with "std::div(long, long)" introduced by using declaration.
"/builds/aseries/isv/athabasca/isv/solaris/STLport/4.5/stlport/cstdlib", line 92: Error: std::div(long, long) already had a body defined.
2 Error(s) detected.
What can be the possible solution to this problem? As of now I want to continue using this STL library rather than that which comes along with the compiler.
Thanks.The issue is whether the standard headers associated with the compiler have the overloads required by the standard. If the required overloads are present, the original call of std::pow is ambiguous, and the compiler will report it.
If you have a recent version of Visual C++, I'd be very surprised if the function overloads were not available. Possibly you are using a compiler option, perhaps a default option, that hides the overloaded declarations. In that case, some C++ code that conforms to the standard would not behave correctly when used with the compiler in that mode.
The correct approach is to use the compiler in standard-conforming mode so that code you write will be accepted by other standard-conforming compilers. That is, after all, the purpose of the standard. -
Pls -00371 error (problem in multiple declaration )
function code:
//start
create or replace function salinc(si number default 10) return number
is
number sinc;
number bef;
number aft;
begin
select sum(sal) into bef from emp where deptno=si;
update employees set sal=sal+200 where deptno=si;
select sum(sal) into aft from emp where deptno=si;
sinc:=aft-bef;
return sinc;
end salinc;
//end
is giving me these 2 errors:
0/0 PL/SQL: Compilation unit analysis terminated
1/46 PLS-00371: at most one declaration for 'NUMBER' is permitted in t he declaration section
how can i now declare the variables ?? need helptushar88 wrote:
function code:
//start
create or replace function salinc(si number default 10) return number
is
number sinc;
number bef;
number aft;
beginIn oracle declaration is done as
<variable name> <data type>
i.e. your decleration is incorrect. it must be
sinc number;
bef number;
aft number; -
Hi all,when i am trying to declare a cursor in a procedure i am getting errors.Kindly correct me where i am going wrong
1 CREATE OR REPLACE PROCEDURE xxc_lc_rcv_interface_prc IS
2 v_a NUMBER;
3 v_b NUMBER;
4 v_c NUMBER;
5 v_d NUMBER;
6 v_e NUMBER;
7 v_f NUMBER;
8 v_g NUMBER;
9 CURSOR rcv_interface_cur
10 IS
11 SELECT shipment_header_id INTO v_c
12 FROM RCV_SHIPMENT_HEADERS
13 WHERE SHIPMENT_NUM = 'NOV1124';
14 SELECT shipment_line_id INTO v_d
15 FROM RCV_SHIPMENT_LINES
16 WHERE SHIPMENT_HEADER_ID = v_c;
17 BEGIN
18 SELECT rcv_headers_interface_s.nextval INTO v_a FROM dual ;
19 SELECT rcv_interface_group_s.nextval INTO v_b FROM dual;
20 SELECT rcv_headers_interface_s.currval INTO v_e FROM dual ;
21 SELECT rcv_interface_groups_s.currval INTO v_f FROM dual;
22 SELECT rcv_transactions_interface_s.nextval INTO v_g FROM dual;
23 BEGIN
24 INSERT INTO rcv_headers_interface
25 (
26 HEADER_INTERFACE_ID,
27 GROUP_ID,
28 PROCESSING_STATUS_CODE,
29 RECEIPT_SOURCE_CODE,
30 TRANSACTION_TYPE,
31 AUTO_TRANSACT_CODE,
32 LAST_UPDATE_DATE,
33 LAST_UPDATE_LOGIN,
34 LAST_UPDATED_BY,
35 CREATION_DATE,
36 CREATED_BY,
37 VALIDATION_FLAG,
38 COMMENTS,
39 SHIPMENT_NUM,
40 FROM_ORGANIZATION_ID,
41 SHIP_TO_ORGANIZATION_ID,
42 EXPECTED_RECEIPT_DATE
43 --RECEIPT_HEADER_ID
44 )
45 VALUES
46 (v_a, --Header Interface ID
47 v_b, --Group ID
48 'PENDING', --Processing Status Code
49 'INVENTORY', --Receipt source Code
50 'RECEIVE', --Transaction Type
51 'DELIVER' , --AUT Transact Code
52 sysdate, --last update date
53 1053, --last updated by
54 1053, --Last Update Login
55 sysdate, --creation date
56 1053, --created by
57 'Y', --Validation Flag
58 'Receiving Through Interface', --Comments
59 'NOV1124' , --Shipment Number
60 81, --From Org
61 82, --To org
62 sysdate --Expected Receipt Date
63 );
64 END;
65 BEGIN
66 FOR crec IN rcv_interface_cur loop
67 INSERT INTO rcv_transactions_interface
68 (
69 HEADER_INTERFACE_ID,
70 GROUP_ID,
71 INTERFACE_TRANSACTION_ID,
72 TRANSACTION_TYPE,
73 TRANSACTION_DATE,
74 PROCESSING_STATUS_CODE,
75 PROCESSING_MODE_CODE,
76 TRANSACTION_STATUS_CODE,
77 CATEGORY_ID,
78 QUANTITY,
79 LAST_UPDATE_DATE,
80 LAST_UPDATED_BY,
81 CREATION_DATE,
82 CREATED_BY,
83 RECEIPT_SOURCE_CODE,
84 DESTINATION_TYPE_CODE,
85 AUTO_TRANSACT_CODE,
86 SOURCE_DOCUMENT_CODE,
87 UNIT_OF_MEASURE,
88 INTERFACE_SOURCE_CODE,
89 ITEM_ID,
90 --ITEM_DESCRIPTION,
91 UOM_CODE,
92 EMPLOYEE_ID,
93 SHIPMENT_HEADER_ID,
94 TO_ORGANIZATION_ID,
95 SUBINVENTORY,
96 FROM_ORGANIZATION_ID,
97 FROM_SUBINVENTORY,
98 EXPECTED_RECEIPT_DATE,
99 SHIPPED_DATE,
100 VALIDATION_FLAG
101 )
102 VALUES
103 (v_e, --Header Interface ID
104 v_f, --Group ID
105 v_g, --Interface_transaction_id
106 'RECEIVE', --Transaction Type
107 sysdate, --Transaction Date
108 'PENDING', --Processing Status Code
109 'BATCH', --Processing Mode Code
110 'PENDING', --Transaction Status Code
111 120, --Category ID
112 2, --Quantity
113 sysdate, --last update date
114 1053, --last updated by
115 sysdate, --creation date
116 1053, --created by
117 'INVENTORY', --Receipt source Code
118 'INVENTORY', --Destination Type Code
119 'DELIVER' , --AUTO Transact Code
120 'INVENTORY', --Source Document Code
121 'Each', --Unit Of Measure
122 'RCV', --Interface Source Code
123 2492, --Item ID
124 --'ABBY KITCHEN CURTAIN SET BEIGE/BURGUNDY', --Item Description
125 'EA', --UOM COde
126 1053, --User
127 v_c, --Shipment Header ID
128 v_d, --SHipment Line ID
129 82, --To Organization ID
130 'Brooklyn', --Sub Inventory ID
131 81, --From Organization
132 'Vessel', --From Subinventory
133 sysdate, --Expected Receipt Date
134 sysdate, --Shipped Date
135 'Y' --Validation Flag
136 );
137 --END IF;
138 END LOOP;
139 END;
140* END xxc_lc_rcv_interface_prc;
SQL> /
Warning: Procedure created with compilation errors.
SQL> sho err
Errors for PROCEDURE XXC_LC_RCV_INTERFACE_PRC:
LINE/COL ERROR
14/2 PLS-00103: Encountered the symbol "SELECT" when expecting one of
the following:
begin function pragma procedure subtype type <an identifier>
<a double-quoted delimited-identifier> current cursor delete
exists prior
The symbol "begin" was substituted for "SELECT" to continue.
141/0 PLS-00103: Encountered the symbol "end-of-file" when expecting
one of the following:
( begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << continue close current delete fetch lock
insert open rollback savepoint set sql execute commit forall
merge pipe purgehi,
I have corrected your code
CREATE OR REPLACE PROCEDURE xxc_lc_rcv_interface_prc
IS
v_a NUMBER;
v_b NUMBER;
v_c NUMBER;
v_d NUMBER;
v_e NUMBER;
v_f NUMBER;
v_g NUMBER;
CURSOR rcv_interface_cur
IS
SELECT shipment_header_id
INTO v_c
FROM rcv_shipment_headers
WHERE shipment_num = 'NOV';
BEGIN
SELECT shipment_line_id
INTO v_d
FROM rcv_shipment_lines
WHERE shipment_header_id = v_c;
SELECT rcv_headers_interface_s.NEXTVAL
INTO v_a
FROM DUAL;
SELECT rcv_interface_group_s.NEXTVAL
INTO v_b
FROM DUAL;
SELECT rcv_headers_interface_s.CURRVAL
INTO v_e
FROM DUAL;
SELECT rcv_interface_groups_s.CURRVAL
INTO v_f
FROM DUAL;
SELECT rcv_transactions_interface_s.NEXTVAL
INTO v_g
FROM DUAL;
BEGIN
INSERT INTO rcv_headers_interface
(header_interface_id, GROUP_ID, processing_status_code,
receipt_source_code, transaction_type,
auto_transact_code, last_update_date, last_update_login,
last_updated_by, creation_date, created_by,
validation_flag, comments, shipment_num, from_organization_id, ship_to_organization_id, expected_receipt_date
--RECEIPT_HEADER_ID
VALUES (v_a, --Header Interface ID
v_b, --Group ID
'PENDING', --Processing Status Code
'INVENTORY', --Receipt source Code
'RECEIVE', --Transaction Type
'DELIVER', --AUT Transact Code
SYSDATE, --last update date
--, --last updated by
--, --Last Update Login
SYSDATE, --creation date
-- , --created by
'Y', --Validation Flag
'Receiving Through Interface', --Comments
'NOV', --Shipment Number
-- , --From Org
-- , --To org
SYSDATE --Expected Receipt Date
END;
BEGIN
FOR crec IN rcv_interface_cur
LOOP
INSERT INTO rcv_transactions_interface
(header_interface_id, GROUP_ID,
interface_transaction_id, transaction_type,
transaction_date, processing_status_code,
processing_mode_code, transaction_status_code,
category_id, quantity, last_update_date,
last_updated_by, creation_date, created_by,
receipt_source_code, destination_type_code,
auto_transact_code, source_document_code,
unit_of_measure, interface_source_code, item_id,
--ITEM_DESCRIPTION,
uom_code, employee_id, shipment_header_id, to_organization_id, subinventory, from_organization_id, from_subinventory, expected_receipt_date, shipped_date, validation_flag
VALUES (v_e, --Header Interface ID
v_f, --Group ID
v_g, --Interface_transaction_id
'RECEIVE', --Transaction Type
SYSDATE, --Transaction Date
'PENDING', --Processing Status Code
'BATCH', --Processing Mode Code
'PENDING', --Transaction Status Code
-- , --Category ID
-- , --Quantity
SYSDATE, --last update date
-- , --last updated by
SYSDATE, --creation date
-- , --created by
'INVENTORY', --Receipt source Code
'INVENTORY', --Destination Type Code
'DELIVER', --AUTO Transact Code
'INVENTORY',
--Source Document Code
'Each', --Unit Of Measure
'RCV', --Interface Source Code
-- , --Item ID
--'ABBY KITCHEN CURTAIN SET BEIGE/BURGUNDY', --Item Description
'EA', --UOM COde
-- , --User
v_c, --Shipment Header ID
v_d, --SHipment Line ID
-- , --To Organization ID
'Brooklyn', --Sub Inventory ID
-- , --From Organization
'Vessel', --From Subinventory
SYSDATE, --Expected Receipt Date
SYSDATE, --Shipped Date
'Y' --Validation Flag
--END IF;
END LOOP;
END;
END xxc_lc_rcv_interface_prc;
there are many syntax errors i have corrected .
Note : code is not compiled or tested .Thanks,
P Prakash
Edited by: prakash on Nov 21, 2011 4:00 AM -
In ECC 6 , I AM GETTING ERROR WHILE DECLARING DATA TYPE OF BAPI
HI,
IN ECC 6 , i AM GETTING ERROR" NO READ ACESS RETURN"
EVENTHOUGH I DECLARED DATA TYPE FOR EXAMPLE
DATA: RETURN TYPE BAPIRET2.AND USING IN RFC.
HOW TO CORRECT THE ERROR.
pLZ HELP ME.
REGARDS,
RANIHi Rani,
Could you please post the piece of coding where the error comes from? Maybe we can help you then.
Regards,
John. -
Error while declaring the internal table
Hi all,
I am trying to declare as following and I am getting the error
data: begin of test,
w_text(1000),
end of test.
data: i_test type standard table of test.Hello
types: begin of test,
w_text(1000),
end of test.
data: i_test type standard table of test.
Maybe you are looking for
-
How to make arrays or repeat objects in circle?
Hello, 1 - How to make arrays without copying and pasting? Fig-1 2 - how to create objects repeated in circles? Fig-2 Regards and Thanks
-
Just a tip to anyone looking to use JAXB or other APIs requiring class loading with CEP. Because CEP uses OSGi, you must provide your own class loader to use (in this example) JAXB 2.0. For example: cLoader = com.mycorp.cep.message.schema.ObjectFacto
-
ASE 15.7 how to find data entry using table page nr
Hi, I am looking for a dbcc () to get data when I know page number from a table Thank you
-
When To Create an AS File vs. Just Include AS
Hey folks, I'm rather new to AS and the heavier "Java-like" coding so I thought that this would be a good question to pose. When do you find yourself opting to create a separate AS file versus just writing the code in a frame in the timeline? Should
-
Sunray 3+ client cardreader and Smartcard Login
[http://wiki.sun-rays.org/index.php/Personalizing_Smart_Cards_for_use_with_the_Sun_Ray_Ultra_Thin_Terminals|http://wiki.sun-rays.org/index.php/Personalizing_Smart_Cards_for_use_with_the_Sun_Ray_Ultra_Thin_Terminals] [http://web.archiveorange.com/arch