Pelles C forum
C language => Beginner questions => Topic started by: Maxpayne on April 03, 2019, 07:02:14 PM
-
Hello,
How to apply the "/Go option" in order to use old instructions without the "initial" underscore?
Instructions like :-
access, basename, cgets, chdir, chmod, chsize, close, closedir, clreol, clrscr, cprintf, cputs
I tried to put the /Go option in the > compiler > "defined preprocessor symbols" , but i got this error:-
fatal error #1051: Invalid -D or -U argument: /Go.
How to apply /Go option properly ?
Thanks in advance!
-
Welcome on board.
In the IDE open project options menu, then check "Define compatibility names" option, and the switch /Go will be inserted on the compiler invocation line.
/Go is a command switch not a define.
-
Thanks, that solved it! :)
now I get another error for the functions getpid, gettid...
POLINK: error: Unresolved external symbol 'getpid'
POLINK: error: Unresolved external symbol 'gettid'
Which library should i use for these functions?
-
You have to include the header <process.h> where the functions are defined.
I suggest you to use the help->contents where you'll find a complete reference of the language, ide and libraries.
-
I'm actually using <process.h> header already, the problem is with the library, I can't figure out which library to use. That's why I get that error.
-
There is no library to include. The function is in the CRT.
Try the following sample:
#include <stdio.h>
#include <process.h>
int main(int argc, char *argv[])
{
printf("pid = %d\n", getpid());
return 0;
}
Create anew project, select old names compatibility, put the code above in a source file, then compile and run the project.