News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

/Go option Error

Started by Maxpayne, April 03, 2019, 07:02:14 PM

Previous topic - Next topic

Maxpayne

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!

frankie

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.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Maxpayne

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?

frankie

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.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Maxpayne

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.

frankie

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.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide