Itzik984
Itzik984

Reputation: 16824

Compile c++ file using external library from linux terminal

I have the following files:

ex1.cpp    ex1.h
GLee.cpp   GLee.h

and I want to make it use the library (openmesh library) on the following path:

home/xyz/Downloads/OpenMesh-2.3/src/OpenMesh/

I'm trying to execute it with this:

g++ -Wall -o ex1 ex1.cpp GLee.cpp -L/..path../

but no luck, output is:

In file included from ex1.cpp:17:0: ex1.h:28:38: fatal error: OpenMesh/Core/IO/MeshIO.hh: No such file or directory compilation terminated.

what is the correct way of doing this?

Thanks!

Upvotes: 1

Views: 11082

Answers (1)

Jarryd
Jarryd

Reputation: 1322

You need to put -I path on the command line. So from the error, it looks like you would do:

g++ -Wall -o ex1 ex1.cpp GLee.cpp -I /home/xyz/Downloads/OpenMesh-2.3/src

Upvotes: 3

Related Questions