Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ background apps?
#1
Hello Delta Tau Forums,

We're currently looking into using A Power PMAC system, however one of the things that we would like to achieve with it would be to deploy an existing C++ application to the device, accessing the shared/user memory.

A look at the IDE & documentation suggest that it only handles C, but would compiling our project targeting the PowerPC architecture, then placing the application in the "C language/Background Programs" directory (changing the extension & modifying the pp_proj.ini file) be a feasible option?

(apologies if this has been asked before but you can't search for c++/cpp)
Reply
#2
Our IDE only handles C. But you can use the GNU++ compiler externally and build C++ apps for the Power PMAC as much as you want. It can call the same API we use from our Capps and access shared memory and so forth. You just need to manage how your C++ code gets loaded to the PPmac and merged with an IDE project that might also get loaded.
Reply
#3
pmurcutt - If you're looking for a C++ capable IDE, I've had good success using Eclipse CDT for both C and C++ on the Power PMAC. You can even use the Remote Systems plugin to automatically download your executables after a build, so it's pretty seamless. YMMV.
Reply
#4
Can you elaborate on how you setup your Eclipse IDE to compile for PPMAC and automatically download? It would be very helpful to us.

Thanks

(05-31-2012, 05:35 PM)shansen Wrote: pmurcutt - If you're looking for a C++ capable IDE, I've had good success using Eclipse CDT for both C and C++ on the Power PMAC. You can even use the Remote Systems plugin to automatically download your executables after a build, so it's pretty seamless. YMMV.

Reply
#5
@MClement:

I've just been using Eclipse CDT, in addition to the RSE plugin.

Here is how my IDE is setup:

1) Windows 7 with Eclipse CDT and MinGW installed
2) My Eclipse projects are built using DT's cross-compiler (powerpc-405-linux-gnu-gcc/g++) and linked to the DT provided PPMAC libraries. NOTE: I did have to upgrade the version of 'make' (the version provided by DT isn't completely compatible with Eclipse for some reason)
3) Eclipse automatically generates the makefiles as part of the build process
4) RSE lets you create remote targets and build groups. For example, I have one build group that builds all of my projects and downloads them to the correct location on the PPMAC when finished.
5) RSE also provides pretty convenient telnet terminal(s) for debugging + starting and stopping apps
6) The Eclipse debugger CAN debug remotely, but it requires upgrading the PPMAC from Lenny to Squeeze (so you can install gdbserver on the PPMAC). I haven't taken it this far, but plan to do so in the future.

If you have any specific questions, let me know. It took a little bit to get everything working, but it is almost completely seamless the way I have it set up now.

As a side note, using Eclipse for PPMAC development is definitely not for everyone! For example, I cannot do motion programs or PLCs in Eclipse (I haven't tried it at least). However, Eclipse does let you create your own project structure, and the more advanced intellisense, auto-coloring, and refactoring support is great! Plus, you can build and download applications and libraries individually, which (last I checked) you cannot do with the vanilla DT IDE.
Reply
#6
Thanks for all of the feedback, it's encouraging to know that there is a precedent for this approach.

shansen, a quick set-up guide for eclipse would be quite convenient (if you have it?)
Reply
#7
pmurcutt:

I have already written a quick setup guide on using Eclipse for PPMAC development, but it isn't fully completed yet. Seeing as you and several other individuals have asked me for something similar, I will try to clean it up and get it to a workable state (maybe by next week)? It depends on my workload...

The main thing is getting Eclipse setup to use the cross-compiler and then linking the correct libraries. The rest is cake!

Reply
#8
Hi shansen and all

I am starting now to build for my first standalone C application for the PMAC. It this guide still true? Do you have any new hints or should I follow straightforward these steps?

Many thanks for your guide!

Bests
gigi

(06-01-2012, 01:24 PM)shansen Wrote: @MClement:

I've just been using Eclipse CDT, in addition to the RSE plugin.

Here is how my IDE is setup:

1) Windows 7 with Eclipse CDT and MinGW installed
2) My Eclipse projects are built using DT's cross-compiler (powerpc-405-linux-gnu-gcc/g++) and linked to the DT provided PPMAC libraries. NOTE: I did have to upgrade the version of 'make' (the version provided by DT isn't completely compatible with Eclipse for some reason)
3) Eclipse automatically generates the makefiles as part of the build process
4) RSE lets you create remote targets and build groups. For example, I have one build group that builds all of my projects and downloads them to the correct location on the PPMAC when finished.
5) RSE also provides pretty convenient telnet terminal(s) for debugging + starting and stopping apps
6) The Eclipse debugger CAN debug remotely, but it requires upgrading the PPMAC from Lenny to Squeeze (so you can install gdbserver on the PPMAC). I haven't taken it this far, but plan to do so in the future.

