Results 1 to 9 of 9
Hi everyone,
I am Rajendra S. from India working in Bangalore and a Linux buff, who loves to work on open source projects, esp. in sourceforge.net
My programming skillsets are ...
- 07-30-2009 #1Just Joined!
- Join Date
- Jul 2009
- Posts
- 4
Compilation of C++ program with ACE(Adaptive Communications Environment) apis
Hi everyone,
I am Rajendra S. from India working in Bangalore and a Linux buff, who loves to work on open source projects, esp. in sourceforge.net
My programming skillsets are in C and C++, and I love to work on projects involving networking, telecom and High Availability domains.
I haven't delved into the kernel, but have a somewhat theoretical knowledge, would love to work on kernel projects.
Now to my query:-
Currently in the project which I am working on open-source, I would have to ACE i.e. Adaptive Communications Environment framework.
For this I would like to know if anyone of you have ever built a C++ program have ACE APIs in it on Linux.
If so can you please let me know how we do it.
I tried going through the document, didn't help much, I could build ACE, but not a C++ program with ACE APIs in it.
Regards,
Rajendra S.
+91 9741497720
- 07-30-2009 #2Linux User
- Join Date
- May 2009
- Location
- Big River, Sask, Canada
- Posts
- 342
Welcome to the forums, but I can't answer your question. You may want to move it to Linux Programming and Scripting zone.
Registered Linux User #420832
- 07-31-2009 #3forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,095
oz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 07-31-2009 #4Just Joined!
- Join Date
- Jul 2009
- Posts
- 4
I have already posted this to Linux Programming and Scripting zone.
Thanks for the pointer.
- 08-07-2009 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
I haven't diddled with the ACE api's for a long time, but I suspect, given your failure to provide any error messages from your attempt to compile your C++ application, that the libraries are missing the necessary 'extern "C"' directives so that the compiler doesn't apply C++ name mangling to the function names in ACE. In any case, please provide the error output from your build and I can better advise you.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 08-07-2009 #6Just Joined!
- Join Date
- Jul 2009
- Posts
- 4
Errors encountering while building C++ application using ACE apis
Following are the errors I am facing,.
I have attached the zip file which has cpp , header and Makefile.
I tried using ACE apis writing a test program, but without a reactor, acceptor etc. just plainly using ACE_DEBUG and linked it with lACE, and went thro'' fine.
Here I am getting linker errors, following are the ones :-
agent_raj.o: In function `main':
agent_raj.cpp:(.text+0xe7): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::open(ACE_INET_Addr const&, ACE_Reactor*, int, int, int)'
agent_raj.cpp:(.text+0x1ff): undefined reference to `ACE_Reactor::handle_events(ACE_Time_Value*)'
agent_raj.o: In function `armory::agent::Client_Acceptor::Client_Acceptor() ':
agent_raj.cpp:(.text._ZN6armory5agent15Client_Acce ptorC1Ev[armory::agent::Client_Acceptor::Client_Acceptor()]+0x1d): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::ACE_Acceptor(ACE_Reactor*, int)'
agent_raj.o: In function `armory::agent::Client_Acceptor::~Client_Acceptor( )':
agent_raj.cpp:(.text._ZN6armory5agent15Client_Acce ptorD0Ev[armory::agent::Client_Acceptor::~Client_Acceptor()]+0x2a): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::~ACE_Acceptor()'
agent_raj.o: In function `armory::agent::Client_Acceptor::~Client_Acceptor( )':
agent_raj.cpp:(.text._ZN6armory5agent15Client_Acce ptorD1Ev[armory::agent::Client_Acceptor::~Client_Acceptor()]+0x2a): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::~ACE_Acceptor()'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x10): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::get_handle() const'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x20): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::handle_input(int)'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x34): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::handle_close(int, unsigned long)'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x5c): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::suspend()'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x60): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::resume()'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x64): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::open(ACE_INET_Addr const&, ACE_Reactor*, int, int, int)'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x68): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::operator ACE_SOCK_Acceptor&() const'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x6c): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::acceptor() const'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x70): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::close()'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x74): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::handle_accept_error()'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x78): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::make_svc_handler(armory::agent::Cl ient_Handler*&)'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x7c): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::accept_svc_handler(armory::agent:: Client_Handler*)'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x80): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::activate_svc_handler(armory::agent ::Client_Handler*)'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x84): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::init(int, char**)'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x88): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::fini()'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0x8c): undefined reference to `ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::info(char**, unsigned int) const'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0xa0): undefined reference to `non-virtual thunk to ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::init(int, char**)'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0xa4): undefined reference to `non-virtual thunk to ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::fini()'
agent_raj.o:(.rodata._ZTVN6armory5agent15Client_Ac ceptorE[vtable for armory::agent::Client_Acceptor]+0xa8): undefined reference to `non-virtual thunk to ACE_Acceptor<armory::agent::Client_Handler, ACE_SOCK_Acceptor, ACE_INET_Addr>::info(char**, unsigned int) const'
- 08-09-2009 #7Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
When you get linkage errors like you are for undefined references, it usually means that you are not linking in required libraries. To link the ACE C++ libraries, you also need to link their C libraries, but since most of these are for C++ constructs, there are probably more than one ACE C++ library which you need to specify in your LIBS make variable.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 08-09-2009 #8Just Joined!
- Join Date
- Jul 2009
- Posts
- 4
Hi,
I am aware of that, however there are no other libraries i.e. .so which can be linked with for ACE_SOCK_Stream.
The only thing was libACE.so and libACE-5.7.1.so and therefore I am not aware what the problem could be, i will have to probably build ACE again and check.
Since u have already worked on ACE, it would be really great if you can help with the errors I am getting here.
test2.o: In function `connectionObject(unsigned short, char*)':
test2.cpp:(.text+0x92): undefined reference to `ACE_SOCK_Connector::ACE_SOCK_Con nector()'
test2.cpp:(.text+0x9d): undefined reference to `ACE_SOCK_Stream::ACE_SOCK_Stream ()'
test2.cpp:(.text+0xf5): undefined reference to `ACE_SOCK_Stream::ACE_SOCK_Stream (int)'
test2.cpp:(.text+0x16a): undefined reference to `ACE_SOCK_Stream::ACE_SOCK_Strea m(int)'
test2.cpp:(.text+0x198): undefined reference to `ACE_SOCK_Stream::~ACE_SOCK_Stre am()'
test2.cpp:(.text+0x1ab): undefined reference to `ACE_SOCK_Stream::~ACE_SOCK_Stre am()'
test2.cpp:(.text+0x1bb): undefined reference to `ACE_SOCK_Connector::~ACE_SOCK_C onnector()'
test2.cpp:(.text+0x1ce): undefined reference to `ACE_SOCK_Connector::~ACE_SOCK_C onnector()'
test2.cpp:(.text+0x1ef): undefined reference to `ACE_SOCK_Stream::ACE_SOCK_Strea m(int)'
test2.o: In function `main':
test2.cpp:(.text+0x224): undefined reference to `ACE_SOCK_Stream::ACE_SOCK_Strea m()'
test2.cpp:(.text+0x241): undefined reference to `connectionObject(short, char*)'
test2.cpp:(.text+0x255): undefined reference to `ACE_SOCK_Stream::~ACE_SOCK_Stre am()'
test2.cpp:(.text+0x265): undefined reference to `ACE_SOCK_Stream::~ACE_SOCK_Stre am()'
test2.cpp:(.text+0x27b): undefined reference to `ACE_SOCK_Stream::~ACE_SOCK_Stre am()'
collect2: ld returned 1 exit status
make: *** [test2] Error 1
- 08-09-2009 #9Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Sorry, but the last I worked with ACE was about 10 years ago on Unix systems. I would look for the implementation of the missing pieces. It is possible that libACE.so is not the same as libACE-5.7.1.so (versionitis) and the headers you are using are for 5.7.1. FWIW, it looks like 5.7.2 is the current version. Which port are you using? And did you build it yourself from source or download binaries from somewhere?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
