Question

I am trying to static link lua into a FreePascal application. I have fixed all of the errors during the linking except this one. Undefined Symbol: __strtod

All of the other Undefined Symbols I was able to link in via libkernel32.a, libuser32.a and libmsvcr.a from the MinGW compiler which I used to compile the liblualib.a that I am linking in in place of using the dll.

I would like to have this static linked and not dynamic linked. So, would anyone happen to know which .a lib file ___strtod is defined in or know how I can search and find this out.

To my knowledge it is a C99 function and MinGW, GCC support it. So, I would think that it would be in one of the lib (.a) files that come with it.

Thanks,

Was it helpful?

Solution

Turns out that I never came back and answered my question when I got it to work.

I searched online for the function in C and then compiled it to a static library using MinGW. With the libstrtod.a file that I created I was able to static link it into the program compiled by FreePascal.

I have since had to give up the source for this project since it was on contract, I will try to remember to make an example of this to share.

Thanks for all of the responses and suggestions.

to be continued...

OTHER TIPS

It's part of the C library, libc. However I don't know you can statically link to it. (Are there yet systems which provide static versions of libc?)

Libc should be linked by default in a C program.

Just create a make file that uses a static version of the library. The static libraries are normally much bigger than the dynamic ones. You could download newlib and compile the source directly with the lua runtime, I'm guessing that newlib works with MinGW.

I hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top