Long distance guesswork, but

(a) place a 'declspec(__dllimport)' before the SMIME_*() prototype in
there and recompile (this is assuming you've built .DLL files for
libea32/ssl), and/or

(b) check the exports of the DLLs using the dependency walker, and lastly

(c) MSVC2008 /may/ have trouble finding the related source code files.

My own MSVC(2005) projects are always included as projects in any
product solution and make sure the application(s) link/load the proper
libs through setting their 'Project Dependencies'.
Generally speaking, I always try to prevent having to add additional
.lib 'linker input' items in any project and Makefiles and other
non-MSVC-IDE build methods have bitten me in the bum often enough by
now to always make me create MSVC projects for that sort of stuff as
well.


The point here is:

- you may be bitten by unidentified compiler settings, which
'decorate' the exported C functions as if they were C++ global
functions (e.g. compile as C++ setting), which should show up if you
dump the DLL exports for libeay32/ssl32. Though for cases like these,
the link phase should fail.

- #pragma comment(lib,...) is cute, but it doesn't say which DLL/lib
you are going to be linking to _Exactly_: (linker) search path
determines that, in the end.

- you may be bitten by MSVC, which, at least up to version 2005SP1,
has shown quite flaky behaviour over here regarding debug assistance
for 'foreign' input such as 'linker: input' libs for DLLs (with and
without C7 or 'full' debug info; though 'downgrading' to C7 debug info
seemed to help in a few rare cases).


Bottom line: if you want 'dependable' debug support for libraries,
make sure you include their /projects/ (which includes their source
code) and link them by setting the 'Project Dependencies' while
keeping the Linker:additional input line clear and refrain from using
#pragma comment(...): setting up the proper project dependencies (plus
a bit of post-build custom action) means those #pragma's won't be
necessary.


(Though these are for MSVC2005SP1, you can take a look at the OpenSSL
projects + source 'n all at http://hebbut.net/
Yes, I use a different DLL export system, using OpenEXR's (revised)
CreateDLL tool, as that saves me a _lot_ of this dllimport/export
hassle, but the important bit of post-build action code is the bit
where the linked DLLs and EXE's are all copied to '/bin/(platform)'
deploy directories: having them all together in one place is what
makes the debugging easy: I'm ensured that way that the development
DLLs are loaded and not some 'installed' copy from somewhere else on
the system. (See this working by stepping through and adding
breakpoints anywhere, while running the MEGAMONOLITH app
i_a_win32.exe, which encompasses all OpenSSL test/demo apps, including
the openssl wrapper itself, in the MSVC debugger.)


Caveat: I haven't tested MSVC2008 yet. YMMV.






On Mon, Dec 15, 2008 at 10:12 AM, Antonio Parrotta
<antonioparro...@gmail.com> wrote:
> Hi Guys,
>
> I'm trying to step into openssl modules using visual studio 2008. In
> particular I would investigate on ASN1 parse mechanism regarding SMIME type.
> I have followed the instruction reported in INSTALL.W32 at section tweaks.
> They were generated in out32.dbg both *.pdb and *.lib, this make me think
> that symbols were created. Then I have created a VC project from scratch,
> including both libeay32.lib and ssleay32.lib. The code is really simple, it
> is just a try:
>
> // openssldbg.cpp : Defines the entry point for the console application.
> #include "openssl/ssl.h"
> #pragma comment(lib, "ws2_32.lib")
> #pragma comment(lib,"libeay32.lib")
> #pragma comment(lib,"ssleay32.lib")
> #include <windows.h>
>
> extern "C"
> {
>    PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
> }
>
> int _tmain(int argc, _TCHAR* argv[])
> {
> p7 = SMIME_read_PKCS7(in, &indata);
> }
>
> debugger is not stepping into SMIME_read_PKCS7, any idea?
>
> thx a lot
> - Antonio
>



-- 
Met vriendelijke groeten / Best regards,

Ger Hobbelt

--------------------------------------------------
web:    http://www.hobbelt.com/
        http://www.hebbut.net/
mail:   g...@hobbelt.com
mobile: +31-6-11 120 978
--------------------------------------------------
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to