Jump to content
  • Advertisement
Sign in to follow this  
bdc256

Compilling a program

This topic is 4976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am having troble compilling hello world in linux Do I need to use a another cammand first such as make could some one please show me all the cammands needed to make a binary from source tahnks.

Share this post


Link to post
Share on other sites
Advertisement
If your C source is: hello.c
you can compile it to a binary like this: gcc -o hello hello.c

If your source is C++: hello.cc (or .cxx)
compile it like this: g++ -o hello hello.cc

You don't need to call make unless you have a file called "Makefile" under your source tree. If you have the "Makefile", then only thing you need to do is call "make". It will do everything else for you (or not, read the README and INSTALL files commonly found at the root of the source tree)

Usually software is compiled using GNU Autotools.. that is, you have a configure script under the source tree (and few others).
In this case you will have to do following:
./configure
make
make install

"configure", well it configures the software (installation path and such..)
"make" compiles the software
"make install" copies the binaries and data files to locations that configure determined.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!