Page 1 of 1

How to enable NASM in Dev-C++?

Posted: Wed Jan 11, 2006 10:52 am
by raywill
How to enable NASM in Dev-C++?

It give me such Link error:
[Linker error] undefined reference to `setvect'

In my project , setvect is defined in the asm file .

Re:How to enable NASM in Dev-C++?

Posted: Wed Jan 11, 2006 10:59 am
by Pype.Clicker
if you can locate something like "do not prepend underscore to symbol names", click it.

otherwise, try renaming "setvect" in "_setvect" in the asm file: MS-* platforms traditionally prepend an underscore to every C-generated symbol, and thus equivalently to extern (unresolved) symbols that you'll write in assembly.

An objdump-like tool should confirm you the symbol tables from the C/C++ part expects _setvect instead of setvect.

Of, make sure you've declared it as a "C" stuff too, or name mangling will be trying to translate it into something like __v7setvectiie or whatever the MS name mangling policy will find appropriate.

Re:How to enable NASM in Dev-C++?

Posted: Wed Jan 11, 2006 11:09 am
by raywill
Pype.Clicker wrote: if you can locate something like "do not prepend underscore to symbol names", click it.

otherwise, try renaming "setvect" in "_setvect" in the asm file: MS-* platforms traditionally prepend an underscore to every C-generated symbol, and thus equivalently to extern (unresolved) symbols that you'll write in assembly.
Oh,sorry.I haven't make the problem clear to you.
I meant to say all functions written in asm can't be found.
To be more clear, I can find any myasm.o file after compiling.

So,I think that's because I haven't set the enviroment for asm correctly.
The question may be changed to "how to let Dev-C++ support ASM?"

Re:How to enable NASM in Dev-C++?

Posted: Wed Jan 11, 2006 12:17 pm
by kataklinger
Did you mark symbols which you want to export from ASM sa [global]?

Re:How to enable NASM in Dev-C++?

Posted: Wed Jan 11, 2006 9:42 pm
by raywill
kataklinger wrote: Did you mark symbols which you want to export from ASM sa [global]?
Yes.

Re:How to enable NASM in Dev-C++?

Posted: Wed Jan 11, 2006 10:04 pm
by Phugoid
I think the question is more about how to cause Dev-C++ to invoke the assembler. I can't help with Dev-C++, though.

Re:How to enable NASM in Dev-C++?

Posted: Thu Jan 12, 2006 1:03 am
by raywill
Phugoid wrote: I think the question is more about how to cause Dev-C++ to invoke the assembler. I can't help with Dev-C++, though.
Quite exactly.
Can anyone help?

Re:How to enable NASM in Dev-C++?

Posted: Thu Jan 12, 2006 3:23 am
by Pype.Clicker
google seems to have interesting pointers ...

Otherwise, that's more a matter of digging your dev-c++ manuals than a matter of OS development knowledge.