Creating library with adl_main( ) inside


#1

Hi,
I want to make a library that with adl_main ( ) inside, so that if this library is included this function will be executed first. No user’s adl_main( ) needed.

However I find the .lib file made does not contain the adl_main ( ) inside. So I cannot omit adl_main ( ) in source code even with this lib is inlcuded.

Could there be any idea ? thanks


#2

Could you supply adl_main just in an object file?

Is this for GCC or ARM compiler?


#3

I am using GCC complier. You mean using object file instead of lib ?
But in \gcc\out folder I cannot find any obj file.


#4

It’s just an idea - it may not be workable…

Possibly; or a lib for the majority of your stuff, and an object just for the adl_main…?

If I put my adl_main() function into adl_main.c, I get an adl_main.o in the gcc\out folder…


#5

Thnaks. I finally make it out. It seems I need to declare all functions once within the .c file (not on separate header file) to let them be included in the .lib file