Skip to main content
GameDev.net gamedev.net
🔒 Locked

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

Started by Amma Jun 12, 2005 at 11:14 AM 5 replies 16.6k views
Original Post
Amma
Amma
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.
-----------------------------Amma
Washu
Washu
Means that the .obj file has no public symbols exported. The solution is to remove any such .obj files from the link stage.
In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
Amma
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'?
-----------------------------Amma
Emmanuel Deloget
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,
Amma
Amma
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?
-----------------------------Amma
Verg
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.
Amma
Amma
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.
-----------------------------Amma

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.