LNK2019 and WX_DEFINE_EXPORTED_ARRAY Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
mael15
Super wx Problem Solver
Super wx Problem Solver
Posts: 449
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

LNK2019 and WX_DEFINE_EXPORTED_ARRAY

Post by mael15 » Mon May 25, 2009 2:27 pm

hi everyone,

i am trying to build a wxWidgets dll and get the following error:

Code: Select all

1>bundle.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class libdf::DTube * & __thiscall libdf::ArrayOfDTube::Item(unsigned int)const " ([email protected]
as far as i understand this, wxArray->Item() cannot be found in ArrayOfDTube.

now, ArrayOfDTube is defined as

Code: Select all

WX_DEFINE_EXPORTED_ARRAY(DTube *, ArrayOfDTube);
and also DTube is declared as
class __declspec(dllexport) DTube
why this error then?
all needed files are within the same unit, so no additional libs have to be linked, right?

thanx in advance!

ps: i avoid posting the full code since the file has >1000 lines.

tan
Moderator
Moderator
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Re: LNK2019 and WX_DEFINE_EXPORTED_ARRAY

Post by tan » Mon May 25, 2009 2:53 pm

Hi,
mael15 wrote:hi everyone,

i am trying to build a wxWidgets dll and get the following error:

Code: Select all

1>bundle.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class libdf::DTube * & __thiscall libdf::ArrayOfDTube::Item(unsigned int)const " ([email protected]
as far as i understand this, wxArray->Item() cannot be found in ArrayOfDTube.

now, ArrayOfDTube is defined as

Code: Select all

WX_DEFINE_EXPORTED_ARRAY(DTube *, ArrayOfDTube);
i guess you have to use
WX_DEFINE_USER_EXPORTED_ARRAY(T, name, exportspec)
macro instead of
WX_DEFINE_EXPORTED_ARRAY(T, name)

Look here: http://docs.wxwidgets.org/stable/wx_wxa ... efinearray
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10

mael15
Super wx Problem Solver
Super wx Problem Solver
Posts: 449
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

Post by mael15 » Mon May 25, 2009 3:41 pm

yeah, that sounds great!
stupid question maybe, but what do they mean with the third parameter "exportspec"? i cound not find any explanation...

tan
Moderator
Moderator
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post by tan » Mon May 25, 2009 5:14 pm

mael15 wrote:yeah, that sounds great!
stupid question maybe, but what do they mean with the third parameter "exportspec"? i cound not find any explanation...
Well, i believe it is class __declspec(dllexport).
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10

mael15
Super wx Problem Solver
Super wx Problem Solver
Posts: 449
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

Post by mael15 » Tue May 26, 2009 7:49 am

aaaaah yeah!
that helped me a great deal, thanx!
absolutely nothing to find about this on the net...

Post Reply