LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-03-2006, 03:52 PM   #1
neodelphi
LQ Newbie
 
Registered: Dec 2006
Posts: 2

Rep: Reputation: 0
Question Compiling a C++ plugin for XMMS


Hello,

I recently developped a plugin for XMMS written in C. It worked really fine. Now I would like to write a plugin for XMMS in C++, so I changed the extension of my source (from main.c to main.cpp) and I compiled it with g++ instead of gcc.

This doesn't work, XMMS don't recognize my plugin. I tried to find the reason with nm, and these are extract from the output of nm:

Shared library, C version:
...
000017c4 d __JCR_END__
000017c4 d __JCR_LIST__
w _Jv_RegisterClasses
000005ca t plug_about
000005a4 t plug_cleanup
000005f0 t plug_configure
...


Shared libray, C++ version:
...
00001900 D plug_vtable
000018e4 d p.4462
U puts@@GLIBC_2.0
00000582 t _Z11plug_initv
000005ce t _Z12plug_aboutv
000005a8 t _Z14plug_cleanupv
0000056c T _Z16get_vplugin_infov
...


As we can see, the C++ version has _Z prefixes and I think this is why XMMS can't use the plugin. is there a g++ option which can remove the prefixes ? Is it possible to write a C++ plugin for a program written in C ?

Thanks for answering.
neodelphi
 
Old 12-03-2006, 04:00 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

You can definitely write your plug-in in C++: no problem.

But you need to declare all the symbols you're exporting with
Quote:
extern "C" { ...}
'Hope that helps .. PSM
 
Old 12-04-2006, 02:27 PM   #3
neodelphi
LQ Newbie
 
Registered: Dec 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you for answering, I think this could solve my problem. I'll try to look at these and formations.

In fact a friend and I wrote a C++ openGl engine, and I'd like to use it for xmms (just for fun).

thx,
neodelphi
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble compiling xmms mp4 plugin from source: "no such file.." mayasedai Linux - Software 3 02-01-2005 11:13 AM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 05:03 AM
Xmms Plugin 1.2.8 [xmms-config problem] MDMA Mandriva 2 01-29-2004 09:55 AM
XMMS Plugin? Zerodark Linux - Software 2 01-24-2004 01:51 PM
Compiling XMMS plugin for GAIM wiraone Linux - Software 1 12-05-2003 03:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration