Mail Archives: djgpp/2000/03/27/10:49:11
Heavy <heavier AT hotmail DOT com> wrote:
> Hi, I'm having a problem with an assembly file I am trying to compile
> along with the rest of my program. It is a .s file,
[...]
> I have tried to #include it in a related .cpp file,
Completely the wrong way...
> I have linked it as a .o file, but I get an "undefined reference to
> myFunction(...)" error. I have prototyped the function in a header
> file as extern, and I still get the error.
That's the right method, but you've probably missed one crucial bit:
C++ function name mangling. You'll have to prototype it as
extern "C" myFunction();
(add return type and arguments yourself) to tell C++ that this is a
function with 'C-style binding', i.e. it's not a function compiled by
a C++ compiler.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -