POLINK: error: Unresolved external symbol 'system'.

Started by jasch212, April 16, 2010, 10:25:58 AM

Previous topic - Next topic

jasch212

hello,
next question:
how to link a program which uses:
system("notify") ;

how can i find the lib for this function?

thanks
Thomas

Stefan Pendl

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

Quote from: jasch212 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

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

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

'system' will compile and link without you needing to specify libs.

All you need to do is include the right header.

John

AlexN

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

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

Quote from: jasch212 on April 16, 2010, 01:43:12 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

jasch212

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

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

#10
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

frankie

"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

TimoVJL

#12
MessageBeep
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

int __cdecl WinMainCRTStartup(void)
{
MessageBeep(0);
ExitThread(0);
}

#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;
}
May the source be with you

jasch212

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

TimoVJL

#14
- L"\\windows\\sndplay.exe"
- Try to use that CREATE_NEW_CONSOLE
May the source be with you