Problems linking when using wxMediaCtrl 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
jazz
Experienced Solver
Experienced Solver
Posts: 73
Joined: Thu Jun 09, 2005 12:37 am
Contact:

Problems linking when using wxMediaCtrl

Post by jazz »

Hey all,

This one really has me stumped and the forums and even google have nothing helpful. :(

I'm trying to use wxMediaCtrl but when I compile and link my program it bombs out with:
...\src\msw\ole\activex.cpp:653: undefined reference to `wxConvertOleToVariant(tagVARIANT const&, wxVariant&)'
...\src\msw\ole\activex.cpp:655: undefined reference to `wxConvertVariantToOle(wxVariant const&, tagVARIANT&)'
:: === Build finished: 2 errors, 0 warnings ===
I have only inserted one line of code:

Code: Select all

this->media = new wxMediaCtrl( this, wxID_ANY, "D:\\test.mp3", wxPoint( 100, 100 ) );
I also have tried linking with ALL the wx Libraries that are available. Anyone know what the deal is? Has anyone successfully used wxMediaCtrl because I can't for the life of me figure out why this wouldn't work.

Cheers,

Jazz
[INSERT LAME SIG HERE]
jazz
Experienced Solver
Experienced Solver
Posts: 73
Joined: Thu Jun 09, 2005 12:37 am
Contact:

Post by jazz »

Ok, I just got this working. This is something I've never come across before. Basically in the linker settings in my IDE i had to move the libwxmsw28_media.a entry higher up the list so (i'm assuming) it gets linked before anything else. I suppose it makes sense, but it's definitely something new for me.

Weird. :S

But it's all working now.
[INSERT LAME SIG HERE]
basos
Earned a small fee
Earned a small fee
Posts: 18
Joined: Wed Aug 20, 2008 4:52 pm
Location: greexe

Thanks for citinh

Post by basos »

Nice to mention that. It solved my problem, too.
Also: some notes::

This situation happens when linking statically

This behaivour is somewhere cited for gcc linker : Order of linking objects should follow their dependencies (i.e. the master objects first, their dependencies last).

Obviously wxMediaCtrl has a variant data type that depends on std libs of wxwidgets..


I'm linking this whith the following added to LDFLAGS

Code: Select all

`wx-config --static=yes --unicode=yes --libs media`
`wx-config --static=yes --unicode=yes --libs std`
with THIS order
Post Reply