Friday, July 31, 2009

C/c++ portability question (Windows platform)?

How protable are my c/c++ applications, I want to just send the client the .EXE file only, no ddl's.

C/c++ portability question (Windows platform)?
It depends highly on your compiler. Some compilers use dll's for their library functions and the GUI components. There are typically options that you can set on your compiler so that these functions will be explicitly included in your executable - you may have to look up the documentation for your specific computer to find out how to do it.





Another thing - before you send out your exe, make sure that you test it out. Find another convenient computer that does not have your compiler installed. Try running your exe on this computer. If it falls with a message that it cannot find some dll, you will have to dig some more.
Reply:Even the DLLs if needed can be sent around, but if you don't you can send the .exe just it.





Program by Visual C++ need a common DLL runtime.
Reply:you can do that, as long as you don't need any dll's.
Reply:The question is faulty. C and C++ are highly portable languages, but that applies to the source code, not the binary output. You can provide a single executable in essentially any situation. (The other poster making comment that this is impossible when dependant on DLLs is simply incorrect; DLLs can be statically linked into an application.)





Indeed, the normal build process in most Windows compilers will be exactly what you want.

wallflower

No comments:

Post a Comment