Issues Building GMAT on Windows 7

Discussion of compilation configuration and issues

Issues Building GMAT on Windows 7

Postby canna12 » Thu Jan 30, 2014 7:34 pm

Hi all,

I have been following the great document CompilingGMATwithVS2010.pdf (as found here: http://li394-117.members.linode.com:8090/display/GW/Compiling), and my luck has been fairly good up until the point where I am actually building GMAT. I was able to build wxWidgets without too much trouble (I did have to set the include directories manually), and building GMAT starts off just fine. However, during the linking phase I get a whopping 1,905 "LNK2001: unresolved external" errors which prevent GMAT.exe from being created. All the LNK2001s seem to come from functions with "wx" in the prefix, which makes me think this is a wxWidgets problem. Here's a short sample of the errors:

Code: Select all
1>------ Build started: Project: GMAT_wxGui, Configuration: Release Win32 ------
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: virtual class wxObjectRefData * __thiscall wxObject::CloneRefData(class wxObjectRefData const *)const " (__imp_?CloneRefData@wxObject@@MBEPAVwxObjectRefData@@PBV2@@Z)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: virtual class wxObjectRefData * __thiscall wxObject::CreateRefData(void)const " (__imp_?CreateRefData@wxObject@@MBEPAVwxObjectRefData@@XZ)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: virtual void * __thiscall wxClientDataContainer::DoGetClientData(void)const " (__imp_?DoGetClientData@wxClientDataContainer@@MBEPAXXZ)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: virtual void __thiscall wxClientDataContainer::DoSetClientData(void *)" (__imp_?DoSetClientData@wxClientDataContainer@@MAEXPAX@Z)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: virtual class wxClientData * __thiscall wxClientDataContainer::DoGetClientObject(void)const " (__imp_?DoGetClientObject@wxClientDataContainer@@MBEPAVwxClientData@@XZ)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: virtual void __thiscall wxClientDataContainer::DoSetClientObject(class wxClientData *)" (__imp_?DoSetClientObject@wxClientDataContainer@@MAEXPAVwxClientData@@@Z)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall wxControlBase::DoUpdateWindowUI(class wxUpdateUIEvent &)" (__imp_?DoUpdateWindowUI@wxControlBase@@UAEXAAVwxUpdateUIEvent@@@Z)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual bool __thiscall wxControlBase::SetFont(class wxFont const &)" (__imp_?SetFont@wxControlBase@@UAE_NABVwxFont@@@Z)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall wxControlBase::SetLabel(class wxString const &)" (__imp_?SetLabel@wxControlBase@@UAEXABVwxString@@@Z)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall wxIcon::~wxIcon(void)" (__imp_??1wxIcon@@UAE@XZ)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall wxIcon::wxIcon(class wxString const &,long,int,int)" (__imp_??0wxIcon@@QAE@ABVwxString@@JHH@Z)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual bool __thiscall wxBitmap::LoadFile(class wxString const &,long)" (__imp_?LoadFile@wxBitmap@@UAE_NABVwxString@@J@Z)
1>AboutDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class wxImage __thiscall wxBitmap::ConvertToImage(void)const " (__imp_?ConvertToImage@wxBitmap@@QBE?AVwxImage@@XZ)
...


Note: this particular output was created after selecting "Link Only GMAT_wxGui" on the GMAT_wxGui project. The same errors came up at the end of building GMAT_wxGui, but since it takes 20+ minutes to build I just chose to link to show these errors.

My compilation of wxWidgets went okay, and I have all 15 .dll files as specified in the guide. It looks like the problem is that VS2010 can't find the necessary functions in these .dll files when linking for GMAT.exe, but I have no idea how to fix that. All .dlls are present in the "Additional Library Directories" field of the project's "Linker" properties.

Thanks for the help!
canna12
 
Posts: 6
Joined: Thu Jan 16, 2014 8:26 pm

Re: Issues Building GMAT on Windows 7

Postby canna12 » Thu Jan 30, 2014 9:12 pm

Self update -- I've found some kind of workaround, I don't think it gets at the root of the problem but it does at least something. I noticed in the linker's /VERBOSE output that only wxmsw_netutils.lib and wxmsw_stc.lib were being searched, and that they seemed to get linked just fine. I snooped into Properties -> Linker -> Input and saw that under "Additional Dependencies", wxmsw_netutils.lib and wxmsw_stc.lib were listed, and no other .libs from wxWidgets. So I added wxbase28.lib to the list of Additional Dependencies, and what'd you know -- now I'm down from 1,905 unresolved externals to 1,637. Is it safe to manually add each of the wxWidgets libraries to the Additional Dependencies list? Does this shine any more light onto the real issue in my original post?

Thanks,
--canna12
canna12
 
Posts: 6
Joined: Thu Jan 16, 2014 8:26 pm

Re: Issues Building GMAT on Windows 7

Postby jjkparker » Tue Feb 11, 2014 2:48 pm

I don't see an issue with manually adding each one, but you definitely shouldn't need to do this.

Some things to try:
  • Did you build wxWidgets as DLL Debug or DLL Release. Also double-check your platform (x86 or x64). Make sure you're building GMAT in the same mode (Debug or Release, x86 or x64).
  • Did you copy the .dll files to the correct GMAT directory? It should be GmatDevelopment\application\bin for Release and GmatDevelopment\application\debug for Debug.
Joel J. K. Parker
Flight dynamics engineer, GMAT team
http://gmatcentral.org
jjkparker
 
Posts: 617
Joined: Thu Jan 07, 2010 9:48 pm
Location: NASA Goddard Space Flight Center, Greenbelt, MD

Re: Issues Building GMAT on Windows 7

Postby niwyleqyv » Tue Nov 13, 2018 11:04 am

View of the topic has been charged for the error free documentation for the individuals. The use of the parameter whether it is grademiners.com reliable or not for the low of the things for the candidates. It has been mentioned on top of the quality.
niwyleqyv
 
Posts: 1
Joined: Tue Nov 13, 2018 11:04 am


Return to Compiling GMAT

Who is online

Users browsing this forum: No registered users and 3 guests

cron