473,386 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Borland C++ 5.5.1, Uresolved External

I am trying to compile an app that uses the libcurl API. I have the
files for that in the correct places. Then I compile I get the
following:
"Error: Unresolved ecternal '_curl_easy_init' refrenced from
c:\C++\CURL.OBJ
Error: Unresolved ecternal '_curl_easy_setopt' refrenced from
c:\C++\CURL.OBJ
Error: Unresolved ecternal '_curl_easy_perfrom' refrenced from
c:\C++\CURL.OBJ
Error: Unresolved ecternal '_curl_easy_cleanup' refrenced from
c:\C++\CURL.OBJ"

For now I am just testing to make sure I have the curl bit working, the
file stuff will come into use later, so here is my code:

"// basic file operations
#include <iostream>
#include <fstream>
#include <curl/curl.h>
using namespace std;

int main () {
// ofstream myfile;
// myfile.open ("example.txt");
// myfile << "Writing this to a file.\n";
// myfile.close();
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "google.com");
res = curl_easy_perform(curl);

/* always cleanup */
curl_easy_cleanup(curl);
cout << res;
}
return 0;
}"

May 23 '06 #1
8 4034

ch*******@gmail.com wrote:
I am trying to compile an app that uses the libcurl API. I have the
files for that in the correct places. Then I compile I get the
following:
"Error: Unresolved ecternal '_curl_easy_init' refrenced from
c:\C++\CURL.OBJ
Error: Unresolved ecternal '_curl_easy_setopt' refrenced from
c:\C++\CURL.OBJ
Error: Unresolved ecternal '_curl_easy_perfrom' refrenced from
c:\C++\CURL.OBJ
Error: Unresolved ecternal '_curl_easy_cleanup' refrenced from
c:\C++\CURL.OBJ"


Have you link your app with the libcurl (libcurl.lib?) ?

May 23 '06 #2
I don't have a libcurl.lib file, it never came with anything I
downloaded.

May 23 '06 #3
So you don't have any definitions of libcurl APIs? You have only the
"curl/curl.h" ?

Maybe you can find something more from your download website, e.g.
something like:
curl.cpp ????

May 23 '06 #4

<ch*******@gmail.com> skrev i en meddelelse
news:11**********************@y43g2000cwc.googlegr oups.com...
I am trying to compile an app that uses the libcurl API. I have the
files for that in the correct places. Then I compile I get the
following:
"Error: Unresolved ecternal '_curl_easy_init' refrenced from


There are a few things that can be the trouble here.

libcurl ships as source code and is written in C.
Normally you would compile it yourself as a link library or
as a dynamic library. By default borland creates the .lib
file toghether with the dll when compiled.
In both cases you need to import the .lib file.

If you downloaded a already compiled libcurl as dll.
Then borland has a nice utility tool called implib.exe
It can create the import library by reading the dll.

e.g. implib libcurl.lib libcurl.dll

In case its a static library compiled with a non borland compiler
you can use the coff2omf.exe for converting .lib from coff format
into omf format (borland linker uses omf not coff)

If you added the libcurl C files into you cpp project and
compiles it all into 1 .exe. The .c files will be compiled as C
and .cpp files as c++. When accessing functions from the
compiled c files (.obj) from c++ you need to use extern statement
e.g.:

extern "C" {
#include "curl/curl.h"
}

//eric
May 23 '06 #5
I faced this error before,
But it was because I called a function which I have not declared
before...

maybe it is just like that.

May 23 '06 #6
I think I will listen to Eric... I think I got what he said..

May 23 '06 #7
OK, I have the .lib file, now how do I use that in my program? (I am
newer to c++ incase you didn't guess)

May 23 '06 #8

"Chiefbutz" <ch*******@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...
OK, I have the .lib file, now how do I use that in my program? (I am
newer to c++ incase you didn't guess)


In borland c++ builder simply just add it to the project like any other file
and it will take care of the rest for you.

Project meny->add file to project

If you just use the command line tools the .lib file should be linked with
ilink32.exe

//eric
May 23 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ryan M. Keith | last post by:
I am having a problem with the ostream operator in templated classes that I wrote (I'm using the Borland compiler), and I'm certain that the templates are the problem because when I remove the...
0
by: Kenneth Gomez | last post by:
Hello, I have tried many avenues (web search, borland website, libxml website) before deciding to post here. I'm trying to install libxml2 on windows ME to work with my Borland C++ 5 Compiler...
4
by: NathanAllen | last post by:
First of all to let you know I am using the following compiler: Borland C++Builder 5.5.1 with Turbo Incremental Link 5.00 When I tried to make my first GUI drawing following Lawernceville Press's...
6
by: Wolfgang Tischer | last post by:
Hello everyone, i'm not very familiar with the insides of c++, i prefer asm... but unfortunately i'm in need for some c-help. (compiler switch, rewritten math.h or something) for the...
1
by: Terry | last post by:
Is there any hope of using Borland Developer Studio 2006 to link in a DLL compiled by MS Visual C++ version 6? I have a Win32 DLL from a company named Vocera. The DLL defines C++ classes that I...
4
by: yOtA | last post by:
I get this Linker Errors while compiling my program: Error: Unresolved external 'vminit()' referenced from C:\TESTE\TESTE.OBJ Error: Unresolved external 'vmalloc(void *, int, unsigned int,...
17
by: Fabry | last post by:
Hi All, I'm new of this group and I do not know if this is the correct group for my question. I have a DLL with its export library (.lib) wrote in Borland C++ 6. In borland everything is OK and...
3
by: SUJIE | last post by:
Hi all, I have few header files in c++ and obj file. I am trying to reuse the classes in the header files by including #include "myheader.h" I have set the lib and include path in the...
0
by: mvbrevern | last post by:
Hello there, I compile and link my soure code sucessfully with bcc32 (5.5.1) from Borland. Now I want to create a version with CodeGuard feature enabled. I compile with the -vG foption and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.