Pelles C forum
C language => Beginner questions => Topic started by: hongchng 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
-
Shell32.lib is in the linker libraries (project options -> linker) ?
-
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.
-
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.
-
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