View Single Post
  #2   Spotlight this post!  
Unread 25-03-2012, 20:16
theNerd's Avatar
theNerd theNerd is offline
Registered User
FRC #3329 (Cam Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2110
Location: St. Marys
Posts: 51
theNerd is an unknown quantity at this point
Talking Re: A work around for Linux users

Quote:
Originally Posted by Scimor5 View Post
compiling in a terminal is really easy. for c++ programs using g++ and its arguments correctly takes care of everything.

Code:
g++ -o myProgram thing.cpp main.cpp
This command compiles and links the code files
"thing.cpp" and "main.cpp" together into the executable program called
"myProgram".

other things to worry about are libraries

-I : Sets the path to the include files.
-L : Sets the path to the libraries.
-l : Use this library (eg. -lm to use libmath.so, -lpthread to use libpthread.so)

You can have multiple -I, -L and -l entries.
So, your final command should look like this:
Code:
g++ -o myProgram thing.cpp main.cpp -I /path/to/includes -L /path/to/libraries -l library1 -l library2
info about libraries can be found with the pkgconfig command.
Haha! You have no idea how happy I am to have found a c++ person who knows about libraries . I used to be a Java programmer - still am - but now I would like to make c++ my core language seen that I'm going to need it a ton in college. Could you send me links to resources that greatly aided you in learning c++? and could I private message you with questions as I go through my learning curve?