Problem compiling examples with Visual Studio 2008

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
schwa226
Rank 1
Rank 1
Posts: 20
Joined: Thu Feb 11, 2010 9:20 am

Re: Problem compiling examples with Visual Studio 2008

Post by schwa226 » Fri Apr 02, 2010 11:53 am

thx!

I added:
Tools->Options->Projects and Solutions->VC++Directories->Inlucde files:
C:\MentorGraphics\WinDDK\7600.16385.1\inc\api
C:\MentorGraphics\WinDDK\7600.16385.1\inc\ddk

Tools->Options->Projects and Solutions->VC++Directories->Library files:
C:\MentorGraphics\WinDDK\7600.16385.1\lib\wxp\i386

Project->Proporties->Configuration Properties->Linker->Input->Additional Dependencies:
setupapi.lib, hid.lib

I tried to config the paths like above, but than I got errors in stdio.h.

WinDDK is 7.1.0
VS2008 Pro SP1
Project:
http://www.megaupload.com/?d=E4KX6EX8

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: Problem compiling examples with Visual Studio 2008

Post by maxi » Sat Apr 03, 2010 6:23 pm

Ok, I just downloaded VC2008 and got exactly the same problem with my original solution. Seems there are some conflicts with the VC includes and the WDK includes that for some reason did not present themselves under VC2005.

My solution: Under project properties C/C++ => Preprocessor set Ignore Standard Incude Path to Yes (/X). Then under C/C++ => General add C:\MentorGraphics\WinDDK\7600.16385.1\inc\crt to the Additional Include Directories.

That did it for me, let me know how you get on.

schwa226
Rank 1
Rank 1
Posts: 20
Joined: Thu Feb 11, 2010 9:20 am

Re: Problem compiling examples with Visual Studio 2008

Post by schwa226 » Mon Apr 05, 2010 8:23 pm

Thx a lot!

Great easter egg!

Tested on a Win7 x86 machine:
1>------ Build started: Project: NewConsole, Configuration: Debug Win32 ------
1>Compiling...
1>hiddata.c
1>c:\vusb-20090822\examples\hid-data\commandline\newconsole\hid-data\hiddata.c(41) : warning C4244: '=' : conversion from 'unsigned short' to 'char', possible loss of data
1>hidtool.c
1>Generating Code...
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>Embedding manifest...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at "file://c:\vusb-20090822\examples\hid-data\commandline\NewConsole\Debug\BuildLog.htm"
1>NewConsole - 0 error(s), 1 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

RiosMAc

Re: Problem compiling examples with Visual Studio 2008

Post by RiosMAc » Fri Apr 23, 2010 7:33 pm

this solution is for Win32 Console Application, i like to do some solution for MFCs, i did the code above and works perfectly but is for WIN32 Conosole Application, but i cant compile, any advice for MFCs? the MFCs error is:

1>------ Build started: Project: PICs, Configuration: Debug Win32 ------
1>Compiling...
1>stdafx.cpp
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\stdafx.h(22) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory
1>Build log was saved at "file://c:\Documents and Settings\Administrador\Mis documentos\Visual Studio 2008\Projects\PICs\PICs\Debug\BuildLog.htm"
1>PICs - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: Problem compiling examples with Visual Studio 2008

Post by maxi » Sat Apr 24, 2010 2:06 am

I dont currently have access to the notebook on which my test setup with WDK installed but IIRC there is some (limited) MFC stuff bundled with the WDK, maybe take a look in the /inc dir?

Really speaking though MSVC was never intended for building device drivers, what I have presented here is actually a bit hackish to be perfectly honest :roll:

Your best bet IMO is to compile the bits you need from the hid-data example into a dll and link that with your MFC app, others have reported success with this approach.

RiosMac

Re: Problem compiling examples with Visual Studio 2008

Post by RiosMac » Mon Apr 26, 2010 6:00 am

i put this in my header file called PICs.ccp, i am using MFCs:

#include <windows.h>
extern "C" {
#include "C:\WinDDK\7600.16385.1\inc\api\hidsdi.h"
}
#include "setupapi.h"

/***********************************************Configuring the paths on my project*******************************************************/

in PICs Properties -> C++ -> General -> Additional Includes Directories, i put this:
C:\WinDDK\7600.16385.1\inc;
C:\WinDDK\7600.16385.1\inc\crt;
C:\WinDDK\7600.16385.1\inc\api;
C:\WinDDK\7600.16385.1\inc\ddk;
C:\WinDDK\7600.16385.1\inc\mfc42

in PICs Properties -> Linker -> General -> Additional Library Directories, i put this:
C:\WinDDK\7600.16385.1\lib\wxp\i386

in PICs Properties -> Linker -> Input -> Additional Dependencies, i put this:
setupapi.lib hid.lib

and i got multiple errors, i show you the list of errors:

1>------ Build started: Project: PICs, Configuration: Debug Win32 ------
1>Compiling...
1>PICs.cpp
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\pics.cpp(16) : error C2059: syntax error : '&&'
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\pics.cpp(16) : error C2143: syntax error : missing ';' before '}'
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\pics.cpp(16) : error C2059: syntax error : '}'
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\pics.cpp(17) : error C2143: syntax error : missing ';' before '{'
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\pics.cpp(17) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\pics.cpp(17) : error C2059: syntax error : '}'
1>PICsDlg.cpp
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\picsdlg.cpp(77) : error C2059: syntax error : '&&'
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\picsdlg.cpp(77) : error C2143: syntax error : missing ';' before '}'
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\picsdlg.cpp(77) : error C2059: syntax error : '}'
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\picsdlg.cpp(78) : error C2143: syntax error : missing ';' before '{'
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\picsdlg.cpp(78) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\documents and settings\administrador\mis documentos\visual studio 2008\projects\pics\pics\picsdlg.cpp(78) : error C2059: syntax error : '}'
1>Generating Code...
1>Build log was saved at "file://c:\Documents and Settings\Administrador\Mis documentos\Visual Studio 2008\Projects\PICs\PICs\Debug\BuildLog.htm"
1>PICs - 12 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

some advice, my friends?

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: Problem compiling examples with Visual Studio 2008

Post by maxi » Mon Apr 26, 2010 9:37 pm

Well I honestly couldn't say without seeing the whole setup and I must say im not awfully familiar with MFC, I tend to use the wxWidgets api for GUI stuff.
My guess is a conflict somewhere between the MFC headers shipped with WDK and those included with MSVC or the SDK. But like I already suggested, simlply export the functions you need as a dynamic (or static) library then you can use these freely with your MFCs, C#, VB or whatever you prefer.

Connor
Posts: 2
Joined: Wed Aug 31, 2011 1:27 pm

Re: Problem compiling examples with Visual Studio 2008

Post by Connor » Wed Aug 31, 2011 1:29 pm

it's amazing how efficient and successful you guys have become with rolling out new features. It wasn't too long ago when you talked about the new WPF, and here it is.

One question thought. Do you think some of these shading levitra online features (software enhancements and not using hardware) can lead to Silverlight? SL can really use some bitmap boost. The shading would be a great step to adding that 3D look&feel to objects!

Thank you for great work and waiting for your announcements on SL beta 2!

Post Reply