From: Anjali R. <anj...@gm...> - 2010-07-14 15:51:25
|
Thanks for the expert debugging and hints on where i need to start correcting. I am a Java developer with not so good knowledge in C++. So please excuse my ignorance in C++. In our project, we have got to create JNIs from existing C++ classes and so all this struggle. I will try solving it as you have hinted and hope that I dont encounter any more issues. Thanks again for your help. Regards Anjali Raman On Wed, Jul 14, 2010 at 9:03 PM, David Piepgrass <dpi...@me...>wrote: > It looks like you are trying to get us to think for you. The very first > compiler error, as you should know, is the one you should look at first. > > > > LinkAggr_wrap.cxx:195: error: ‘IPMgmt’ is not a namespace-name > > > > on line 195 is > > > > *using namespace IPMgmt;* > > * * > > it’s really obvious where this error comes from, because you put this line > above all of your #include statements. Obviously the #include statements, > which define the namespace, should go first. Are you unfamiliar with C++? > Using SWIG really requires you to know C++. > > > > *From:* Anjali Raman [mailto:anj...@gm...] > *Sent:* Wednesday, July 14, 2010 6:10 AM > > *To:* swi...@li... > *Subject:* Re: [Swig-user] Need help in #includes and namespaces > > > > Hello, > > Sorry for not including the specifications and not specifying what I > really wanted. > > I am trying swig in my project in which I want to generate java class out > of the existing .cxx classes. > > I have tried some of the simple examples mentioned in most of the sites and > it executed fine for me. > > But when I try the same in my class, it seems to be giving a lot of > problem. > > I have now attached the LinkAggr.cxx, LinkAggr.h and LinkAggr.i files with > the mail. > > > > When i do swig -c++ -java LinkAggr.i, it compiles fine and I get the > necessary files generated. > > But I think when i do the gcc steps, its giving me exceptions especially > with the namespaces. > Could you please let me know whats is wrong here. > I assume I havent written the interface properly. > I know the code is quite complex and i have attached all the relevant part > of the code except for all the unnecessary include files. > > > > The error i am getting is mentioned below: > > > [anraman@trling06 src]$ g++ -fPIC -c LinkAggr.cxx LinkAggr_wrap.cxx > -I/build/fpsdkroot/ENV_FP_MISC_1.6/j2se_1.6.0_13 > -I/usr/local/include/boost_1_33_0 -I${VOBTAG}/I_PmgmtCppAPI > -I${VOBTAG}/I_IPMgmt -I${VOBTAG}/SS_IPMgmt/Common/include > > > LinkAggr_wrap.cxx:195: error: ‘IPMgmt’ is not a namespace-name > LinkAggr_wrap.cxx:195: error: expected namespace-name before ‘;’ token > LinkAggr_wrap.cxx:196: error: ‘IPMgmt’ has not been declared > LinkAggr_wrap.cxx:196: error: ‘Conf’ is not a namespace-name > LinkAggr_wrap.cxx:196: error: expected namespace-name before ‘;’ token > LinkAggr_wrap.cxx:197: error: ‘IPMgmt’ has not been declared > LinkAggr_wrap.cxx:197: error: ‘Command’ is not a namespace-name > LinkAggr_wrap.cxx:197: error: expected namespace-name before ‘;’ token > LinkAggr_wrap.cxx: In function ‘jlong > Java_LinkAggrInterfaceJNI_LACP_1TD_1KEY_1get(JNIEnv*, __jclass*)’: > LinkAggr_wrap.cxx:241: error: ‘string’ was not declared in this scope > LinkAggr_wrap.cxx:241: error: expected `;' before ‘result’ > LinkAggr_wrap.cxx:245: error: ‘result’ was not declared in this scope > LinkAggr_wrap.cxx:245: error: expected `;' before ‘_LinkAggr’ > LinkAggr_wrap.cxx:247: error: expected primary-expression before ‘)’ > token > LinkAggr_wrap.cxx:247: error: expected type-specifier before ‘string’ > LinkAggr_wrap.cxx:247: error: expected `;' before ‘string’ > LinkAggr_wrap.cxx: In function ‘jlong > Java_LinkAggrInterfaceJNI_getLAGMode(JNIEnv*, __jclass*)’: > LinkAggr_wrap.cxx:254: error: ‘LAGMode’ was not declared in this scope > LinkAggr_wrap.cxx:254: error: expected `;' before ‘result’ > LinkAggr_wrap.cxx:258: error: ‘result’ was not declared in this scope > LinkAggr_wrap.cxx:258: error: ‘getLAGMode’ was not declared in this > scope > LinkAggr_wrap.cxx:259: error: expected primary-expression before ‘)’ > token > LinkAggr_wrap.cxx:259: error: expected type-specifier before ‘LAGMode’ > LinkAggr_wrap.cxx:259: error: expected `;' before ‘LAGMode’ > LinkAggr_wrap.cxx: In function ‘void > Java_LinkAggrInterfaceJNI_add(JNIEnv*, __jclass*, jlong, __jstring*, > jlong)’: > LinkAggr_wrap.cxx:267: error: ‘IfaceUtils’ has not been declared > LinkAggr_wrap.cxx:267: error: ‘arg3’ was not declared in this scope > LinkAggr_wrap.cxx:285: error: ‘IfaceUtils’ has not been declared > LinkAggr_wrap.cxx:285: error: expected primary-expression before ‘)’ > token > LinkAggr_wrap.cxx:290: error: ‘IfaceUtils’ has not been declared > LinkAggr_wrap.cxx:290: error: expected `)' before ‘const’ > > Any help will be my life saving one :) > > Thanks > Anjali > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Swig-user mailing list > Swi...@li... > https://lists.sourceforge.net/lists/listinfo/swig-user > > |