ps2homebrew / wLaunchELF

ELF loader and File browser for Sony PlayStation 2
Other
492 stars 51 forks source link

Can't compile wLE starting with commit: b950488 #20

Closed Jay-Jay-OPL closed 5 years ago

Jay-Jay-OPL commented 5 years ago

The last version of wLE that I can compile is commit: https://github.com/AKuHAK/uLaunchELF/commit/763495f1ccb15a756cf6df801f73f90331107f8f (Aug 27, 2017)

But then that got broken starting with this commit: https://github.com/AKuHAK/uLaunchELF/commit/b95048872ab451ba71f5d8ca26bc655d53de8447 (Feb 18, 2018)

... and pretty much to any commit after that, gives me the same general error -- even the most current commit: https://github.com/AKuHAK/uLaunchELF/commit/b4f8a48b561e5f11cecb31790f3c834c27f86583 (Aug 11, 2018 )

I get the following error at the end of the compiling:

In file included from launchelf.h:8,
                 from main.c:4:
githash.h:1:20: warning: extra tokens at end of #ifndef directive
githash.h:2:17: warning: extra tokens at end of #ifndef directive
githash.h:2:1: unterminated #ifndef
githash.h:1:1: unterminated #ifndef
main.c: In function `Show_About_uLE':
main.c:296: `ULE_VERDATE' undeclared (first use in this function)
main.c:296: (Each undeclared identifier is reported only once
main.c:296: for each function it appears in.)
main.c:298: `GIT_HASH' undeclared (first use in this function)
make: *** [main.o] Error 1

Unless, I am using the wrong command? I use the make rebuild command. -- Please advise?

UPDATE:

If I revert only the changes made to this commit: https://github.com/AKuHAK/uLaunchELF/commit/b95048872ab451ba71f5d8ca26bc655d53de8447 (Feb 18, 2018)

I can then compile the latest wLE version: https://github.com/AKuHAK/uLaunchELF/commit/b4f8a48b561e5f11cecb31790f3c834c27f86583 (Aug 11, 2018 )

But it won't have the data that is generated inside the About page of wLE. :-(

sp193 commented 5 years ago

Do you have git installed? You need it to compile LaunchELF.

Jay-Jay-OPL commented 5 years ago

Yes, I believe so, unless it's a special GIT? Keep in mind I use the Windows Compiling Environment.

Though I use the msys window (C:\MinGW\msys\1.0\msys.bat)--since I prefer it, but I do have GIT, Mercurial, and MinGW.

Are you referring to any of the following?

  1. Git Bash
  2. Git CMD
  3. Git GUI

I don't use those, since I prefer msys, but let me know if that is what I am suppose to use?

Please advise?

sp193 commented 5 years ago

Uh. Specifically, the command-line tool. But it's also installed when you install the Git GUI. What are the outputs of the following commands?

If your MinGW installation is missing (you only kept MSYS), it may fail when the output from git is piped to tr.

Jay-Jay-OPL commented 5 years ago

For both commands, I get the following message:

JJ@PS2HOME ~/wle
$ git show -s --format=%cd --date=local
Sat Aug 11 08:03:14 2018

JJ@PS2HOME ~/wle
$ git show -s --format=%cd --date=local | tr -d "\n"
Sat Aug 11 08:03:14 2018

If you like to know what I am using as a windows compiling environment, here is the guide: http://www.ps2-home.com/forum/viewtopic.php?f=50&t=169

So I am not use to using GIT Bash window or the other ones I listed above under GIT.

I use msys that is under mingw. Because when I installed ps2toolchain, it is under the C:/MinGW directory and not under the C:/GIT directory -- like that guide for Windows Compiling Guide goes. -- FYI: that guide was given to me by @doctorxyz

I am currently wondering if I should install everything again, but through the GIT BASH cmd window so it's under the GIT directory and not under the mingw directory?? Since I notice that GIT for Windows now has a directory like this: C:\Git\mingw64

sp193 commented 5 years ago

How strange. It seems like it should work, but yet it does not work in practice....

Please do not use the Git Bash environment. It is another MSYS environment, which may not have the necessary libraries and paths set up.

When building LaunchELF fails, is there a githash.h file? Please paste its contents here.

Jay-Jay-OPL commented 5 years ago

Yes, the githash.h file does get created during the compiling. Here is what's inside:

#ifndef ULE_VERDATE\n#define ULE_VERDATE "Sat Aug 11 08:03:14 2018"\n#endif
#ifndef GIT_HASH\n#define GIT_HASH "b4f8a48"\n#endif
sp193 commented 5 years ago

It looks like the newline escape characters (\n) is not being expanded on.

From https://superuser.com/questions/256465/echo-newline-character-not-working-in-bash, it seems like the expansion of escape characters is implementation-dependant.

Can you try the following, so we can tell whether there is a way to make this work:

The correct output is:

Hello
World
Jay-Jay-OPL commented 5 years ago

Okay, here you go:

JJ@PS2HOME ~
$ echo "Hello\nWorld"
Hello\nWorld

JJ@PS2HOME ~
$ echo -e "Hello\nWorld"
Hello
World

JJ@PS2HOME ~
$ echo -e -n "Hello\nWorld"
Hello
World

JJ@PS2HOME ~
$ printf "Hello\nWorld"
Hello
World
sp193 commented 5 years ago

Thanks. Fixed in commit 3576a2b.