Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » How to link assembler compiled file
Re: How to link assembler compiled file [message #61687 is a reply to message #61686] |
Sat, 24 May 2025 12:07   |
frederik.dumarey
Messages: 30 Registered: December 2021 Location: Belgium
|
Member |
|
|
Hello Mirek,
Thanks for mentioning the verbose console check. The .S and .CPP files were correctly compiled in .O files, but the linking failed on the global export. Most stupid error: i forgot the underscore for my variable .
#include <iostream>
//declare the assembler function
extern "C" size_t _my_strlen(const char* str);
int main(int argc, const char *argv[])
{
const char* message = "Hello from Assembler";
size_t length = _my_strlen(message);
std::cout << "Message: " << message << std::endl;
std::cout << "Length: " << length << std::endl;
return 0;
}
When you compile this all links up fine and runs perfectly!
So for those of you that want to include native assembler functions for SS2, AVX SIMD instructions, you can give it a try with this method
As Mirek mentioned, bit exotic, but I thought why not...
Have a nice day all of you,
Regards,
Frederik Dumarey
Belgium
|
|
|
Goto Forum:
Current Time: Sun Jun 15 01:22:07 CEST 2025
Total time taken to generate the page: 0.04373 seconds
|