Home > Back-end >  Using g link is external libraries is undefined reference to case?
Using g link is external libraries is undefined reference to case?

Time:03-08

Himself wrote a a static library, but the connection is always appears undefined reference to XXX

CodePudding user response:

Reference: https://blog.csdn.net/philip0000/article/details/46612941? Ops_request_misc=% 257 b % 2522 request 2522% % 255 fid % 253 a 2522% % 2522% % 2522161508872616780255210868% % 2522 SCM 252 c 253 a % 252220140713.130102334 PC % 255 fall. The 2522% % 257 d & amp; Request_id=161508872616780255210868 & amp; Biz_id=0 & amp; Utm_medium=distribute. Pc_search_result. None - task - blog - 2 ~ all ~ first_rank_v2 ~ rank_v29-13-46612941. First_rank_v2_pc_rank_v29 & amp; E7 utm_term=% % 94% A8g E9%2 b % 2 b % % 93% BE 8 E8 A5 e % % % % E6%87% E5 B1 B7 E5 AA % % % % % 86% B8 E4 BA E4 % % 86% % 99% % 80% % E4 B8 E9 AA B8 E4 % % % % % 80% 9 d % E6 99% % 80% % 81% E5 BA 80% % 93% % E6 BB % E6 E5 AF % % % 98% 87% BA 8 e % % % E7 B0undefined + reference + 9 E7 to % % a % 84% E6 E5%86% % 83% 85% B5

CodePudding user response:

reference 1st floor QZJHJXJ response:
reference: https://blog.csdn.net/philip0000/article/details/46612941? Ops_request_misc=% 257 b % 2522 request 2522% % 255 fid % 253 a 2522% % 2522% % 2522161508872616780255210868% % 2522 SCM 252 c 253 a % 252220140713.130102334 PC % 255 fall. The 2522% % 257 d & amp; Request_id=161508872616780255210868 & amp; Biz_id=0 & amp; Utm_medium=distribute. Pc_search_result. None - task - blog - 2 ~ all ~ first_rank_v2 ~ rank_v29-13-46612941. First_rank_v2_pc_rank_v29 & amp; Utm_term A8g E7=% % 94% % 2 b % 2 b % E9%93% BE 8 E8 A5 e % % % % E6%87% E5 B1 B7 E5 AA % % % % % 86% B8 E4 BA E4 % % 86% % 99% % 80% % E4 B8 E9 AA B8 E4 % % % % % 80% 9 d % E6 99% % 80% % 81% E5 BA 80% % 93% % E6 BB % E6 E5 AF % % % 98% 87% BA 8 e % % % E7 B0undefined + reference + 9 E7 to % % a % 84% E6 E5%86% % 83% 85% B5

No,
I compile connected steps are as follows:
G + + -wall - c main. CPP - I "D: \ pro - o main." o

G + + -o main. Exe main. O - L "D: \ pro" - lx

CodePudding user response:

You don't have to specify their own libraries.

CodePudding user response:

reference 3 floor early play play nuclear response:
you don't have to specify your own library.

The library name is libx. A
I use -l pointed out that path, -l to connect to the library...
This way is wrong

CodePudding user response:

Notes should be use Wl switch link options

CodePudding user response:

reference 5 floor early play the play nuclear war response:
notes should be use Wl switch link option

Excuse me, are there any specific writing, beginners, I haven't seen this command
  • Related