Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I set a path for the includes for g++ compiler?

Hello,

I'm new in the world of apple. I used to program with linux. There to include something like extra_library.h that it wasn't in the same folder where I compile my cpp program I used to write in the terminal while being in the cpp archive folder: g++ -c program.cpp -I/Documents/includes

Because I had the archives to include in my program in the Documents/includes directory. But now, doing exactly the same in my mac, it gives me the error that the archive to include wasn't foud.


I don't know if the -I command is invalid for the macs or the path is incorrect. Maybe There is a mother folder that I need to specify in the path like -I/moter_folder/Documents/includes.


I don't know if I expressed the lideas in a good way. If you can help me I'd be very gratefull.


Thank you.

Posted on Feb 15, 2013 11:38 AM

Reply
Question marked as Best reply

Posted on Feb 15, 2013 12:55 PM

jvila94 wrote:


I don't know if the -I command is invalid for the macs


Nope. It is fine.


or the path is incorrect. Maybe There is a mother folder that I need to specify in the path like -I/moter_folder/Documents/includes.


What do you get when you do:

ls /Documents/includes

4 replies

How do I set a path for the includes for g++ compiler?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.