My C application relies on some files to copy over. Will the files be contained in the executable and not as stand-alone files? Would it have to be linked statically? I am using Eclipse CDT if it matters.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are several ways you can link file data into an executable. A platform like Windows allows you to link data into an executable as a “resource” and provides APIs to access those resources (this is how icons and other objects are bound into a Windows executable). This is probably the best way to do it if your platform supports it – support for it is built right into the IDEs.
At a lower level, you might be able to use the linker to directly link a file into an executable as an addressable object:
And finally, if you’re dealing with a more primitive system like some embedded platforms, you can run your file through something that converts it into source for C array of bytes: