Windows.h not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Windows.h not working

1,442 Views
tenfoo
Contributor II

Hello, I'm programming my MSC1856EVM using  C++ in CodeWarrior 10.2.10 on Windows 7 Professional. I'm trying to use any form of  the QueryPerformanceFrequency function to record how long it takes to perform a certain facet of my code. However, CodeWarrior didn't recognize Windows.h, so I downloaded the Microsoft SDK package with all necessary header files. I saved them into C:\Program Files\Freescale\CW SC v10.2.10\SC\StarCore_Support\compiler\include, but when I debug my code, it generates tons of errors from the Windows.h inclusions and can't even recognize a LARGE_INTEGER declaration. Any suggestions?

Labels (1)
Tags (1)
0 Kudos
3 Replies

1,054 Views
J2MEJediMaster
Specialist I

If I understand what you did correctly, you are trying to use Windows desktop pefromance tools on an embedded system. That will not work.

 

Codewarrior for StarCore DSPs has plenty of built-in performance measurement tools. Look at the Profiling and Analysis User Guide document, located in (Windows XP path) C:\Program Files\Freescale\CS SC v10.2.10\SC\Help\PDF.

 

---Tom

1,054 Views
tenfoo
Contributor II

Thanks for the tip.

 

I found a demo for the MSC8156ADS board that implemented Core and Device Timers to test the runtime of different segments of code. It's found in: {CW install dir}\SC\StarCore_Support\MiniDrivers\MSC8156ADS\  

From this demo, I dedided to implement a version of the device timer measurement example with some of my code. Everything works beautifully when I create a project using C (since the libraries that define the timers are provided only in C), but the code I need to test is in C++. My code is huge and I can't convert the whole thing to C.

 

I've attached the code snippet I'm trying to run in C++ (called "Code").

 

I couldn't attach the library I used to run the project in C, but it's called "msc815x_libr.elb"...it also works in C when I use "msc815x_libd.elb"

 

I've also attached the error message it's giving me currently (called "Error"). I think it's a linker error, since everything is set up identically in both my C and C++ projects (aside from the source code of course). Is there a way to obtain this library (msc815x_libr.elb or msc815x_libd.elb) in C++, or a way to tell the linker to translate it into C++?

 

Thanks for all your time and help.

 

-DR

0 Kudos

1,053 Views
tenfoo
Contributor II

I rewrote my code in C and got the device counters and core counters to work in the MiniDrivers demo mentioned earlier. However, the measurement I'm trying to make takes about two and a half minutes to run and the counters roll over before then. Is there any way to measure time in the long-term? I've read everything I can find about the matter, including how to set counterpoints to run a trace on a certain subset of code and I'm still hitting a wall. Aren't there some simple settings I can configure to measure processing time somehow since apparently I don't have access to queryfrequencycounter or even simple clock()? This should be easy.

0 Kudos