Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Is it possible to compile a program in 2+ languages?

In the case of gcc and fbc (freebasic compiler), since both of them compile object code before complete binary compilation, would it be possible to link multiple object files (source files written in C and FB) together after theyve been compiled with their respective compilers?

3 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    Yes.

    Most of the applications that you see are written part in C and part in Assembly and linked together as one application. But there are some basic communication parameters to be met to do it.

    .

    Source(s): TaZ
  • 1 decade ago

    Not exactly, sort of.

    What happens actually is as follows:

    build module calls compiler for each piece of code

    compiler turns source code into object files (repeat as needed)

    a linker then links all the different object files together and package into an EXE

    If you write the source code properly, you *can* call compiled object code from within your code.

    However, what is usually done is you compiled a DLL (dynamic link library) and call the DLL from within your code.

    So, to speak broadly, it IS indeed possible to link object codes that came from different compilers, but you have to follow standards, and it's not usually done nowadays, when DLLs are easier and more prevalent and better defined.

    ---

    Kasey C, PC guru since Apple II days

    I don't suffer from insanity. I enjoy every minute of it.

  • Anonymous
    1 decade ago

    No,

    It is not possible because every programming language has it;s own compiler. and compiler in nothing but one kind of program which understand you language of programming and execute your program.

    If it is possible then no need of diff type of language. everyone use any language and compile it whenever we required.

    no it is not possible every comparator has there own standard and we have to follow that.

Still have questions? Get your answers by asking now.