You are here:

C++/I found the answer to a question I asked earlier, and wanted to thank you for your help

Advertisement


Question
I asked you a question earlier about loading modules using the DL library.

I did find the answer to my question, and the answer was actually in what you sent to me in the 'why-I-can't-answer-this-question' part of the reply :)  I actually didn't know that C++ mangled the functions when they were linked in order to support overloading; this is what caused the problem when I tried to call the function from the library.  Because it searched for the name of the symbol that I provided, and I assumed the name would be the same as the function as it appeared when I programmed it, it naturally couldn't find the symbol after the library was compiled and the name had been messed up.

If you're interested:
http://www.isotton.com/howtos/C++-dlopen-mini-HOWTO/C++-dlopen-mini-HOWTO.html
is where I found the answer along with a great tutorial on the subject.

I also wanted to thank you; I've asked 4 or 5 professors this question and they haven't had a clue :)  You, at least, made some suggestions that pointed me in the right direction :)  I was getting REALLY frustrated with the entire thing; this is a pretty common library, but nobody had anything about it other than its basic usage.

In any case, I'll let you get back to your weekend.  Thanks again!

-Gilbert

Answer
Thanks for the information.
I rejected your question because until you asked I had not
looked into the UN*X dl API calls so was not sure of my facts. As such the information I gave may not have been up to quality...nice to know I hit the nail on the head this time!

I have had similar experiences else where - for example on Windows I have both the MS VC++ compiler and the Comeau C++ compiler. The latter is quite happy to call Windows C API  functions but cannot call C++ ones - such as when using the MS MFC DLLs provided by MS with their VC++ compiler as the way Comeau mangles the names is different to how the MS compiler does it! A solution, BTW, would be to re-build the MFC libraries from the MFC source code using the Comeau compiler.

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Ralph McArdell

Expertise

I am a software developer with more than 15 years C++ experience and over 25 years experience developing a wide variety of applications for Windows NT/2000/XP, UNIX, Linux and other platforms. I can help with basic to advanced C++, C (although I do not write just-C much if at all these days so maybe ask in the C section about purely C matters), software development and many platform specific and system development problems.

Experience

My career started in the mid 1980s working as a batch process operator for the now defunct Inner London Education Authority, working on Prime mini computers. I then moved into the role of Programmer / Analyst, also on the Primes, then into technical support and finally into the micro computing section, using a variety of 16 and 8 bit machines. Following the demise of the ILEA I worked for a small company, now gone, called Hodos. I worked on a part task train simulator using C and the Intel DVI (Digital Video Interactive) - the hardware based predecessor to Indeo. Other projects included a CGI based train simulator (different goals to the first), and various other projects in C and Visual Basic (er, version 1 that is). When Hodos went into receivership I went freelance and finally managed to start working in C++. I initially had contracts working on train simulators (surprise) and multimedia - I worked on many of the Dorling Kindersley CD-ROM titles and wrote the screensaver games for the Wallace and Gromit Cracking Animator CD. My more recent contracts have been more traditionally IT based, working predominately in C++ on MS Windows NT, 2000. XP, Linux and UN*X. These projects have had wide ranging additional skill sets including system analysis and design, databases and SQL in various guises, C#, client server and remoting, cross porting applications between platforms and various client development processes. I have an interest in the development of the C++ core language and libraries and try to keep up with at least some of the papers on the ISO C++ Standard Committee site at http://www.open-std.org/jtc1/sc22/wg21/.

Education/Credentials

©2016 About.com. All rights reserved.