| | |
Can't get started: "no such file"...
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Nov 2007
Posts: 22
Reputation:
Solved Threads: 0
The codes our instructor provided for us has been giving me a "no such file" error message for the line #include <mutex.h> in the following code:
The mutex.h code it is referring to is here:
I've double checked and both codes are in the same directory and just in case you need to know, I am using Eclipse C/C++ and MinGW. Hopefully someone can help me out here so I can actually get started on this assignment!
C++ Syntax (Toggle Plain Text)
/* * mutex.cpp * scheduling * */ #include <mutex.h> Mutex::Mutex() { } Mutex::~Mutex() { } int Mutex::Lock() { } int Mutex::Unlock() { }
The mutex.h code it is referring to is here:
C++ Syntax (Toggle Plain Text)
/* * mutex.h * scheduling * */ #ifndef MUTEX_H #define MUTEX_H #include<pthread.h> class Mutex { private: pthread_mutex_t mutex; public: /** Initializing the mutex */ Mutex(); /** Destroy the mutex */ ~Mutex(); /** Acquire the lock * @return The return value of pthread_mutex_lock(). */ int Lock(); /** Release the lock * @return The return value of pthread_mutex_unlock(). */ int Unlock(); }; #endif
I've double checked and both codes are in the same directory and just in case you need to know, I am using Eclipse C/C++ and MinGW. Hopefully someone can help me out here so I can actually get started on this assignment!
0
#2 Oct 13th, 2009
when u include a file in <> brace like follows
it looks in the include directory.
But your file mutex.h is in your current directory. To include such file u have to do it using ""
C++ Syntax (Toggle Plain Text)
#include <mutex.h>
But your file mutex.h is in your current directory. To include such file u have to do it using ""
C++ Syntax (Toggle Plain Text)
#include "mutex.h"
•
•
Join Date: Nov 2007
Posts: 22
Reputation:
Solved Threads: 0
0
#3 Oct 13th, 2009
That sort of worked.... mutex.cpp doesn't have an error anymore but now I have an error message in mutex.h saying:
`pthread_mutex_t' does not name a type (on line 15)
as well as
pthread.h: no such file
Also, I forgot to mention that a Makefile is included with the codes as well but I don't know how to use it within Eclipse to build the codes. Do I need this Makefile or can I just build everything using eclipse?
`pthread_mutex_t' does not name a type (on line 15)
as well as
pthread.h: no such file
Also, I forgot to mention that a Makefile is included with the codes as well but I don't know how to use it within Eclipse to build the codes. Do I need this Makefile or can I just build everything using eclipse?
Last edited by pocku; Oct 13th, 2009 at 3:16 am.
0
#4 Oct 13th, 2009
How about you just ask your teacher since it will be easier and more straight forward.
1) Prove that the area of a circle is pi*r^2, where "r" is the radius of the circle. 2) Problem 2[b]solved by : jonsca
0
#5 Oct 13th, 2009
pthread.h is generally for POSIX systems like FreeBSD, NetBSD, GNU/Linux, Mac OS X and Solaris, but Microsoft Windows implementations also exist. For example, the pthreads-w32 is available and supports a subset of the Pthread API for the Windows 32-bit platform.
If you are working in windows it wont work. U have to look for
pthreads-w32 .
checkout the link
http://en.wikipedia.org/wiki/POSIX_Threads
If you are working in windows it wont work. U have to look for
pthreads-w32 .
checkout the link
http://en.wikipedia.org/wiki/POSIX_Threads
•
•
Join Date: Nov 2007
Posts: 22
Reputation:
Solved Threads: 0
0
#6 Oct 13th, 2009
•
•
•
•
pthread.h is generally for POSIX systems like FreeBSD, NetBSD, GNU/Linux, Mac OS X and Solaris, but Microsoft Windows implementations also exist. For example, the pthreads-w32 is available and supports a subset of the Pthread API for the Windows 32-bit platform.
If you are working in windows it wont work. U have to look for
pthreads-w32 .
checkout the link
http://en.wikipedia.org/wiki/POSIX_Threads
Also, this is for another assignment but what about arpa/inet.h or sys/socket.h? Are those also only supported by unix-like systems?
•
•
•
•
How about you just ask your teacher since it will be easier and more straight forward.
Last edited by pocku; Oct 13th, 2009 at 4:18 pm.
![]() |
Similar Threads
- Redesign an input type="file" (JavaScript / DHTML / AJAX)
- Uploading multiple Images through input type="file" (PHP)
- Redesign input type="file" (HTML and CSS)
- google "keyword" question (Search Engine Optimization)
- loosing "NEW" option in explorer "File" mene (Windows 95 / 98 / Me)
Other Threads in the C++ Forum
- Previous Thread: Mortgage calc..OOP
- Next Thread: Convert minutes to time
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






