Face._.
Face._.

Reputation: 21

Are there any alternatives to realpath()?

i was working on a project on my windows PC, which included the possibility to show the path of a file and I used the "realpath()" function... I executed it but the terminal returned this error to me... warning: implicit declaration of function 'realpath' and also this one undefined reference to `realpath' with collect2.exe: error ID returned 1 exit status. Is there something to show the path of a file in C that works? Please help me I can't find the answer.

Upvotes: 1

Views: 1098

Answers (1)

0___________
0___________

Reputation: 67475

collect2.exe: error ID returned 1 exit status

It means that linker could not find the function realpath and did not link the program to produce the executable. I happened because Windows libraries do not have this function. You need to use GetFullPathName() function instead.

I was trying to give this executable to some of my friends but I can't

It is because the .exe file was not created.

Upvotes: 2

Related Questions