Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-12-2014, 21:04   #1
Registered User

Join Date: Oct 2014
Location: Under Downunder
Posts: 16
Compile on VS 2010 with one error?

Hi,

Running Win 7, VS 2010 and the latest git clone.

I understand what the problem is but not where to go to fix it in VS 2010.


I have followed the “Compiling – Windows” file and have succeeded until at the Solution>opencpn>build stage where the following output indicates an unresolved external, I must have made a mistake but cannot find out how or where to fix it.

Thanks for your help.
Glen

Code:

1>------ Build started: Project: i18n, Configuration:  Debug Win32 ------ 1>  i18n: Done.
 2>------ Build started: Project: opencpn,  Configuration: Debug Win32 ------
 2>  about.cpp
 2>     Creating library  C:/Users/Glen/Dev/OpenCPN/MakBin/Debug/opencpn.lib and object  C:/Users/Glen/Dev/OpenCPN/MakBin/Debug/opencpn.exp
 2>S57ENC.lib(s57chart.obj) : error LNK2019:  unresolved external symbol "__declspec(dllimport) void __cdecl  wxOnAssert(wchar_t const *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z) referenced in function "public: virtual  __thiscall s57chart::~s57chart(void)" (??1s57chart@@UAE@XZ)
 2>S57ENC.lib(TexFont.obj) : error LNK2001: unresolved  external symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const  *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>glChartCanvas.obj : error LNK2001: unresolved  external symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const  *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>glTexCache.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>S57ENC.lib(s52plib.obj) : error LNK2001: unresolved  external symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const  *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>S57ENC.lib(cm93.obj) : error LNK2001: unresolved  external symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const  *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>chartsymbols.obj : error LNK2001: unresolved  external symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const  *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>razdsparser.obj : error LNK2001: unresolved  external symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const  *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>toolbar.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>OCPNRegion.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>pluginmanager.obj : error LNK2001: unresolved  external symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const  *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>jsonwriter.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>jsonreader.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>jsonval.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>TCDataFactory.obj : error LNK2001: unresolved  external symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const  *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>TCDataSource.obj : error LNK2001: unresolved  external symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const  *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>options.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>gshhs.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>AIS_Decoder.obj : error LNK2001: unresolved  external symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const  *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>statwin.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>Station_Data.obj : error LNK2001: unresolved  external symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const  *,int,char const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>IDX_entry.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>chart1.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>ocpn_pixel.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>chartdbs.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>chcanv.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxOnAssert(wchar_t const *,int,char  const *,wchar_t const *,wchar_t const *)"  (__imp_?wxOnAssert@@YAXPB_WHPBD00@Z)
 2>chart1.obj : error LNK2001: unresolved external  symbol "public: virtual void __thiscall wxAppConsole::OnAssertFailure(wchar_t  const *,int,wchar_t const *,wchar_t const *,wchar_t const *)"  (?OnAssertFailure@wxAppConsole@@UAEXPB_WH000@Z)
 2>chart1.obj : error LNK2001: unresolved external  symbol "public: virtual void __thiscall wxAppConsole::OnAssert(wchar_t const  *,int,wchar_t const *,wchar_t const *)"  (?OnAssert@wxAppConsole@@UAEXPB_WH00@Z)
 2>ocpn_pixel.obj : error LNK2019: unresolved external  symbol "__declspec(dllimport) void __cdecl wxLogDebug(wchar_t const *,...)"  (__imp_?wxLogDebug@@YAXPB_WZZ) referenced in function "public: void __thiscall  ocpnMemDC::SelectObject(class wxDIB &)"  (?SelectObject@ocpnMemDC@@QAEXAAVwxDIB@@@Z)
 2>jsonwriter.obj : error LNK2019: unresolved external  symbol "__declspec(dllimport) void __cdecl wxLogTrace(wchar_t const *,wchar_t  const *,...)" (__imp_?wxLogTrace@@YAXPB_W0ZZ) referenced in function "protected:  int __thiscall wxJSONWriter::WriteString(class wxOutputStream &,class  wxString const &)"  (?WriteString@wxJSONWriter@@IAEHAAVwxOutputStream@@ABVwxString@@@Z)
 2>jsonreader.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxLogTrace(wchar_t const *,wchar_t  const *,...)" (__imp_?wxLogTrace@@YAXPB_W0ZZ)
 2>jsonval.obj : error LNK2001: unresolved external  symbol "__declspec(dllimport) void __cdecl wxLogTrace(wchar_t const *,wchar_t  const *,...)" (__imp_?wxLogTrace@@YAXPB_W0ZZ)
 2>C:\Users\Glen\Dev\OpenCPN\MakBin\Debug\opencpn.exe  : fatal error LNK1120: 5 unresolved externals
 ========== Build: 1 succeeded, 1 failed, 5 up-to-date, 0  skipped ==========

