So I have a file called queens.cc and I need to do the following:
- Compile and make a .o file while specifying that the compiler is to search /student/214/include for system include files.
- Use g++, link and load .o file to make a dynamically linked executable file called queens and to also search the directory /student/214/lib.
I have my include files located in /student/214/include and a dynamically linked library in /student/214/lib/libqueens
This is what I've tried:
g++ -c -o queens.o queens.cc -I/student/214/include
Which gives me
queens.o queens.cc
For the second part this is what I've tried:
g++ -o queens queens.cc -L/student/214/lib/libqueens
I'm stuck on how to link and load queens.o to produce a dynamically linked executable file, how can I do this? Did I compile my .o file incorrectly? Any help is appreciated. Thanks.
---------- Post updated at 07:53 PM ---------- Previous update was at 06:35 PM ----------
Nevermind I figured it out.
I used:
g++ -L/student/214/lib -I/student/214/include -Wall -o queens queens.cc -lqueens
to make an executable.