hi, is there any error in my configuration. link the .lib file failed on windows. #20093
-
on windows, run
src/BUILD: load("@rules_cc//cc:defs.bzl", "cc_binary")
cc_binary(
name = "main",
srcs = ["main.cpp"],
copts = ["-I third/include"],
linkopts = ["-DEFAULTLIB:opengl32.lib"],
deps = [
"//third:thirdlib",
],
) third/BUILD: load("@rules_cc//cc:defs.bzl", "cc_import", "cc_library")
cc_import(
name = "glew32",
hdrs = glob(["include/GL/*.h"]),
static_library = "lib/glew32.lib",
visibility = ["//src:__pkg__"],
)
cc_import(
name = "glfw3",
hdrs = glob(["include/GLFW/*.h"]),
static_library = "lib/glfw3.lib",
visibility = ["//src:__pkg__"],
)
cc_import(
name = "soil2",
hdrs = glob(["include/SOIL2/*.h"]),
static_library = "lib/soil2-debug.lib",
visibility = ["//src:__pkg__"],
)
cc_library(
name = "glm",
srcs = glob(["include/glm/*.hpp"]),
hdrs = glob(["include/glm/*.h"]),
visibility = ["//src:__pkg__"],
)
cc_library(
name = "thirdlib",
linkopts = ["-DEFAULTLIB:opengl32.lib"],
visibility = ["//src:__pkg__"],
deps = [
":glew32",
":glfw3",
":glm",
":soil2",
],
) |
Beta Was this translation helpful? Give feedback.
Answered by
zhangwb1996
Nov 9, 2023
Replies: 2 comments 3 replies
-
What error message did you get? Is |
Beta Was this translation helpful? Give feedback.
3 replies
-
Sovled by linking |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
zhangwb1996
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sovled by linking
user32.lib, gdi32.lib, shell32.lib
. this is the repository opengl_baze