NO

Author Topic: POLINK: error: Unresolved external symbol 'ShellExecute'  (Read 6875 times)

hongchng

  • Guest
POLINK: error: Unresolved external symbol 'ShellExecute'
« on: August 29, 2007, 08:35:08 AM »
Hi,

I am new to Pelles C.

I am having linking problem when trying to use ShellExecute. Appreciate if someone can help.

POLINK: error: Unresolved external symbol 'ShellExecute'.
POLINK: fatal error: 1 unresolved external(s).

ShellExecute is in shell32.lib which is in <C:\Program Files\>PellesC\Include\Win.

I have tried all the following
1) added shell32.lib under Project->Project Option->Linker->Library and object files. Path is in Folders tab.
2) in the C file,  use
a) #include <shellapi.h>
b) #pragma comment(lib, "shell32.lib")
c) #pragma lib "shell32.lib"
d) #pragma intrinsic(ShellExecute)
e) #pragma function(ShellExecute)
f) #pragma ShellExecute()

Same thing when I am trying to use a Load Image API from comctl32.lib.

When have I done wrong or have not done properly.

Please help.

thanks,
Hong

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: POLINK: error: Unresolved external symbol 'ShellExecute'
« Reply #1 on: August 29, 2007, 08:55:14 AM »
Shell32.lib is in the linker libraries (project options -> linker) ?
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

hongchng

  • Guest
Re: POLINK: error: Unresolved external symbol 'ShellExecute'
« Reply #2 on: August 29, 2007, 01:52:12 PM »
I have added shell32.lib under the Linker Tab.

ie. for Library and Object files I have
comctl32.lib aygshell.lib coredll.lib corelibc.lib shell32.lib

which means the Command line option (LINKFLAGS) looks
-subsystem:windowsce,3.0 -machine:arm  comctl32.lib aygshell.lib coredll.lib corelibc.lib shell32.lib

For Folders tab->Libraries Type,

I have C:\Program Files\PellesC\Lib\Win, this is where shell32.lib is located.



Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: POLINK: error: Unresolved external symbol 'ShellExecute'
« Reply #3 on: August 29, 2007, 05:16:17 PM »
WinCE doesn't have ShellExecute!
If you are creating a program for WinCE you must use 'ShellExecuteEx'.
Next time please specify that your project is for WinCE possibly posting in the Pocket PC and smartphones thread.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

hongchng

  • Guest
Re: POLINK: error: Unresolved external symbol 'ShellExecute'
« Reply #4 on: August 30, 2007, 02:40:43 AM »
Thanks Frankie!! Good tips. I am new to Pelles C and Pocket PC. But will definitely be using it a lot in the future. Will post to the right forum!

Hong