Layla, I haven’t used VC++ in a while…and have never used it from the cmd line…but I would try something from the makefile suggestion below.  Again, I’m not familiar with VC++, but will this work:

 

cl –I/path/to/openssl/headerfiles clientf.cpp

 

??

 

-kevin

 


From: owner-[EMAIL PROTECTED] [mailto:owner-[EMAIL PROTECTED]] On Behalf Of Layla
Sent: Wednesday, July 28, 2004 8:52 AM
To: [EMAIL PROTECTED]
Subject: Re: Linking Error.

 

Weijie,

Thank you for replying, does it make any difference if I compile from the command line or GUI? cause as I've mentioned, when I compile from Visual studio I get no error messages which indicates that it can "see" my include files, but when I tried running the compiler from the command line I got the following error:

 

D:\Program Files\Microsoft Visual Studio\MyProjects\clientside>cl clientf.cpp

Microsoft <R> 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86

Copyright <C> Microsoft Corp 1984-1998. ALL rights reserved.

clientf.cpp

clientf.cpp<17> : fatal error C1083: Cannot open include file: 'openssl/crypto.h' : No such

file or directory.



Weijie Zhang <[EMAIL PROTECTED]> wrote:

You need to make sure that you are linking to the (or, maybe, the proper) libaray. Type "set" in your dos prompt and check the corresponding path which define where linker goes to find your lib etc. I believe the VC++ can show you somewhere of the enviornment set. You can get clues by examing the difference too.

 

Weijie

----- Original Message -----

From: Layla

Sent: Wednesday, July 28, 2004 11:10 AM

Subject: Re: Linking Error.

 

Thanks for the response Vio,

Actually I'm not familiar with the method you've proposed. but I tried to compile the program from command line and It failed! I can't understand why its compiling by using GUI but not from the command prompt. I'm so new to this and this project is really very important to me. Any one PLEASE help me.

 

Thank you.

Vio <[EMAIL PROTECTED]> wrote:

I'm not too familiar with VC++ (ever tried DevC++ or MingwStudio? If old
old VC++6 fails to do what you want, both free IDE alternatives), but
whatever, doesn't VC generate some kind of Makefile between the
curtains? Maybe you could create what's missing by hand?
A Makefile looks something like this:

---------------------------------------

#
# File: Makefile for samples
# Author: Robert Roebling
# Created: 1999
# Updated:
# Copyright: (c) 1998 Robert Roebling
#
# This makefile requires a Unix version of wxWindows
# to be installed on your system. This is most often
# done typing "make install" when using the complete
# sources of wxWindows or by installing the two
# RPM packages wxGTK.XXX.rpm and wxGTK-devel.XXX.rpm
# under Linux.
#

CXX = $(shell wx-config --cxx)

PROGRAM = MyApp

OBJECTS = $(PROGRAM).o MySSL.o MyFrame.o MyCustom.o
MYFLAGS = -I/d/ssl/run/include -I./ssl
MYLIBS = -L/d/ssl/run/lib -lssl -lcrypto

.SUFFIXES: .o .cpp .c

.cpp.o :
$(CXX) -g -c `wx-config --cxxflags` $(MYFLAGS) \
-Wall -pthread -o $@ $<

.c.o :
gcc -g -c $(MYFLAGS) -Wall -pthread -o $@ $<


all: $(PROGRAM)

$(PROGRAM): $(OBJECTS)
$(CXX) -g -o $(PROGRAM) $(OBJECTS) `wx-config --libs` \
$(MYLIBS) -Wall -pthread

clean:
rm -f *.o $(PROGRAM)

---------------------------------------


What it does is that it generates compiling and linking commands,
for instance the previous Makefile generates the following:

g++ -g -c `wx-config --cxxflags` -I/d/ssl/run/include -I./ssl -Wall
-pthread -o MyFrame.o MyFrame.cpp
g++ -g -o MyApp MyApp.o MySSL.o MyFrame.o MyCustom.o `wx-config --libs`
-L/d/ssl/run/lib -lssl -lcrypto -Wall -pthread

First one is a compile command, second is a linking command.
So you need the second one.

Hope this helps somewhat,
Vio




Layla wrote:

> David,
> Thanks for responding. "didn't work" is actually missing a word :),
> what i meant to say is "when /that/ didn't work" in reference to the
> specified path.
>
> You're right, I can compile, its linking that is giving me an error.
>
>
> "You have told the linker where the libraries are, but you didn't
> actually link them in."
> -So how can I actually link the library?
>
> Note: As I said before I'm using VC++ 6, therefore I'm compiling and
> linking using GUI not from the command line, would that be an issue?
>
> -In the INSTALL file, I couldn't find reference to creating an
> environment variable that points to the root directory of OpenSSL, and
> I'm sure that I've read about this in one of the sites. Could this be
> the cau se of my problem?
>
> Your help is highly appreciated.
> Layla.
>
>
>
> */David Schwartz <[EMAIL PROTECTED]>/* wrote:
>
>
> > 1) D:\Documents and Settings\Administrator\My
> Documents\openssl-0.9.7d\inc32
> > this is the directory where OpenSSL was extracted to. when
> didn't work I
> tried:
>
> What does "didn't work" mean?
>
> > 2) D:\openssl\include
> > this is the directory which I have created and copied to the
> files as
> instructed in > the installation steps in Install.win32 file.
>
> > Likewise on the Link pane, in the input category, I added the
> additional
> library
> > path as follows:
> > 1) D:\Documents and Settings\Administrator\My
> Documents\openssl-0.9.7d\out32dll
> > this is the directory where OpenSSL was extracted to, again when
> that
> didn't wor k I > tried:
>
> What does "didn't work" mean?
>
> > 2) D:\openssl\lib
> > this directory which I have created during the installation steps
> holds the
> > following t wo files:
> > - libeay32
> < - ssleay32
>
> > Upon linking I get the following error message for EACH of the
> OpenSSL
> functions:
> > "unresolved external symbol _SSL_CTX_free"
>
> If you got to linking, then you must have compiled. Which means your
> include settings are probably fine.
>
> > WHAT am I doing wrong?! Please help.
>
> You are not linking to the OpenSSL libraries. You are including
> the header
> files, which is why compiling is (I think) working. You have told
> the linker
> where the libraries are, but you didn't actually link them in.
>
> DS
>
>
> ______________________________________________________________________
> OpenSSL Project http://www.openssl.org
> User Support Mailing List [EMAIL PROTECTED]
> Automated List Manager [EMAIL PROTECTED]
>
> ------------------------------------------------------------------------
> Do you Yahoo!?
> New and Improved Yahoo! Mail
>
> - Send 10MB messages!




______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]


Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.


Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

Reply via email to