Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

nican.h: error after including windows.h

Hello

 

I am developing an application with ni-can library using Visual c++ 2005. I have included "nican.h" and been able to build a successful project. However, when I tried to include "windows.h" in order to call Sleep() function, the compiler gave me a long list of  errors; like missing ; , conflict names, etc -- after just adding #include <windows.h> before #include "nican.h".

 

I am wondering if it has something to do with the project setting? I have created my project as a win32-console (empty) project and set path to nican include and lib directories. Do I need to set anything else?

 

I would appreciate your comments/suggestions 🙂

 

Thank you.

Lek

0 Kudos
Message 1 of 4
(9,462 Views)

Lek,

Are you able to include both of these header files in a new empty project and compile it without errors?  Also, can you create a new project that just includes the windows.h file, and will that compile by itself?  Also, does it make any difference in your code if you put the windows.h include statement before or after the nican.h one? 

 

-Christina

0 Kudos
Message 2 of 4
(9,448 Views)

Christina,

 

Thank you for your reply.

#include <windows.h> works fine by itself.  Either including <windows.h> before or after nican.h gives me complilation error.I have not worked with windows.h -- Do I need to set anything in my VC-2005 project setting?

 

Thank you,

Lek

0 Kudos
Message 3 of 4
(9,444 Views)

It works fine on my computer with both include statements.  Do you have any other computers that you could try this on to see if it is specific to that computer?

 

-Christina

0 Kudos
Message 4 of 4
(9,353 Views)