|
So true, so annoying, and quite how they do it is a mystery.
|
|
|
|
|
I'll just throw this out there from my own experience.
You might try creating a 'test' user profile to see if it fixes it.
I had a problem with VS2005 a couple of years ago that I could not figure out.
I looked and looked and even tried reinstalling VS and couldn't fix it.
I have two user profiles on my system and just by chance I logged onto my admin
profile and opened VS and the problem was not there.
So I created a new user profile that corrected the problem.
Have no idea why.
|
|
|
|
|
A good idea, sadly it did not work...
i'll keep digging.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
winresrc.h??
Quote: The final clue came when I looked at the file trying to include winresrc.h and saw that the include was enclosed in ...
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
I'll double check that - found that post, but did not apply - could be my error.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
winresrc.h is in the Platform SDK folder on my system. Is this path included in
your projects Include Directories list or has it maybe been moved
into the incorrect order in the list?
-- modified 25-Aug-19 17:56pm.
|
|
|
|
|
Project has not been modified, and I don't move stuff. It hurts
Here's the riddle - all I've checked in VS2008 indicates what it will use when I want to build. I support a number of platforms, so I have half dozen winresrc.h on my machine. I can build the project, but I cannot edit the resources. nothing I have read tells me what vs2008 is looking for - this smells like a bug.
For the moment, I have the project updated and rebuilt using the VM, etc, but it's still something I want to fix.
Truly appreciate all of the suggestions
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Lastly, you probably have done this already but a search on "winresrc.h resource RC1015" brings
up a number of questions and responses concerning this error.
Good luck 
|
|
|
|
|
I am struggling from some time to an error:
error C2059: syntax error : ')'
I have somewhere in the old code:
#define list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(size_t)(&((type *)0)->member)))
I have tried this solution, without success: c - list_entry in Linux - Stack Overflow[^]
How can I get rid of this error ?
I am trying to integrate this code in an MFC project, and the code from above is from C code (for linux I guess)
|
|
|
|
|
Please show us the actual line of code where the error occurs.
|
|
|
|
|
const int nTest = list_next_entry(0, 0);
where list_next_entry is
#define list_next_entry(pos, member) list_entry(0, 0, 0)
and list_entry is defined in the first post.
P.S. Of course, 0 values are for testing purpose only.
|
|
|
|
|
A good alternative is to not use #define directives in this way, as they only serve to confuse.
modified 20-Aug-19 12:37pm.
|
|
|
|
|
This is legacy code, is not written by me.
|
|
|
|
|
Then I would suggest you search out every usage of those defines and turn them into real code.
|
|
|
|
|
Quote: P.S. Of course, 0 values are for testing purpose only. However they are bad arguments for a (very likely) legitimate macro.
If you get the error with such arguments, then we cannot blame the compiler. On the other hand, if you're getting the same error with proper arguments then post such code here.
|
|
|
|
|
With 0 or original argumtents value, the error is the same.
|
|
|
|
|
But I can't help on 0 , because the compiler is absolutely right complaining.
|
|
|
|
|
Syntactically that directive looks fine. Have you examined the preprocessor output (/P) to see what that directive looks like once expanded?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
There I have:
_WINDOWS;NDEBUG;%(PreprocessorDefinitions)
|
|
|
|
|
This is the content of your .I file?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
This is a combination of all of the above responses.
I have compiled this in mfc and it works.
struct data {
int something;
};
struct container {
int something_before;
struct data data_item;
int something_after;
};
#define list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(size_t)(&((type *)0)->member))) // <-- here is the error ...
struct data *data_ptr;
struct container *cont_ptr = list_entry(data_ptr, struct container, data_item);
// This is the code you say is not compiling.
#define list_next_entry(pos, member) list_entry(0, 0, 0)
// This error is caused by the above line because list_entry(0,0,0) '0' is not a valid data type.
const int nTest = list_next_entry(0, 0); // <-- error C2059: syntax error : ')'
// If you do this instead...
#define list_next_entry(pos, member) list_entry(data_ptr, struct container, data_item)
// You will get a new error you will have to resolve in some way.
// error C2440: 'initializing' : cannot convert from 'container *' to 'const int'
// 1> There is no context in which this conversion is possible
// The compiler can't convert a pointer to an int.
// Don't know what you are trying to do.
const int nTest = list_next_entry(0, 0);
|
|
|
|
|
I am just trying to integrate a C old code into MFC project. I will try to do what you said, and give you a feedback.
|
|
|
|
|
The original code is just like that:
#define list_next_entry(pos, member) list_entry((pos)->member.next, typeof(*(pos)), member)
but the errors is little more then:
error C2100: illegal indirection
error C2059: syntax error : ')'
error C2059: syntax error : 'bad suffix on number'
error C3861: 'typeof': identifier not found
all of them is in the same line ...
|
|
|
|
|
You can't use -> or * on a value of 0! That causes the compiler errors. Try any non-null value, and at least these compiler errors should go away.
Moreover, typeof is not standard C/C++. There are implementations for that in the GCC extension for C, or in the BOOST library. You may need to find the correct BOOST library and include that in your project to make this code work.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Should I understand that pos has 0 value ?
And what I could use instead of
typeof without using BOOST ?
|
|
|
|