Compile:no matching function call to find(...

Post here for assistance in troubleshooting a problem using GMAT

Compile:no matching function call to find(...

Postby martin » Wed Jun 09, 2010 2:04 pm


for quite some time now I have tried to get GMAT up and running, so far with no success. I hope, that someone can point me in the right direction. My most recent (3rd) approach looked as follows:
    1) Checked out the trunk using Eclipse
    2) Copied MakeGmat.eclipse and from build/linux to src
    3) Adapted
    Code: Select all
     USE_DEVIL = 0
     WX_CONFIG_PATH = /usr/bin/
     MATLAB_INCLUDE = -I/opt/matlab/extern/include
     MATLAB_LIB = -L/opt/matlab/bin/glnxa64

    4) Fixed some compile errors

      4.1 Inserted #include <cstring> into solarsys/PlanetaryEphem.hpp to fix:
      Code: Select all
          Attitude.o attitude/Attitude.cpp
          In file included from solarsys/CelestialBody.hpp:32,
                       from solarsys/SolarSystem.hpp:35,
                       from coordsystem/CoordinateBase.hpp:27,
                       from coordsystem/CoordinateSystem.hpp:26,
                       from attitude/Attitude.hpp:30,
                       from attitude/Attitude.cpp:26:
          solarsys/PlanetaryEphem.hpp: In constructor ‘PlanetaryEphem::dcb_type::dcb_type()’:
          solarsys/PlanetaryEphem.hpp:117: error: ‘strcpy’ was not declared in this scope

      4.2 Again, inserting #include <cstring> into burn/VnbManeuverFrame.cpp did the trick and got rid of
      Code: Select all
          VnbManeuverFrame.o burn/VnbManeuverFrame.cpp
          burn/VnbManeuverFrame.cpp: In member function ‘virtual void VnbManeuverFrame::CalculateBasis()’:
          burn/VnbManeuverFrame.cpp:107: error: ‘memcpy’ was not declared in this scope

Now I am stuck with an error that I cannot fix:
Code: Select all
coordsystem/CoordinateSystem.cpp: In member function ‘virtual const StringArray& CoordinateSystem::GetRefObjectNameArray(Gmat::ObjectType)’:
coordsystem/CoordinateSystem.cpp:1138: error: no matching function for call to ‘find(__gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, __gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)’
make[2]: *** [coordsystem/CoordinateSystem.o] Error 1

I am running Ubuntu 10.04 on a 64Bit ThinkPad:
Code: Select all
Linux piratix 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010 x86_64 GNU/Linux

wxwidgets is installed:
Code: Select all
/usr/bin/wx-config --version

My Matlab version is (R2010a).

Currently I am running out of time, so any help is greatly appreciated.

Best regards,

Posts: 2
Joined: Wed Jun 09, 2010 12:44 pm

