NO

Author Topic: /Go option Error  (Read 2537 times)

Maxpayne

  • Guest
/Go option Error
« 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!

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: /Go option Error
« Reply #1 on: April 03, 2019, 09:33:04 PM »
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

  • Guest
Re: /Go option Error
« Reply #2 on: April 03, 2019, 09:57:03 PM »
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?

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: /Go option Error
« Reply #3 on: April 03, 2019, 10:46:58 PM »
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

  • Guest
Re: /Go option Error
« Reply #4 on: April 03, 2019, 11:04:52 PM »
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.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: /Go option Error
« Reply #5 on: April 04, 2019, 11:22:18 AM »
There is no library to include. The function is in the CRT.
Try the following sample:
Code: [Select]
#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