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

error examplre #475

Open
zerotrzy opened this issue May 28, 2021 · 2 comments
Open

error examplre #475

zerotrzy opened this issue May 28, 2021 · 2 comments

Comments

@zerotrzy
Copy link

Compiling glfw v0.41.0 (/home/itt/rust2/glfw-rs)
error[E0601]: main function not found in crate window_icon
--> examples/window_icon.rs:15:1
|
15 | / #![cfg(feature = "image")]
16 | |
17 | | extern crate glfw;
18 | | extern crate image;
... |
57 | | }
58 | | }
| |_^ consider adding a main function to examples/window_icon.rs

error: aborting due to previous error

For more information about this error, try rustc --explain E0601.
error: could not compile glfw.
warning: build failed, waiting for other jobs to finish...
error[E0601]: main function not found in crate cursor_icon
--> examples/cursor_icon.rs:15:1
|
15 | / #![cfg(feature = "image")]
16 | |
17 | | extern crate glfw;
18 | | extern crate image;
... |
57 | | }
58 | | }
| |_^ consider adding a main function to examples/cursor_icon.rs

error[E0601]: main function not found in crate vulkan
--> examples/vulkan.rs:15:1
|
15 | / #![cfg(feature = "vulkan")]

@jewel-snake
Copy link

I have faced the same problem. I tried to change code and differend cargo settings and eventually discovered how to fix it.
The secret is to include --features vulkan (or any other required feature) into cargo command. it also works if cfg macro is not used in code.

@aloucks
Copy link
Contributor

aloucks commented Dec 4, 2021

This is fixed in #489

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