This website uses browsing/session and functional cookies to ensure you get the best experience. Learn More

YARP and Cygwin

From Wiki for iCub and Friends
Jump to: navigation, search

Contents

Trouble with OpenCV?

- follow the procedure at http://www.dh.aist.go.jp/~kimura/opencv/

Trouble with ACE?

- See the ACE for Cygwin report from Cota, and also the next section

Trouble with "make"?

At the time of writing, the version of make distributed with cygwin (3.81) is a bit of a pain to use for compiling ACE. Try:

 make --version

and if it returns 3.81 then you're probably going to have problems compiling ACE.

easiest solution

The easiest solution is to get MinGW's version of make:

 http://www.mingw.org/download.shtml

currently listed as:

 mingw32-make-3.80.0-3.exe

After you install this, just copy the make executable to cygwin's /usr/bin and everything is happy again.

Keep a copy of the original make (or reinstall it) after compiling ace.

harder solution

Alternatively, there is a patch you can apply to make 3.81 at:

 http://cygwin.com/ml/cygwin/2006-09/msg00078.html

Trouble with yarpdev?

Does your yarpdev not run? Possibly, your cygwin PATH environment variable doesn't have paths to all the dynamically linked libraries (e.g., see ~/.bashrc). One way of debugging this is by running yarpdev in a Windows command shell. It should give you error messages indicating which library is not found. (Debugging can proceed by iteratively adding those libraries to your Path in Windows, then later adding those same paths to your PATH environment variable in cygwin). A better way of debugging is using the cygcheck program under cygwin. Run cygcheck with the full pathname of the executable you wish to determine the DLL's for. You may need to add: OpenCV/bin, ACE_wrappers/lib, and cygwin/bin to your cygwin PATH.

Trouble with libraries?

I had some hardware supplied with a library that works fine with Visual Studio, but which was not so friendly to Cygwin. Given that I had Visual Studio, my solution to this was to create a DLL (Dynamic Link Library) using Visual Studio, then within Cygwin enable that library to be called from C++. Some documentation on creating DLL's can be found here:

  http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=617

I created my library as just a series of functions, and didn't create any classes. I have been having a problem enabling linking to classes declared in the DLL's, and using separate standalone functions is the way I've gotten things to work. Each function I've defined has the qualifier:

  extern "C" 

before it, in addition to the Visual Studio / Windows specification for DLL functions:

  __declspec(dllexport) 

Once I had my DLL library (.dll file) created using Visual Studio (which also created a .lib file), the next step is to enable this to be linked into your Cywin C++ program. I found the instructions here:

  http://www.cygwin.com/cygwin-ug-net/dll.html

under the heading "Linking Against DLLs" to be useful. With the exception that I used the .lib file instead of the .dll file for obtaining the symbols. My Cygwin commands were:

   echo EXPORTS > foo.def
   nm tpod2.lib | grep ' T _' | sed 's/.* T _//' >> foo.def

This creates a file containing the symbols you are going to link agains (foo.def). The next two steps are to (a) create a stub library that you can link against:

   dlltool --def foo.def --dllname tpod2.dll --output-lib libtpod2.a

and (b) (still in Cygwin) to link your program that calls into the DLL:

   g++ main.cpp -ltpod2 -L.

Of course, as usual for Cygwin, your .dll file needs to be in your PATH.

Personal tools
Namespaces

Variants
Actions
Navigation
Print/export
Toolbox