shellspi.h not compiling

Discussion in 'C Programming' started by jon2211, Oct 20, 2007.

  1. jon2211

    jon2211 Guest

    I tried to compile some code with #include <shellapi.h> . I am
    linking shell32.lib. I am not trying to use ShellExecute() but right
    now just getting the code to compile with the header file an issue. I
    am using Visual Basic 2005 (express). I got shellapi.h from the
    platform sdk.
    Thanks for any help.

    here is my error log
    1>------ Build started: Project: openFile, Configuration: Debug Win32
    ------
    1>Compiling...
    1>openFile.c
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(57) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(57) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(57) : error C2061: syntax error : identifier
    'STDAPICALLTYPE'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(57) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(58) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(58) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(58) : error C2061: syntax error : identifier
    'STDAPICALLTYPE'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(58) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(64) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(64) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(64) : error C2061: syntax error : identifier
    'STDAPICALLTYPE'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(64) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(65) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(65) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(65) : error C2061: syntax error : identifier 'DragFinish'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(65) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(65) : error C2182: 'HDROP' : illegal use of type 'void'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(66) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(66) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(66) : error C2061: syntax error : identifier
    'DragAcceptFiles'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(66) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(66) : error C2143: syntax error : missing ')' before ','
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(66) : error C2182: 'HWND' : illegal use of type 'void'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(66) : error C2059: syntax error : ')'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(66) : error C2182: 'BOOL' : illegal use of type 'void'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(68) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(68) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(68) : error C2061: syntax error : identifier
    'STDAPICALLTYPE'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(68) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(68) : error C2146: syntax error : missing ')' before
    identifier 'hwnd'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(68) : error C2061: syntax error : identifier 'hwnd'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(68) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(68) : error C2059: syntax error : ','
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(68) : error C2059: syntax error : ')'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(69) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(69) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(69) : error C2061: syntax error : identifier
    'STDAPICALLTYPE'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(69) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(69) : error C2146: syntax error : missing ')' before
    identifier 'hwnd'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(69) : error C2061: syntax error : identifier 'hwnd'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(69) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(69) : error C2059: syntax error : ','
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(69) : error C2059: syntax error : ')'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(75) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(75) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(75) : error C2061: syntax error : identifier
    'STDAPICALLTYPE'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(75) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(75) : error C2146: syntax error : missing ')' before
    identifier 'lpFile'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(75) : error C2061: syntax error : identifier 'lpFile'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(75) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(75) : error C2059: syntax error : ','
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(75) : error C2059: syntax error : ')'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(76) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(76) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(76) : error C2061: syntax error : identifier
    'STDAPICALLTYPE'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(76) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(76) : error C2146: syntax error : missing ')' before
    identifier 'lpFile'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(76) : error C2061: syntax error : identifier 'lpFile'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(76) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(76) : error C2059: syntax error : ','
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(76) : error C2059: syntax error : ')'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(82) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(82) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(82) : error C2143: syntax error : missing '{' before '*'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(82) : error C2061: syntax error : identifier
    'CommandLineToArgvW'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(82) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(82) : error C2146: syntax error : missing ')' before
    identifier 'lpCmdLine'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(82) : error C2061: syntax error : identifier 'lpCmdLine'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(82) : error C2059: syntax error : ','
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(82) : error C2059: syntax error : ')'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(84) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(84) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(84) : error C2061: syntax error : identifier
    'STDAPICALLTYPE'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(84) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(84) : error C2146: syntax error : missing ')' before
    identifier 'hWnd'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(84) : error C2061: syntax error : identifier 'hWnd'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(84) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(84) : error C2059: syntax error : ','
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(84) : error C2059: syntax error : ')'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(85) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(85) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(85) : error C2061: syntax error : identifier
    'STDAPICALLTYPE'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(85) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(85) : error C2146: syntax error : missing ')' before
    identifier 'hWnd'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(85) : error C2061: syntax error : identifier 'hWnd'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(85) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(85) : error C2059: syntax error : ','
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(85) : error C2059: syntax error : ')'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(91) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(91) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(91) : error C2061: syntax error : identifier
    'STDAPICALLTYPE'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(91) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(91) : error C2146: syntax error : missing ')' before
    identifier 'hInst'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(91) : error C2061: syntax error : identifier 'hInst'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(91) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(91) : error C2059: syntax error : ','
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(91) : error C2059: syntax error : ')'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(92) : error C2061: syntax error : identifier
    'DECLSPEC_IMPORT'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(92) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(92) : error C2061: syntax error : identifier
    'STDAPICALLTYPE'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(92) : error C2059: syntax error : ';'
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    \shellapi.h(92) : fatal error C1003: error count exceeds 100; stopping
    compilation
    1>Build log was saved at "file://c:\Visual Studio 2005\Projects
    \openFile\Debug\BuildLog.htm"
    1>openFile - 102 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
    ==========
     
    jon2211, Oct 20, 2007
    #1
    1. Advertising

  2. jon2211 wrote:
    >
    > I tried to compile some code with #include <shellapi.h> . I am

    [...]
    > 1>Compiling...
    > 1>openFile.c
    > 1>C:\Program Files\Microsoft Visual Studio 8\VC\include
    > \shellapi.h(57) : error C2061: syntax error : identifier
    > 'DECLSPEC_IMPORT'

    [... snip lots of similar errors ...]

    You'll need to ask in a group that knows about Windows-specific
    things like this. However, my guess would be that you need to
    include another Windows-specific header prior to <shellapi.h>.
    Check your documentation, and if you can't figure out which one(s)
    you need, ask in one of the Windows-specific newsgroups. (Perhaps
    somewhere in the comp.os.ms-windows.* tree?)

    --
    +-------------------------+--------------------+-----------------------+
    | Kenneth J. Brody | www.hvcomputer.com | #include |
    | kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
    +-------------------------+--------------------+-----------------------+
    Don't e-mail me at: <mailto:>
     
    Kenneth Brody, Oct 20, 2007
    #2
    1. Advertising

  3. jon2211

    Guest

    Thanks!!!

    I had the windows.h header file listed after shellapi.h. Put it
    before and compilation worked perfectly.
     
    , Oct 20, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marco A. Cruz Q.

    Compiling perl 5.6 in WIN32 does not work

    Marco A. Cruz Q., Jul 6, 2004, in forum: Perl
    Replies:
    1
    Views:
    455
    Marco A. Cruz Q.
    Jul 8, 2004
  2. Garrett Cooper
    Replies:
    0
    Views:
    566
    Garrett Cooper
    Feb 24, 2009
  3. Garrett Cooper
    Replies:
    0
    Views:
    504
    Garrett Cooper
    Feb 24, 2009
  4. mike11d11
    Replies:
    0
    Views:
    371
    mike11d11
    Jul 30, 2010
  5. Lon Baker
    Replies:
    1
    Views:
    227
    Csaba Henk
    Mar 21, 2005
Loading...

Share This Page