Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
frederik.dumarey is currently offline  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 Embarassed .

#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 Smile
As Mirek mentioned, bit exotic, but I thought why not...

Have a nice day all of you,


Regards,

Frederik Dumarey
Belgium
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Using COM object
Goto Forum:
  


Current Time: Sat Jun 14 10:09:26 CEST 2025

Total time taken to generate the page: 0.04624 seconds