Jump to content
  • Advertisement
Sign in to follow this  
Amma

[C++] How do I correct this: warning LNK4221: no public symbols found ... ?

This topic is 4878 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I get this warning on some .obj files, or even whole .lib projects: warning LNK4221: no public symbols found; archive member will be inaccessible Can someone tell me how to correct it. Please don't suggest pragma warning, I want to fix this properly.

Share this post


Link to post
Share on other sites
Advertisement
Means that the .obj file has no public symbols exported. The solution is to remove any such .obj files from the link stage.

Share this post


Link to post
Share on other sites
Quote:
Original post by Washu
Means that the .obj file has no public symbols exported. The solution is to remove any such .obj files from the link stage.


What do you mean by 'public symbols'?

Share this post


Link to post
Share on other sites
Quote:
Original post by Amma
Quote:
Original post by Washu
Means that the .obj file has no public symbols exported. The solution is to remove any such .obj files from the link stage.


What do you mean by 'public symbols'?


He means exported symbols that would be seen by the other translation units. For example, a function, a class member, a global variables, and so on.

Regards,

Share this post


Link to post
Share on other sites
Quote:
Original post by Emmanuel Deloget
Quote:
Original post by Amma
Quote:
Original post by Washu
Means that the .obj file has no public symbols exported. The solution is to remove any such .obj files from the link stage.


What do you mean by 'public symbols'?


He means exported symbols that would be seen by the other translation units. For example, a function, a class member, a global variables, and so on.

Regards,


Thanks, but how do any of those get public/private?

Share this post


Link to post
Share on other sites
In other words, what's really going on is that the particular .obj file doesn't contain any code that will end up in your .exe

You have compiled a .c/.cpp, but you haven't called any of the functions/class members from it in your application, so the .obj file won't be used to create the .exe

Does that make sense to you?

"public", as used, doesn't mean the same thing as "public:" in a class declaration, btw.

Share this post


Link to post
Share on other sites
Quote:
Original post by Verg
In other words, what's really going on is that the particular .obj file doesn't contain any code that will end up in your .exe

You have compiled a .c/.cpp, but you haven't called any of the functions/class members from it in your application, so the .obj file won't be used to create the .exe

Does that make sense to you?

"public", as used, doesn't mean the same thing as "public:" in a class declaration, btw.


Thanks, makes much more sense.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!