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

Compilation error in Snippet382 on Linux/macOS #1460

Closed
ptziegler opened this issue Sep 9, 2024 · 4 comments
Closed

Compilation error in Snippet382 on Linux/macOS #1460

ptziegler opened this issue Sep 9, 2024 · 4 comments

Comments

@ptziegler
Copy link
Contributor

ptziegler commented Sep 9, 2024

Describe the bug

This snippet sets the nativeZoom field of the GCData object. However, this field only exists on Windows, leading to a compilation error on both Linux and macOS.

private void drawImages(GC mainGC, GCData gcData, String text, int y, final Image imageWithFileNameProvider) {
gcData.nativeZoom = 100;
mainGC.drawText(text, 0, y);
mainGC.drawImage(imageWithFileNameProvider, 50, y);
gcData.nativeZoom = 150;
mainGC.drawImage(imageWithFileNameProvider, 100, (int) (y/1.5));
gcData.nativeZoom = 200;
mainGC.drawImage(imageWithFileNameProvider, 150, y/2);
}

Screenshots

image

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS
@akurtakov
Copy link
Member

Seems caused by #1214

@HeikoKlare
Copy link
Contributor

HeikoKlare commented Sep 9, 2024

Looks like you have an invalid state of a .classpath file in the snippets project. The snippet is Windows only and accordingly excluded from the classpath files for MacOS and Linux:

<classpathentry excluding="org/eclipse/swt/snippets/Snippet123.java|org/eclipse/swt/snippets/Snippet174.java|org/eclipse/swt/snippets/Snippet186.java|org/eclipse/swt/snippets/Snippet187.java|org/eclipse/swt/snippets/Snippet195.java|org/eclipse/swt/snippets/Snippet199.java|org/eclipse/swt/snippets/Snippet209.java|org/eclipse/swt/snippets/Snippet261.java|org/eclipse/swt/snippets/Snippet262.java|org/eclipse/swt/snippets/Snippet263.java|org/eclipse/swt/snippets/Snippet264.java|org/eclipse/swt/snippets/Snippet265.java|org/eclipse/swt/snippets/Snippet305.java|org/eclipse/swt/snippets/Snippet341.java|org/eclipse/swt/snippets/Snippet81.java|org/eclipse/swt/snippets/Snippet83.java|org/eclipse/swt/snippets/Snippet382.java" kind="src" path="src"/>

<classpathentry excluding="org/eclipse/swt/snippets/Snippet123.java|org/eclipse/swt/snippets/Snippet174.java|org/eclipse/swt/snippets/Snippet186.java|org/eclipse/swt/snippets/Snippet187.java|org/eclipse/swt/snippets/Snippet195.java|org/eclipse/swt/snippets/Snippet199.java|org/eclipse/swt/snippets/Snippet209.java|org/eclipse/swt/snippets/Snippet261.java|org/eclipse/swt/snippets/Snippet262.java|org/eclipse/swt/snippets/Snippet263.java|org/eclipse/swt/snippets/Snippet264.java|org/eclipse/swt/snippets/Snippet265.java|org/eclipse/swt/snippets/Snippet305.java|org/eclipse/swt/snippets/Snippet341.java|org/eclipse/swt/snippets/Snippet81.java|org/eclipse/swt/snippets/Snippet83.java|org/eclipse/swt/snippets/Snippet382.java" kind="src" path="src"/>

You should remove the existing .classpath file in the snippet project and either copy and rename the correct or, if you have an Oomphed setup, perform setup tasks and have Oomph fix that for your.

@ptziegler
Copy link
Contributor Author

Hm... the classpath is correctly pointing to .classpath_gtk:

image

And there the snippet is correctly excluded:

image

So it seems like the classpath is simply not updated properly :/ I've checked out a fresh workspace where the error doesn't show up anymore.

Thanks you both for your input!

@ptziegler ptziegler closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2024
@HeikoKlare
Copy link
Contributor

You are showing the linked .classpath file of the SWT fragment (like org.eclipse.swt.gtk.linux.x86_64) , not of the snippets project (i.e., org.eclipse.swt.snippets). In the snippets project, there is no linking of the correct .classpath file. It is simply copied by the Oomph setup (or by hand, in a manual setup). This is how it looks like:

image

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

3 participants