If you have any specific questions, let me know. It took a little bit to get everything working, but it is almost completely seamless the way I have it set up now.

As a side note, using Eclipse for PPMAC development is definitely not for everyone! For example, I cannot do motion programs or PLCs in Eclipse (I haven't tried it at least). However, Eclipse does let you create your own project structure, and the more advanced intellisense, auto-coloring, and refactoring support is great! Plus, you can build and download applications and libraries individually, which (last I checked) you cannot do with the vanilla DT IDE.
Reply
#9
piefum:

If you only need C applications, I would recommend Delta Tau's IDE. It is already set up with this capability, and it is much easier to use.

That being said, my company has been using Eclipse instead of Delta Tau's IDE for several years now. Like anything, there are benefits and drawbacks to either method. Using Eclipse is not "easy" or "out-of-the-box" like Delta Tau's IDE. But, it does give us much more flexibility for organizing our projects, and allows us to compile any C or C++ code that can run on the Power PMAC.
Reply
#10
Hi shansen
thanks for the insight. I asked this because I need to use special libraries (zeromq.org) that seems to not work inside the Deltatau IDE.
I would prefer using the deltatau IDE, but I have some compatibility issues that I cannot (yet) sort out.

Thanks a lot
gigi


(10-10-2014, 08:53 AM)shansen Wrote: piefum:

If you only need C applications, I would recommend Delta Tau's IDE. It is already set up with this capability, and it is much easier to use.

That being said, my company has been using Eclipse instead of Delta Tau's IDE for several years now. Like anything, there are benefits and drawbacks to either method. Using Eclipse is not "easy" or "out-of-the-box" like Delta Tau's IDE. But, it does give us much more flexibility for organizing our projects, and allows us to compile any C or C++ code that can run on the Power PMAC.
Reply
#11
Why doesn't zeromq work with the IDE? What errors are you getting?

I think you should be able to get this to work, but it may require manually editing the Makefile and adding a line to link your Capp against the compiled zeromq library.

Another option is copying your Capp code to the Power PMAC and compiling it locally.
Reply
#12
(10-10-2014, 12:15 PM)shansen Wrote: Why doesn't zeromq work with the IDE? What errors are you getting?

I think you should be able to get this to work, but it may require manually editing the Makefile and adding a line to link your Capp against the compiled zeromq library.

Another option is copying your Capp code to the Power PMAC and compiling it locally.

I get 2 strange behaviors that I cannot understand. First of all, I installed the libraries, everything seems ok, I can see that the libzmq.a, .so, etc in /usr/local/lib and the .h in /usr/local/include
When I load the zmq.h and zmq_utils.h in the IDE and include them in the main .c without using any function of the lib, the compilation is ok (see main.png). However, if I open the zmq.h file, the editor keeps telling me that there are a lot of syntax error (see syntaxerror.png), even if the file should be ansi C compliant.

Then, if I try to use any of the functions inside the zmq.h, I get stopped by the syntax error in the zmq.h (compilation.png).

So, basically, I really don't understand what is happening on the system.
Could it be a compiler issue? Do you think I can get better results if I compile directly the file on the PMAC bypassing the IDE?


thanks
gigi


Attached Files Image(s)
           
Reply
#13
piefum:

It looks like the errors are purely aesthetic, and have nothing to do with the compilation (e.g. the compile is succeeding). I think this is because the Delta Tau IDE is using a custom C language parser and it isn't great at recognizing and mapping all of the referenced include files.

However, if the application compiles, then that means everything is working properly. Have you tried to download and run the application after compiling?
Reply
#14
IDE generates two sets of errors. For each language such as C we have a language service that tries to find syntax errors before they are compiled and they are always shown on the Errors List tab. Sometimes this service shows syntax errors which are not really errors, so do not rely on the errors tab for the validity of your code. It is meant to be a helper but has some issues that needs to be fixed. The correct reflection of the validity of your code happens during the compile time and it's results are displayed in the output window.

(10-13-2014, 07:10 AM)shansen Wrote: piefum:

It looks like the errors are purely aesthetic, and have nothing to do with the compilation (e.g. the compile is succeeding). I think this is because the Delta Tau IDE is using a custom C language parser and it isn't great at recognizing and mapping all of the referenced include files.

However, if the application compiles, then that means everything is working properly. Have you tried to download and run the application after compiling?
Reply
#15
(10-13-2014, 07:10 AM)shansen Wrote: It looks like the errors are purely aesthetic, and have nothing to do with the compilation (e.g. the compile is succeeding). I think this is because the Delta Tau IDE is using a custom C language parser and it isn't great at recognizing and mapping all of the referenced include files.
However, if the application compiles, then that means everything is working properly. Have you tried to download and run the application after compiling?

ok, I understood that, in fact 2nd and 3rd figures show that the compilation is done. Unfortunately, the 1st figure shows the error on the first (only) call zmq_ctx_new(); to the library.
Reply
#16
piefum: Those errors are from the parser, and don't have anything to do with compiling. If the project compiles successfully, then everything is OK even if it is showing errors.
Reply
#17
(10-14-2014, 08:20 AM)shansen Wrote: piefum: Those errors are from the parser, and don't have anything to do with compiling. If the project compiles successfully, then everything is OK even if it is showing errors.

Hi
thanks for the clarification of the parser errors.
Unfortunately, the code does not compile:
Code:
[...]\GLT2.ppproj(168,5): Error : capp1.o: In function `main':
[...]\C Language\Background Programs\capp1capp1.c(64,0): Error :  undefined reference to `zmq_ctx_new'
[...]\GLT2.ppproj(168,5): Error : collect2: ld returned 1 exit status
        Build Process For capp1.out has ended.

Done building project "GLT2.ppproj" -- FAILED.

I think the compiler can not locate the ZMQ libraries, even if they are installed in /usr/local/lib . Do I have to specify some particular options to the GCC?

(in this thread: http://forums.deltatau.com/showthread.php?tid=1705 I explained how I installed the ZMQ libraries on the Power PMAC and how I'd like to use them).

EDIT:
I found out how to compile with the ZMQ libraries.
I downloaded the .c file on the PowerPMAC, connected in SSH and compiled with GCC. I had to use the options -L/usr/local/lib -lzmq to tell the compiler to use the specific libZMQ (it works even without the -L/usr/local/lib):
Code:
gcc capp1.c -L/usr/local/lib -lzmq
A major drawback of this approach is that the compiler can not find the gplib.h library; so for the moment I commented the gplib.h instructions InitLibrary() and CloseLibrary(). If I leave included the gplib.h, gcc replies this:
Code:
capp1.c:1:56: error: gplib.h: No such file or directory
Should I include the gplib.h with an explicit link? Where it is located? I tried to include any of the following:
Code:
/opt/ppmac/libppmac/gplib.h
/opt/www/ppmac/libppmac/gplib.h
/var/ftp/ppmaclibs/libppmac/gplib.h
/var/ftp/www/ppmac/libppmac/gplib.h
but it does not compile.


I also tried to use these compiler option in the IDE, by setting the proper option in the "C App Property", without success.

If I use the option -L/usr/local/lib -lzmq in the "Compile Option", I got the error
Code:
[...]GLT2.ppproj(171,5): Error : powerpc-405-linux-gnu-g++: -lzmq: linker input file unused because linking not done
[...]GLT2.ppproj(171,5): Error : powerpc-405-linux-gnu-gcc: -lzmq: linker input file unused because linking not done
[...]GLT2.ppproj(171,5): Error : capp1.o: In function `main':
[...]capp1capp1.c(64,0): Error :  undefined reference to `zmq_ctx_new'
[...]GLT2.ppproj(171,5): Error : collect2: ld returned 1 exit status

If I use the -L/usr/local/lib -lzmq in the Linker Option, I got this error message:

Code:
[...]GLT2.ppproj(171,5): Error : /usr/local/bin/../lib/gcc/powerpc-405-linux-gnu/4.2.2/../../../../powerpc-405-linux-gnu/bin/ld: cannot find -lzmq
[...]GLT2.ppproj(171,5): Error : collect2: ld returned 1 exit status
        Build Process For capp1.out has ended.

Any idea on how should I proceed?




thanks
gigi
Reply
#18
piefum:

The reason gcc can't find gplib.h is you haven't specified the header file location. To do this, use the "I" flag (e.g. "-I /opt/ppmac/libppmac -I/opt/ppmac/rtpmac"). Also, you will need to include the Delta Tau libraries and Xenomai libraries that they link against ("-lrt -lpthread -lpthread_rt -lppmac").

However, if you prefer to compile under Windows you will need to edit your Capp's makefile to include the "-L/<path-to-libzmq> -lzmq".

This means you will need to copy the compiled binary (libzmq) and zmq header files from the Power PMAC to your PC. On Windows, you can find the Cygwin bash shell that is installed with Delta Tau's IDE at:

Quote:C:\<Program Files Directory>\Delta Tau Data Systems Inc\2.0\Power PMAC Suite\powerpc-460-linux-gnu\bin\bash.exe

If my memory serves me correctly, Delta Tau has mapped the /opt directory to:

Quote:C:\<Program Files Directory>\Delta Tau Data Systems Inc\2.0\Power PMAC Suite\powerpc-460-linux-gnu

I may be wrong on that, I haven't used the IDE in a while. Assuming I am correct, you could then copy the compiled zmq library binary file and the header files to:

Quote:C:\<Program Files Directory>\Delta Tau Data Systems Inc\2.0\Power PMAC Suite\powerpc-460-linux-gnu\usr\local\zmq

Then, edit the Capp makefile to include "-L/opt/usr/local/zmq -lzmq". Now, use the bash shell to navigate to your Capp's directory (where the makefile is) and compile it by issuing "make".
Reply
#19
Hi shansen

thanks for the great tips.
We are converging to a solution, but we still miss something.

First, regarding the compilation under the Power Pmac Linux: this is the command that I need to issue to correctly compile with the ZMQ libs and gplib:

Code:
gcc capp1.c -I/opt/ppmac/libppmac -I/opt/ppmac/rtpmac -L/usr/local/lib -L/usr/local/xenomai-2.5.6/lib -L/var/ftp/ppmaclibs/libppmac -lzmq -lrt -lpthread -lpthread_rt -lppmac

I found all the path using the locate function on the linux: there are a lot of path containing the pthread_rt and ppmac libs, I picked up the most appealing path... if they are not the correct ones, please let us know.
To correctly run the executable, I also need to set the $LD_LIBRARY_PATH variable according to the libraries path found above.

Anyway, I make it work this way! Obviously, a solution that passes through the IDE and not through ftp + ssh + manual gcc + vim + anything that is needed to do that is very welcome.


Let's go then to the discussion regarding the compilation under Windows.

Here's a couple of clarification for who needs to do this job from the beginning:
1- the correct path for the root dir on the windows pc is:
Code:
C:\Program Files (x86)\Delta Tau Data Systems Inc\2.0\Power PMAC Suite\powerpc-460-linux-gnu
2- the cygwin.bat file is not correct (or the installation went wrong): I don't have the system PATH environment variable to point to the cygwin dir. To use the cygwin and all the tools available under it, modify the cygwin.bat file adding the set PATH line as follows (or with your current bash / cygwin path):

Code:
@echo off
set PATH=C:\Program Files (x86)\Delta Tau Data Systems Inc\2.0\Power PMAC Suite\powerpc-460-linux-gnu\bin;%PATH%
bash --login -i

So, back to the real problem: I copied the libs and includes files in a dir under /usr/local/zmq, modified the makefile and then tried to compile, without success. I added in the makefile the "-L/usr/local/zmq -lzmq" and also a "-I/usr/local/zmq" to tell the compiler where to find the include files (not sure this -I is mandatory). Note that if I try to compile under the IDE and the Capp -L -l options correctly set, I got the same compilation errors, copied hereafter:

Code:
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `vtable for std::basic_streambuf<char, std::char_traits<char> >@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `VTT for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `operator delete(void*)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `operator delete(void*, std::nothrow_t const&)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)@GLIBCXX_3.4.9'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::locale::locale()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_ios<char, std::char_traits<char> >::~basic_ios()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_leak()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::locale::~locale()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::nothrow@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base const*)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `vtable for __cxxabiv1::__class_type_info@CXXABI_1.3'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `__cxa_end_catch@CXXABI_1.3'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `__cxa_rethrow@CXXABI_1.3'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*, unsigned int)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::ios_base::ios_base()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned int, unsigned int, unsigned int)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `vtable for std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `vtable for std::basic_ios<char, std::char_traits<char> >@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `vtable for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `__gxx_personality_v0@CXXABI_1.3'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned int, unsigned int) const@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::__throw_out_of_range(char const*)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `operator new(unsigned int, std::nothrow_t const&)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::basic_ostream<char, std::char_traits<char> >::_M_insert<unsigned long>(unsigned long)@GLIBCXX_3.4.9'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `vtable for __cxxabiv1::__si_class_type_info@CXXABI_1.3'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char> const&)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_leak_hard()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `__cxa_begin_catch@CXXABI_1.3'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::ios_base::~ios_base()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info@CXXABI_1.3'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `__cxa_pure_virtual@CXXABI_1.3'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::__throw_bad_alloc()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, unsigned int, std::allocator<char> const&)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `operator new(unsigned int)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : /usr/local/zmq/libzmq.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::clear()@GLIBCXX_3.4'
[...]GLT2.ppproj(171,5): Error : collect2: ld returned 1 exit status
        Build Process For capp1.out has ended.

Done building project "GLT2.ppproj" -- FAILED.

These errors seems really strange to me, because it seems a linking problem to basic include files such string.h and so on. In fact, using the bash, I can issue a "make depend" to check dependencies, and what I got is the following (sorry for the layout, the copying from the shell is crappy):

Code:
makedepend: warning:  capp1.c (reading /opt/eldk-4.2/debian_rootfs/usr/local/xen
omai/include/posix/semaphore.h, line 57): cannot find include file "semaphore.h"

        not in /usr/local/zmq/semaphore.h
makedepend: warning:  /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/status.h:
non-portable whitespace encountered at line 17
makedepend: warning:  /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/status.h:
non-portable whitespace encountered at line 18
makedepend: warning:  /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/status.h:
non-portable whitespace encountered at line 19
makedepend: warning:  /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/status.h:
non-portable whitespace encountered at line 20
makedepend: warning:  /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/status.h:
non-portable whitespace encountered at line 21
makedepend: warning:  capp1.c (reading /opt/eldk-4.2/debian_rootfs/opt/ppmac/lib
ppmac/cmdprocessor.h, line 4): cannot find include file "stdio.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/stdio
.h
        not in /usr/local/zmq/stdio.h
makedepend: warning:  /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/cmdprocesso
r.h:  non-portable whitespace encountered at line 12
makedepend: warning:  capp1.c (reading /opt/eldk-4.2/debian_rootfs/usr/local/xen
omai/include/posix/sys/socket.h, line 24): cannot find include file "sys/socket.
h"
        not in /usr/local/zmq/sys/socket.h
makedepend: warning:  capp1.c (reading /opt/eldk-4.2/debian_rootfs/opt/ppmac/lib
ppmac/modbus.h, line 17): cannot find include file "netinet/in.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/netinet/in.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/netinet/in.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/netinet/in.
h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/netin
et/in.h
        not in /usr/local/zmq/netinet/in.h
makedepend: warning:  capp1.c (reading /opt/eldk-4.2/debian_rootfs/opt/ppmac/lib
ppmac/modbus.h, line 18): cannot find include file "netinet/ip.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/netinet/ip.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/netinet/ip.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/netinet/ip.
h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/netin
et/ip.h
        not in /usr/local/zmq/netinet/ip.h
makedepend: warning:  capp1.c (reading /opt/eldk-4.2/debian_rootfs/opt/ppmac/lib
ppmac/modbus.h, line 19): cannot find include file "netinet/tcp.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/netinet/tcp.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/netinet/tcp.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/netinet/tcp
.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/netin
et/tcp.h
        not in /usr/local/zmq/netinet/tcp.h
makedepend: warning:  capp1.c (reading /opt/eldk-4.2/debian_rootfs/opt/ppmac/lib
ppmac/mbserverlib.h, line 20): cannot find include file "netinet/in.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/netinet/in.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/netinet/in.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/netinet/in.
h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/netin
et/in.h
        not in /usr/local/zmq/netinet/in.h
makedepend: warning:  capp1.c (reading /opt/eldk-4.2/debian_rootfs/opt/ppmac/lib
ppmac/mbserverlib.h, line 21): cannot find include file "netinet/ip.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/netinet/ip.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/netinet/ip.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/netinet/ip.
h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/netin
et/ip.h
        not in /usr/local/zmq/netinet/ip.h
makedepend: warning:  capp1.c (reading /opt/eldk-4.2/debian_rootfs/opt/ppmac/lib
ppmac/mbserverlib.h, line 22): cannot find include file "netinet/tcp.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/netinet/tcp.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/netinet/tcp.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/netinet/tcp
.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/netin
et/tcp.h
        not in /usr/local/zmq/netinet/tcp.h
makedepend: warning:  capp1.c (reading /opt/eldk-4.2/debian_rootfs/opt/ppmac/lib
ppmac/gplib.h, line 47): cannot find include file "sys/ipc.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/sys/ipc.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/sys/ipc.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/sys/ipc.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/sys/i
pc.h
        not in /usr/local/zmq/sys/ipc.h
makedepend: warning:  capp1.c (reading /opt/eldk-4.2/debian_rootfs/opt/ppmac/lib
ppmac/gplib.h, line 48): cannot find include file "sys/shm.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/sys/shm.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/sys/shm.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/sys/shm.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/sys/s
hm.h
        not in /usr/local/zmq/sys/shm.h
makedepend: warning:  capp1.c (reading ../../Include/zmq.h, line 48): cannot fin
d include file "stddef.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/stddef.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/stddef.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/stddef.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/stdde
f.h
        not in /usr/local/zmq/stddef.h
makedepend: warning:  capp1.c (reading ../../Include/zmq.h, line 49): cannot fin
d include file "stdio.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/stdio
.h
        not in /usr/local/zmq/stdio.h
makedepend: warning:  capp1.c (reading ../../Include/zmq.h, line 87): cannot fin
d include file "stdint.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/stdint.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/stdint.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/stdint.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/stdin
t.h
        not in /usr/local/zmq/stdint.h
makedepend: warning:  capp1.c (reading ../../Include/zmq_utils.h, line 23): cann
ot find include file "stdio.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/stdio
.h
        not in /usr/local/zmq/stdio.h
makedepend: warning:  capp1.c (reading ../../Include/zmq_utils.h, line 24): cann
ot find include file "string.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/string.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/string.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/string.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/strin
g.h
        not in /usr/local/zmq/string.h
makedepend: warning:  capp1.c (reading ../../Include/zmq_utils.h, line 25): cann
ot find include file "stdlib.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/stdlib.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/stdlib.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/stdlib.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/stdli
b.h
        not in /usr/local/zmq/stdlib.h
makedepend: warning:  capp1.c (reading ../../Include/zmq_utils.h, line 38): cann
ot find include file "stdint.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/stdint.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/stdint.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/stdint.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/stdin
t.h
        not in /usr/local/zmq/stdint.h
makedepend: warning:  capp1.c, line 40: cannot find include file "stdio.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/stdio.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/stdio
.h
        not in /usr/local/zmq/stdio.h
makedepend: warning:  capp1.c, line 42: cannot find include file "string.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/string.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/string.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/string.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/strin
g.h
        not in /usr/local/zmq/string.h
makedepend: warning:  capp1.c, line 43: cannot find include file "assert.h"
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/rtpmac/assert.h
        not in /opt/eldk-4.2/debian_rootfs/opt/ppmac/libppmac/assert.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/assert.h
        not in /opt/eldk-4.2/debian_rootfs/usr/local/xenomai/include/posix/asser
t.h
        not in /usr/local/zmq/assert.h

So, basically it seems that the compiler cannot reach include files that are however standards and installed on the system.
Any ideas?


Many many thanks
gigi
Reply
#20
piefum:

We are definitely getting closer to a solution here!

First of all, you should be using bash.exe in the powerpc-460-linux-gnu/bin directory, not cygwin.bat. The Delta Tau IDE isn't using a full Cygwin installation, instead it's a custom installation that has been modified with the correct paths.

After opening bash.exe, you should be able to type "mount" and see the two mount points that Delta Tau set up for / and for /opt.

If you can get this far, then try navigating to the Capp folder of your project. As far as Linux paths go, in Cygwin you should use /cygdrive/c/ to get to your computer's C drive (don't use Windows paths like C:\Program Files (x86)\...).

First, use the unmodified makefile (Delta Tau standard) and issue a "make" command. This is how the IDE compiles code, so this should succeed. If it doesn't succeed, then we need to figure out why before proceeding.

Secondly, modify the makefile and try to compile again. All paths must match what is on your PC, and this may be slightly different than what is on the Power PMAC! For example, /var/ftp/ppmaclibs does not exist on your PC, so you will need to use /usr/local/ppmaclibs.

If you are still having problems you could try cross-compiling zmq from scratch on your PC via Cygwin, and then compile your Capp against the cross-compiled zmq binary. Again, you will need to modify your gcc/makefile flags so the paths match what is on your PC.
Reply
#21
piefum:

I forgot that in order to use the bash shell in Cygwin, you will may need to set your Windows "Path" environment variable before opening bash.exe.

Specifically, you need to add the following two paths to the PATH variable:

Quote:C:\Program Files (x86)\Delta Tau Data Systems Inc\2.0\Power PMAC Suite\powerpc-460-linux-gnu\bin

C:\Program Files (x86)\Delta Tau Data Systems Inc\2.0\Power PMAC Suite\powerpc-460-linux-gnu\usr\local\bin

After adding these paths, you should be able to use bash.exe.
Reply
#22
Hi shansen

many thanks for all the clarification.
Unfortunately, I need to move to another part of the project, so I don't have time now to make work the compilation under the windows machine. I will get back there in a couple of weeks, I hope. For the moment, I will keep going with the direct compilation of the code under the linux machine.

Many thanks to everyone!
gigi



(10-21-2014, 08:38 AM)shansen Wrote: piefum:

I forgot that in order to use the bash shell in Cygwin, you will may need to set your Windows "Path" environment variable before opening bash.exe.

Specifically, you need to add the following two paths to the PATH variable:

Quote:C:\Program Files (x86)\Delta Tau Data Systems Inc\2.0\Power PMAC Suite\powerpc-460-linux-gnu\bin

C:\Program Files (x86)\Delta Tau Data Systems Inc\2.0\Power PMAC Suite\powerpc-460-linux-gnu\usr\local\bin

After adding these paths, you should be able to use bash.exe.
Reply
#23
Hi All
the application (compiled under the PMAC) is working fine; the time for this project is running out, so I don't think I will have time to spent to compile it under the windows machine.

Now I'd like to start the application automatically as a background process, at the startup of the PMAC.

Is there any particular way to start this application, or should I go with the classic init.d scripts? What does it do the "Run At Startup" flag on the IDE?


--edit:
I found the answer here:
http://forums.deltatau.com/showthread.ph...ht=startup


thanks
gigi
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)