[Visual-C-Lovers] 'Plugin' c++ file not linked in application

2 views
Skip to first unread message

ob_fr

unread,
Apr 20, 2010, 11:54:23 AM4/20/10
to Visual C++ Lovers
Here is a tricky problem for you VC++ users.

I have 2 projects in a Visual C++ 2005 solution.
One is a static library, one is an executable.
In the static library, i have a c++ file.

The C++ file defines some methods, and a class. This class is supposed
to initialize somewhere else in the program pointers to the functions
defined in the file when its constructor is called. That's why there
is a global instance of this class defined in the file, so that the
constructor is called before the main(). The rest of the program knows
no declaration of any symbol in this file.

However, it seems that Visual C++ doesn't generate any object code for
this file, as it sees no reference to its code in the rest of the
program. The SBR file file for this CPP file is 0 bytes long, and i
can not set a breakpoint in this code ("no symbols have been loaded
for this file" message).

This is happening in the debug build, with no optimization, and i made
sure do disable the options to remove unreferenced data in the
Executable's linking options.
Also, i don't get the warning message that "no public symbols have
been found so no code will be generated for this file".

This code is working how i want it to on Linux, and in Visual C++,
just before i added an unrelated modification (added a puts()
somewhere). So i'm a bit lost

Deleting the sbr files / rebuilding the solutions / restarting visual C
++ didn't help

Any ideas?

--
You received this message because you are subscribed to the Google Groups "Visual C++ Lovers" group.
To post to this group, send email to visual-...@googlegroups.com.
To unsubscribe from this group, send email to visual-c-love...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/visual-c-lovers?hl=en.

Reply all
Reply to author
Forward
0 new messages