LinuxQuestions.org
Review your favorite Linux distribution.
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 04-05-2005, 02:49 AM   #1
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
binreloc with c++


Hi....

I try to use binreloc...
http://autopackage.org/docs/binreloc/

When I tried to compile a simple c++ program with this library, I got error:
prefix.c:59: error: invalid conversion from `void*' to `char*(*)(void*, void*)'

However compiling a c program with this library is okay.....

any solution??? Thank you......
 
Old 04-05-2005, 06:03 AM   #2
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
Never use binReloc before. A general suggestion only.

You can try

extern "C"
{

#include "prefix.h"
}


(Suggested modification in bold)
 
Old 04-05-2005, 09:45 AM   #3
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Original Poster
Rep: Reputation: 31
Same error.
 
Old 04-05-2005, 10:39 AM   #4
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
Really strange. Because in the prefix.c there is already a extern "C" to protect the code from these kind of error.

Anyway, now you can try this modification in perfix.c at line 59

#if __cplusplus
static br_locate_fallback_func fallback_func = (br_locate_fallback_func) NULL;
#else
static br_locate_fallback_func fallback_func = NULL; // the original line
#endif


It can get rid of the compiler error. (AND it ONLY gets rid of the compiler error. Do not know if it could have any impact on the correctness)

Last edited by ahwkong; 04-05-2005 at 10:40 AM.
 
Old 04-06-2005, 02:23 AM   #5
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Original Poster
Rep: Reputation: 31
Thank you......
 
  


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



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

All times are GMT -5. The time now is 02:35 AM.

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