Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker errors #50

Open
Lexikos opened this issue Nov 11, 2022 · 2 comments
Open

Linker errors #50

Lexikos opened this issue Nov 11, 2022 · 2 comments

Comments

@Lexikos
Copy link
Contributor

Lexikos commented Nov 11, 2022

Full disclosure: I am not using the "prerequisite" setup described in the readme.

  • I already had the SciTE source code downloaded.
  • Official SciTE uses Visual Studio 2019 and nmake on Windows, so I chose to use VS 2022 and nmake.
  • My msys2/clang64 command prompt can't find git (but git is installed). I don't have/want/need Mercurial.

I was unable to apply the diffs using git apply as instructed; Git apply patch fails silently (no errors but nothing happens). I used patch -p1 < whatever.diff instead. This appears to have applied the patch without errors.

The linker failed to resolve some symbols:

  • PathRemoveFileSpecW and some others, because SHLWAPI.LIB is missing from the import libs.
  • MessagePumpLibInit (decorated), because MessagePump.obj is missing from the dependencies (SHAREDOBJS) in scite.mak.

After fixing those issues, I was able to build using the following batch script, invoked from a VS Code Task:

call "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat"

pushd main\scintilla\win32
nmake -f scintilla.mak
popd

pushd main\lexilla\src
nmake -f lexilla.mak
popd

pushd main\scite\win32
nmake -f scite.mak
popd
@fincs
Copy link
Owner

fincs commented Nov 11, 2022

Hi there!

Official SciTE uses Visual Studio 2019 and nmake on Windows, so I chose to use VS 2022 and nmake.

At the time when working on the last release of S4AHK I did not have VS installed at all, and did not wish to install a big (~10GB) software package on my computer. An interesting thing about msys2/clang64 is that it uses the latest official C runtime library (aka Universal C Runtime) unlike previous gcc based Windows compilers, which used the old msvcrt.dll.

My msys2/clang64 command prompt can't find git (but git is installed). I don't have/want/need Mercurial.

Full disclosure: I don't actually have/want/need Mercurial either. I'm internally using a git-hg bridge to make my life easier, but I decided to give instructions pointing to the official hg repos in order to rely on vanilla upstream as much as possible, and also to simplify future three-way merges when it is time to move to a new SciTE release.

I was unable to apply the diffs using git apply as instructed; Git apply patch fails silently (no errors but nothing happens). I used patch -p1 < whatever.diff instead. This appears to have applied the patch without errors.

The linked StackOverflow thread combined with my previous disclosure might explain why it worked for me locally when testing the instructions, but not for others. Good catch, I will replace it with the patch command, which seems more straightforward anyway.

The linker failed to resolve some symbols:

As you may have guessed, I did not pay attention to the NMake/MSVC path of the buildsystem. I've checked the diff and (other than autogenerated changes) apparently I left a rule for MessagePump.obj; I suspect this was a leftover of an older patch of mine I applied. Given that the changes required to restore buildability with NMake/MSVC seem minimal, I have no objections to fixing this.

I'm leaving this issue open as a self-reminder.

@Lexikos
Copy link
Contributor Author

Lexikos commented Nov 12, 2022

As you may have guessed,

Yes, although only after I worked out that nmake and make aren't compatible and there are therefore two sets of makefiles (makefile and *.mak). This was after I opened the issue.

Initially I found the MessagePump.o reference and no MessagePump.obj, so I assumed it was just missing from the patch and wouldn't work in any build. Only later I realized that the former was for make and the latter for nmake.

At the time when working on the last release of S4AHK I did not have VS installed at all, and did not wish to install a big (~10GB) software package

Incidentally, I am not using Visual Studio itself with SciTE. I believe you can just install the Visual Studio Build Tools; I read as much while configuring VS Code to build and debug SciTE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants