473,395 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

definition

static pthread_mutex_t mutexWarn, mutexDebug, mutexGtfo;

hi
why an error for the above code?
thx Michael
1570 H:\FlyLegacy\source\src\Main\Main.cpp
syntax error before `,' token
Jun 24 '06 #1
4 1614
Michael Sgier wrote:
static pthread_mutex_t mutexWarn, mutexDebug, mutexGtfo;

hi
why an error for the above code? 1570 H:\FlyLegacy\source\src\Main\Main.cpp
syntax error before `,' token


Probably the compiler can't see any pthread_mutex_t above this line. A
compiler will often overrun the actual problem and report the first line it
couldn't parse. Until the , the new pthread_mutex_t term could have been
part of something more elaborate that would have worked.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Jun 24 '06 #2
Phlip wrote:
Michael Sgier wrote:
static pthread_mutex_t mutexWarn, mutexDebug, mutexGtfo;

hi
why an error for the above code?

1570 H:\FlyLegacy\source\src\Main\Main.cpp
syntax error before `,' token


Probably the compiler can't see any pthread_mutex_t above this line. A
compiler will often overrun the actual problem and report the first line it
couldn't parse. Until the , the new pthread_mutex_t term could have been
part of something more elaborate that would have worked.


Or, did he forget to include 'pthread.h'?

I notice he's on Windows (H:\...).
Is pthreads available there?
I thought it was only available on unix/linux.

Larry
Jun 24 '06 #3
Hi
no I downloaded stl for windows.

#include <stl/pthread.h>

I only have rudimentary C++ knowledges and basic VB.NET so I don't fully
understand the code. That's a definition? So pthread_mutex_t has to be
declared somewhere? if I look into pthread.h I can't find anything like
that... Where can I find pthread_mutex?
Thanks for helping me find the way ( in the dark of the night :-))
Cheers Michael

Jun 24 '06 #4
Michael Sgier wrote:
no I downloaded stl for windows.

#include <stl/pthread.h>
What a can of worms.

Firstly, your VC++ already comes with an "STL", whose true name is the C++
Standard Library, iterators containers & algorithms department.

Replacing the built-in STL is not for the faint of heart. And because the
C++ Standard Library does not define any thread functions, an alternative
STL is free to turn them off when you apply its technique to replace the
bundled STL with it. Not all thread libraries are portable.
I only have rudimentary C++ knowledges
You would do much better writing fresh programs from scratch, to learn all
the dirty tricks required, than doing whatever you are doing. Futzing with
the compiler's ability to bond with a Standard Library is diving into the
deep end.
Thanks for helping me find the way ( in the dark of the night :-))


Back off and tell us simply what your assigned task is. If it's "Get X to
compile on windows", there are probably better ways.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Jun 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dave H | last post by:
Hello, I have a query regarding definition lists. Is it good practice semantically to use the dt and dd elements to mark up questions and answers in a frequently asked questions list, or FAQ? ...
7
by: Neil Zanella | last post by:
Hello, I have posted the following message before but got no replies... I am trying to format an HTML definition list with CSS so that it appears as follows, but am having the following problem:...
14
by: Mike Hewson | last post by:
Have been researching as to why: <example 1> class ABC { static const float some_float = 3.3f; }; <end example 1>
19
by: J. J. Farrell | last post by:
After many years of dealing with definition and linkage issues in ways that I know to be safe, I've decided it's time to try to understand this area properly. Consider a header file with the file...
4
by: Ced | last post by:
Hi, i'm not an expert in C but i try to compile BTNG software under linux kernel 2.4.2-2. I get these errors at the very first stage. Does someone could have a rapid look on this and tell me...
10
by: Kobu | last post by:
My question is about the use and meaning of the terms "declaration" and "definition" as it pertains to the C language. I've read sources that mix the two up when talking about such things as...
18
by: shaanxxx | last post by:
I have following code . #include<stdio.h> int i; int i; int i; int main() { printf("%d",i); return 0;
9
by: Jess | last post by:
Hello, I was told that if I declare a static class constant like this: class A{ static const int x = 10; }; then the above statement is a declaration rather than a definition. As I've...
15
by: vaib | last post by:
hi to all.i'd like to know the actual difference between variable declaration and definition.it would be very helpful if anyone out there wud help me out with this thing.i'm writing here after here...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.