![]() |
| | #1 |
| Registered User Join Date: Oct 2006
Posts: 146
| Makefile help. I have a c++ program, and here is how I compile an run it on unix (works fine this way): g++ TestProg.cpp -lpthread -lrt ./a.out I'm suppose to create a makefile for this. I've read through some tutorials and examples, but I can't get it to work. This is what I have now: Code: prog1: TestProg.cpp g++ -o prog1 TestProg.cpp -lpthread -lrt #include <iostream> #include <pthread.h> #include <semaphore.h> #include <stdio.h> #include <time.h> #include <fstream> When I go to use it: make -f makefile.txt It says: ' ake: Fatal error: Don't know how to make target 'TestProg.cpp Any ideas? Thanks.
__________________ IDE - Visual Studio 2005 Windows XP Pro |
| Cpro is offline | |
| | #2 |
| and the Hat of Guessing Join Date: Nov 2007
Posts: 8,862
| Make sure you have a space between the colon and the filename, not a tab. (It shouldn't make a difference, it doesn't on my machine, but you never know.) But it should not interpret things on the same line as the target as other targets. (That is to say, the makefile you have works fine for me.) |
| tabstop is offline | |
| | #3 |
| Registered User Join Date: Oct 2006
Posts: 146
| Well, I re-made the make file using vi editor instead of notepad, and it now works. Thank you for letting me know it worked for you. I thought I had made it incorrectly. Thanks.
__________________ IDE - Visual Studio 2005 Windows XP Pro |
| Cpro is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Makefile Problem: None rule to make target | chris24300 | Linux Programming | 25 | 06-17-2009 09:45 AM |
| Building a project using a Makefile | starcatcher | Windows Programming | 2 | 11-23-2008 11:50 PM |
| unix makefile won't work but works in Dev C++ | jk1998 | C++ Programming | 1 | 06-09-2007 03:54 PM |
| makefile blues.... | WaterNut | C Programming | 6 | 05-30-2005 08:22 PM |
| Need help with Makefile | xshapirox | C++ Programming | 14 | 09-28-2004 03:32 PM |