|
Can you show us a minimal code that shows the error ? or the exact line of code with a couple of line above and below the line that gives the error?
What does the Intel compiler help says about this error ?
Nihil obstat
|
|
|
|
|
This error is given even at some simple situations, like this:
int i = 0;
i = 0;
int j;
error will be given on the variable j declaration. Compiler doesn't give any further information on the error.
|
|
|
|
|
Are you compiling C code with a C compiler ?
Nihil obstat
|
|
|
|
|
Yes I do. The problem was with the C language standards specifications, as Mr. CPallini said. I tried compiling with GCC with
-std=c89 -pedantic argument and it warned me of mixed declarations and code.
|
|
|
|
|
Actually (if I got you) Visual C++ compiler gives an error if a variable declaration is below an executable statement in block (The same compiler, of course, does not give an error if is compiling a C++ source code).
GCC does not give errors because it accepts such declaration as an 'extension' (see, for instance "Variable declaration placement in C" at Stack Overflow[^]). Note that C99 standard allows such kind of declaration but Visual C++ (and possibly the INTEL ) compiler is not C99 compliant.
Veni, vidi, vici.
|
|
|
|
|
No debuggers, well, none here anyway, and none as good as I have used on Windows, so it is printk() debugging. A 20 minute full build needed to get any new code in and then it takes 10 minutes to reflash the OS image on the device.
Never have I been forced to work so slowly.
Windows? Different matter. Windbg, live embedded debugger, automatically sucks the newly built module off the host when the target boots, public symbols, full stack and disaasembly on a crash,
I am going to have to put something together for linux/ARM like Windbg....
==============================
Nothing to say.
|
|
|
|
|
Well, it looks you are building the kernel, that's not a breeze even on desktop machines (and you simply could not build the Windows one).
Anyway, what has it to do with the C++ forum?
Veni, vidi, vici.
|
|
|
|
|
Ha, this is a C forum too, so there!
Actually all I want to build is a module, but I am forced to build the kernel, unlike windows.
Anyway, it has taken me a week to find a relatively easy bug, the driver is badly written. I would have got it on windows in a few hours. Thats the difference I am talking about.
==============================
Nothing to say.
|
|
|
|
|
Linux has kernel modules. They don't fit your needs, do them?
Veni, vidi, vici.
|
|
|
|
|
They do, but unfortunately so much of what I am having to dig around in is part of the system.
==============================
Nothing to say.
|
|
|
|
|
Now, I have a VC++ project which will occupy 1.5 G memory(the peak value), and then it will give back memory in 5 minutes. But, I want to optimize the memory usage, because 1.5 G is too huge. Besides, I'm rather sure there are no memory leaks in my codes, I have tested my codes with 3 tools(PurifyPlus, Debug Diagnostic and CMemoryState function).
Anybody can help me? Or are there some tools to help me to do that?
Again, I must emphasize 'there are no memory leaks in my codes, I'm rather sure'. So, don't mention 'memory leaks' in the comments.
PS: I'm using Visual C++ 2010. And my project is made up of about 1400k lines of code.
modified 17-Jun-13 6:23am.
|
|
|
|
|
Falconapollo wrote: Anybody can help me? With what? All we know is that your application uses a lot of memory.
Use the best guess
|
|
|
|
|
Because there are lots of codes, so I want to find some tools to help me. It's alomost impossible to find out the problematical codes manually.
|
|
|
|
|
Then you need to go and look for the tools. As it stands your question is unanswerable.
Use the best guess
|
|
|
|
|
If there are no leaks in your code, where are they (if you suspect there are)?
Are you using third party code?
Veni, vidi, vici.
|
|
|
|
|
Memory fragmentation possibly?
|
|
|
|
|
Falconapollo wrote: Or are there some tools to help me to do that?
Profilers will identify memory usage.
Falconapollo wrote: Again, I must emphasize 'there are no memory leaks in my codes, I'm rather sure'
Which doesn't mean that memory is not being used incorrectly. For example some sort of map with duplicate data.
Normally, at least for me, I have a fairly good idea of why an application uses code. There are of course only two real sources. First if you have something, one thing, that it is in fact big. And the second is if you have a whole lot of little things. Rather hard to code an application without actually knowing which of those cases is likely.
|
|
|
|
|
As Richard said it's impossible to give accurate advice without seeing your code and the functions you call from third party libs (and of course posting 1400k lines of code is not an option).
The questions you should try to answer for yourself are:
1. Can you pinpoint certain operations (at user interface level) of your applications that result in high memory use?
2. Which internal parts (functions) of your application do require large amounts of memory, even if only temporary?
3. Which calls to third party libraries result in allocation of memory that is not automatically released (e. g. functions that create large objects or data sets to hold results)?
4. What third party libraries do you use, and what do you know about their memory allocation scheme?
The last question is targeted at libraries that use their own memory managers, which may or may not release unused memory blocks in a timely manner.
Find the answers to these questions to better locate possible causes for your problem. Without that info, nobody can really help.
|
|
|
|
|
If the memory is returned, then it's not leaking.
If you had a leak, then then the memory usage would keep growing until your application crashes.
If you want your application to use less memory, then you'll have to look at how you use your data and the lifetime in which you keep it.
|
|
|
|
|
I am trying to enumerate processes and WriteProcessMemory. I get the following errors on compilation in Visual C++. I just don't do anything related to TOKEN and all. How to solve the error ?
error C2061: syntax error : identifier 'TOKEN_INFORMATION_CLASS'
error C2061: syntax error : identifier 'PTOKEN_PRIVILEGES'
error C2061: syntax error : identifier 'PTOKEN_GROUPS'
error C2061: syntax error : identifier 'TOKEN_TYPE'
in file c:\program files\microsoft sdks\windows\v6.0a\include\winbase.h
|
|
|
|
|
I would recommend moving to a newer SDK. 6.0a is very old, has many versioning bugs and is no longer supported for use with Visual Studio versions.
Also make sure you have predefined _WIN32_WINNT for example as 0x0600 to target Vista. If you don't do this SDK 6.0a will default back to Win2K or even Windows 95 that may not support what you're trying to do.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Hi I got the answer.. yes its strange and hard to believe but is true.. Declaration of Structure TOKEN_INFORMATION_CLASS is present in WinNt.h header file.. The same was missing in my standard include\winnt.h.. I took the same header file from another machine and the error is solved..
|
|
|
|
|
***** What I want is I should get exact no of entries and filenames as the no of files copied..***** When I copy files in the monitored directory through 4 cmd's all with copy command copying files from windows, system32, c:\, d:\ directory at a time.. this function ReadDirectoryChangesW() does not give correct output. It misses many files entries and also shows repetitive filename as file added and then modified. It is all because till the system writes the file completely, it continuously keeps giving the notification too. so we have multiple entries for same file. ***** What I want is I should get exact no of entries and filenames as the no of files copied.. So I think if I hook CopyFile/CreateFile(A/W) API, then I can trace all the files created/copied in c:\temp (putting c:\temp as the filter).. Please help.. Thanks in advance..
|
|
|
|
|
|
I am getting the following error
error RC2135: file not found: STRINGTABLE
error RC2135: file not found: 0xF000
1>
error RC2135: file not found: 0xF001
1>
None of the items pointed to by the resource compiler are files
I am at a loss
MSDN states for this error The file specified in the Resource Compiler command line was not found
I did a build from Visual Studio Professional 10.0
I don't know what is on the resource compiler command line
|
|
|
|