NO

Author Topic: POLINK: error: Unresolved external symbol 'system'.  (Read 11687 times)

jasch212

  • Guest
POLINK: error: Unresolved external symbol 'system'.
« on: April 16, 2010, 10:25:58 am »
hello,
next question:
how to link a program which uses:
system("notify") ;

how can i find the lib for this function?

thanks
Thomas

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 578
    • Homepage
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #1 on: April 16, 2010, 11:18:22 am »
Have you already tried to compile it?
What error did you get?
What libraries are already included?

I had never had to include a special library for standard functions.
---
Stefan

Proud member of the UltraDefrag Development Team

JohnF

  • Guest
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #2 on: April 16, 2010, 11:58:49 am »
hello,
next question:
how to link a program which uses:
system("notify") ;

how can i find the lib for this function?

thanks
Thomas

Place the caret over the word 'system' then press F1, you should be presented with the PellesC help. Within the text you will see what header to include.

John

jasch212

  • Guest
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #3 on: April 16, 2010, 12:29:11 pm »
hi,
compile is OK, linking is the problem!
when I used the F1 key over:
system("notify") ;
I get the Help for system, but there is NO info about the lib I had to linked with my progrem.
Help:
Purpose:
Executes a system command.

I used following libs: (some systemLibs and some ownLibs for calculations:
aygshell.lib coredll.lib corelibc.lib geolib_ce.lib AviationFormularyLib.lib

Thomas

JohnF

  • Guest
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #4 on: April 16, 2010, 01:23:12 pm »
'system' will compile and link without you needing to specify libs.

All you need to do is include the right header.

John

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 391
    • Alex's Link Sammlung
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #5 on: April 16, 2010, 01:40:55 pm »
Are you sure, that system is available for Pocket PC?

System starts an other program with cmd.exe, which does not exist on Windows Mobile. :(
best regards
 Alex ;)

jasch212

  • Guest
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #6 on: April 16, 2010, 01:43:12 pm »
F1 says:
Declared in:
<stdlib.h>

I included it (compile is OK)

linker:
POLINK: error: Unresolved external symbol 'system'.
POLINK: fatal error: 1 unresolved external(s).
*** Fehlercode: 1 ***
Fertig.

I used pelle 5.0

It seems that "system" is not implememted.
can I otherwise execute an external program?

Thomas

JohnF

  • Guest
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #7 on: April 16, 2010, 03:06:53 pm »
linker:
POLINK: error: Unresolved external symbol 'system'.
POLINK: fatal error: 1 unresolved external(s).
*** Fehlercode: 1 ***
Fertig.

I used pelle 5.0

It seems that "system" is not implememted.
Thomas

It is implemented, there must be another problem somewhere. Can you post a small zipped project that shows the error?

John
« Last Edit: April 16, 2010, 03:08:40 pm by JohnF »

jasch212

  • Guest
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #8 on: April 16, 2010, 03:22:30 pm »
ok,
I have build (via wizzard) a short TestProject, what i now see is an addtional warning:

Erzeugen von main.obj.
E:\ts\workspace\test\main.c(59): warning #2027: Missing prototype for 'system'.
Erzeugen von main.res.
Erzeugen von test.exe.
POLINK: error: Unresolved external symbol 'system'.
POLINK: fatal error: 1 unresolved external(s).
*** Fehlercode: 1 ***
Fertig.

Thomas

JohnF

  • Guest
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #9 on: April 16, 2010, 03:48:46 pm »
Sorry, I can't test ARM things, maybe someone else can help.

Also, maybe system is not implemented on ARM, if that is the case I apologize.

John

jasch212

  • Guest
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #10 on: April 16, 2010, 03:53:46 pm »
ok,
thankyou JohnF,

does anyone know how to execute an external program on ARM?
or how to create a "beep" or littele sound on the loudspeaker.

Thomas
« Last Edit: April 16, 2010, 05:00:45 pm by jasch212 »

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1839

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1940
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #12 on: April 16, 2010, 06:54:22 pm »
MessageBeep
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

int __cdecl WinMainCRTStartup(void)
{
MessageBeep(0);
ExitThread(0);
}
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include <tchar.h>

void StartPrg(TCHAR *szModule, TCHAR *szCmdLine)
{
//STARTUPINFO si = { 0 };
PROCESS_INFORMATION pi = { 0 };
TCHAR szBuff[260];

//si.cb = sizeof(si);

// Start the child process.
if (!CreateProcess(szModule, // No module name (use command line)
szCmdLine, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
CREATE_NEW_CONSOLE, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
NULL, // Pointer to STARTUPINFO structure
&pi) // Pointer to PROCESS_INFORMATION structure
)
{
wsprintf(szBuff, L"CreateProcess failed (%d).\n", GetLastError());
MessageBox(0, szBuff, L"StartPrg", MB_OK);
return;
}
/*
    // Wait until child process exits.
    WaitForSingleObject( pi.hProcess, INFINITE );
*/
// Close process and thread handles.
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);

}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
StartPrg(L"\\Windows\\calc.exe", NULL);
return 0;
}
« Last Edit: April 16, 2010, 07:25:25 pm by timovjl »
May the source be with you

jasch212

  • Guest
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #13 on: April 16, 2010, 07:39:57 pm »
hello all,

1. MessageBeep(0); compile and link OK but it doesn't work.

2. StartPrg(L"\\Windows\\calc.exe", NULL); compile and link OK it works!!!

3. but I want to here sound or a beep
if (!CreateProcess(L"\\windows\\sndply.exe",
            _T("\\windows\\notify.wav"),
            NULL,
            NULL,
            FALSE,
            0,
            NULL,
            NULL,
            NULL,
            &pi) )
compile and link OK but it doesn't work.
I have now a problem with sndply.exe or with the *.wav file

Thomas

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1940
Re: POLINK: error: Unresolved external symbol 'system'.
« Reply #14 on: April 16, 2010, 08:28:21 pm »
- L"\\windows\\sndplay.exe"
- Try to use that CREATE_NEW_CONSOLE
« Last Edit: April 16, 2010, 08:45:57 pm by timovjl »
May the source be with you