Re: Compile:no matching function call to find(...

Postby DJCinSB » Wed Jun 09, 2010 9:25 pm

Hi, Martin.

Part of the problem is that the trunk code hasn't been updated in a couple of years, and in that time the GCC developers have rearranged the C++ compiler header files, breaking the build. That's the reason that you needed to add an include for <cstring>; find() is in the STL header file <algorithm>. The older version of GMAT (the one in trunk) wasn't ever built on 64-bit platforms, but the current code base is -- I build daily on Ubuntu 10.04 64-bit when I'm in the office (I'm on travel this week, but will be back next week), and am using MATLAB 2010a on that box. So I suspect I'll be able to supply some help!

Ongoing GMAT development is happening in a branch that you can access this way:
Code: Select all
svn co gmat-dev

One thing you'll find (happily, I hope!) if you check out that version of the repository is a set of build files tailored to 64-bit Linux -- specifically, Ubuntu 10.04, since that is my development box of choice. (The BuildEnv file you'll want is in build/linux64; we no longer have platform specific makefiles.) Try using that code base and let me know when you get stuck. You'll need to check the path info for MATLAB (I usually put it in /opt), specify if you want to use DevIL (I generally do, but hope to move away from that ugly option soon -- I can send you DevIL files if you'd like once I'm back at my office), and the other settings that you may want. You probably don't need the WX_CONFIG_PATH setting if wx-config is in your path; I generally don't set that one on my machines.

We have had problems using pre-built wx libraries because they are usually built with unicode enabled, and GMAT's code isn't unicode compliant. Instructions for building wx for Linux can be found here: ... e+on+Linux

These are a little old, but still look good to me. We're currently building on wx 2.8.10. You can find some additional Linux build details on the GMAT wiki at ... g+on+Linux

That page was written while building on 32-bit Linux regularly, but should still be mostly good.

Anyway. I hope that helps. Let me know how your build proceeds!

- Darrel
Posts: 274
Joined: Mon Jun 09, 2008 3:57 pm

Re: Compile:no matching function call to find(...

Postby martin » Thu Jun 10, 2010 11:25 pm

Hello Darrel,

thank you much for your quick and comprehensive answer.

I think it would be good to emphasize the "old trunk" issue in the installation instructions in order to prevent frustration.

It looks like using the built-in wxWidgets 2.8.10 does not work (I guess it's the unicode support). So I had to compile it myself and encountered an error which if fixed using the method suggested here:
So I now have wxWidgets installed w/o unicode support.
    Code: Select all
    Configured wxWidgets 2.8.10 for `x86_64-unknown-linux-gnu'

      Which GUI toolkit should wxWidgets use?                 GTK+ 2
      Should wxWidgets be compiled into single library?       no
      Should wxWidgets be compiled in debug mode?             no
      Should wxWidgets be linked as a shared library?         yes
      Should wxWidgets be compiled in Unicode mode?           no
      What level of wxWidgets compatibility should be enabled?
                                           wxWidgets 2.4      no
                                           wxWidgets 2.6      yes
      Which libraries should wxWidgets use?
                                           jpeg               sys
                                           png                sys
                                           regex              sys
                                           tiff               builtin
                                           zlib               sys
                                           odbc               no
                                           expat              sys
                                           libmspack          no
                                           sdl                no

I did pretty much as you suggested. The modifications I made to after copying it from build/linux64/:
    There was no flag for matlab, so I inserted USE_MATLAB = 1, also I copied the Matlab-specific settings from my old config:
      Code: Select all
      # MATLAB specific data
      # If you build with MATLAB support, you need to set the path infoirmation here.
      MATLAB_INCLUDE = -I/opt/matlab/extern/include
      MATLAB_LIB = -L/opt/matlab/bin/glnxa64
      MATLAB_LIBRARIES = -leng -lmx -lut \
                         -lmat -lpthread -lstdc++ -lm \
                         -licudata -licuuc -licui18n -licuio -lz -lhdf5 -lxerces-c
    I have no CSPICE installed, so I changed that flag to USE_SPICE = 0

AFAIK our systems should be pretty similar by now, even IL:
    Code: Select all
    martin@piratix:~/installationen/linux/gmat/gmatDev$ ls /usr/local/include/IL/
    config.h  devil_internal_exports.h  il.h  ilu.h  ilu_region.h  ilut.h  il_wrap.h

Make now takes much longer, but still not completes. I encounter around 60 errors, all of them slight modifications of the following:
    Code: Select all
    ‘<anonymous>’ has incomplete type   gmatDev      line 125, external location: /usr/local/include/IL/ilu.h   C/C++ Problem
    ‘ilutGLBindTexImage’ was not declared in this scope   Enhanced3DViewCanvas.cpp   /gmatDev/src/gui/subscriber   line 2323   C/C++ Problem
    at this point in file   Enhanced3DViewCanvas.cpp   /gmatDev/src/gui/subscriber   line 408   C/C++ Problem
    invalid use of ‘ILvoid’   gmatDev      line 125, external location: /usr/local/include/IL/ilu.h   C/C++ Problem
Attached you find the console output:
(58.43 KiB) Downloaded 240 times

So I removed the IL for now: USE_DEVIL = 0 ...
... and for the first time compiled GMAT :D

I'll leave this for today. It would be nice if you could send me your IL files, maybe even better as an attachment to this post.

I hope I didn't post too much information. My idea is, that it might - once this is solved - help someone else with similar problems.


Posts: 2
Joined: Wed Jun 09, 2010 12:44 pm

Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 1 guest