__________________

__________________
Glen96 is offline   Reply With Quote
Old 05-12-2014, 03:19   #2
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,967
Re: Compile on VS 2010 with one error?

Glen...
I'm not an expert of any kind but until a such appears I can share my own experiences:

First
Run F5 or F7 again, sometimes plugins builds in not the best order so one build has to use what done in a previous run.
Second
Check that all files needed for debug build are copied, see: Compiling - Windows | Official OpenCPN Homepage § 4.2b (use the path method) and §6

To copy all files as of §6 I use a bat file, attached. Edit it to fit your environment if you want to try. (Save the file and discard the ".pdf" extension.) I'm on XP I hope it works in W7 as well.

If you'll like to debug also plugins change in pluginmanager.cpp: 226 (Again, edit to fit your environment. My example loads the dashboard. If you like to debug also any other plugin you have to copy all debug files for that plugin to the same folder)
Code:
bool PlugInManager::LoadAllPlugIns(const wxString &plugin_dir, bool load_enabled, bool b_enable_blackdialog)
{    
#if _DEBUG
    m_plugin_location = _T("C:\\Builds\\OpenCPN\\opencpn\\build\\plugins\\dashboard_pi\\Debug\\"); //Has for debug use
#else
    m_benable_blackdialog = b_enable_blackdialog;    
    m_plugin_location = plugin_dir;
#endif
Good luck
Håkan
Attached Files
File Type: pdf CopyFiles.bat.pdf (1.2 KB, 20 views)
__________________

__________________
Hakan is offline   Reply With Quote
Old 05-12-2014, 07:06   #3
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
Re: Compile on VS 2010 with one error?

Glen...

I think you are trying to make a Debug build.

Looks to me like you are attempting to link with the Release version of wxWidgets. The missing methods are mostly wxOnAssert(), which does not exist in Release build of Wx.

Build wxWidgets for Debug, and copy the dll(s) and export library into your OCPN Debug build directory.

Good Luck
Dave
__________________
bdbcat is offline   Reply With Quote
Old 07-12-2014, 17:15   #4
Registered User

Join Date: Oct 2014
Location: Under Downunder
Posts: 16
Re: Compile on VS 2010 with one error?

Thank you Håkan and Dave for your help.

I have now achieved a clean debug compile.

Two notes that may be of interest re doc ”Compiling Windows”:
2.2a – Compile wxWidgets, alternative 1:
“nmake -f makefile.vc BUILD=release MONOLITHIC=0 SHARED=1 UNICODE=1 USE_GDIPLUS=1 USE_OPENGL=1”

With nmake edited to cmake it failed with massage “... USE_OPENGL=1 does not exist”.
I Used alterative 2 ie VS2010 to continue.
Preparing to run the Debug build:
“...you must create a folder named uidata in your build directory and copy ...”
Folder uidata was required in the build\debud folder.

The reason for the debug version is that I am developing an Autopilot that connects via TCP/IP. When I run the AP as a stand alone all runs well, but when linked to OpenCPN via TCP I am getting random memory corruption I think is mainly involved with lat and long values.

Is it possible to to use the ini and data files associated with the originally installed OpenCPN, to initialize the debug version so as to generate the same debug environment?

Dave, I love your navigator, has he /she had pups?

Regards
Glen
__________________
Glen96 is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compile opencpn codes on Windows 7, not use Visual Studio 2010 bailizi OpenCPN 1 18-07-2012 03:40
Can Someone Help Compile on Raspberry Pi ? jimseng OpenCPN 11 06-07-2012 17:24
make package from a fresh compile: about files right?? manuprenlair OpenCPN 8 11-06-2012 23:44
Compile for Arm processor jimseng OpenCPN 6 28-04-2012 01:18
Fedora Compile Link Error oystercatcher OpenCPN 4 16-12-2010 16:37



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 10:53.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.