Click here to Skip to main content
14,774,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I'm using the QR source code provided by Fulvio Dominici (which is posted on CODE PROJECT web site "Simple C/C++ QR code Library")Simple C/C++ QRCode Library[^]

And whenever i try to complie the project, i get the following errors:
1- [ilink32 Error] Error: Unresolved external '_QRcode_encodeString' referenced from C:\USERS\RANIA\DOCUMENTS\QR CODE PRACTICE2\QRGENERATOR\QRGENERATOR\WIN32\DEBUG\QRGENERATOR.OBJ

2- [ilink32 Error] Error: Unresolved external '_QRcode_free' referenced from C:\USERS\RANIA\DOCUMENTS\QR CODE PRACTICE2\QRGENERATOR\QRGENERATOR\WIN32\DEBUG\QRGENERATOR.OBJ

3- [ilink32 Error] Error: Unable to perform link

and i've placed my project in the following path:C:\Users\rania\Documents\QR CODE PRACTICE2\QRGenerator\QRGenerator

So, i don't know what is the problem, why it cannot link? is it the location of the project or what?

Need help. Please!

Regards.
Posted
Updated 16-Mar-14 23:07pm
v2
Comments
Jochen Arndt 17-Mar-14 4:07am
   
It seems that you did not add all sources to your project (especially those form the LibQREncode folder).
raniam 17-Mar-14 6:08am
   
I've added all the *.h files in my *.cpp, but the problem is that the package does not contain any *.lib nor *.dll files.
So what can i do?

Regards.
Jochen Arndt 17-Mar-14 6:51am
   
The article states that it did not build the library but provide the library source files to be compiled with your application. So you must add all the C files in the LibQREncode directory to your project so that they become part of the project and be compiled and linked.

I don't know C++ Builder XE3. So you must consult the manual on how to add existing source files to a project.
raniam 17-Mar-14 7:07am
   
Thank you, i've copied all the C files into my project directory and included all the (.h) files into my (.cpp), and the previous errors were gone. But another error came up, which is:
1- [ilink32 Error] Error: Unresolved external '_main' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\10.0\LIB\WIN32\RELEASE\C0X32.OBJ

2- [ilink32 Error] Error: Unable to perform link

Even though, i'm working on a console application, but i dont know why i get this error
Need you help pleeeeeeeeeeeeeese
Best Regards.
Jochen Arndt 17-Mar-14 7:23am
   
The file QRGenerator.cpp contains the function 'int _tmain(int argc, _TCHAR* argv[])'. This is a Microsoft specific name to differentiate between Unicode and ANSI builds. Just rename the function in the source file to 'main' and the error should disappear.
raniam 17-Mar-14 8:13am
   
thank you for replying, and sorry for not getting it right :(
But when adding the (*.c) files from the LibQREncode folder into my project, and compiling the project (Make and Build), i get a lot of syntax and declaration errors, with regard to the .c files i've added.
My questions are:
1- Do i COPY these files to the project folder only, or should i ADD them into the project, because i think they must not be changed.
2- what are the library and DLL files i should link to my project

Thank you so much, and i really appreciate your help
Jochen Arndt 17-Mar-14 10:18am
   
First: You should use the 'Reply' button right of a comment to write a reply. Then it is shown indented and the author of the first message will get an email notification (me in this case).

It does not care where the source files are located. It is common to copy such files to a sub folder of your project source directory like provided from the download. By adding them to the project you tell your development tool (C++ Builder XE) that they are part of your project and where they are located so that they can be compiled.

What libraries must be added to your project depends on your project (if you call functions from libraries, they must be added). The standard libraries are usually added automatically by the development tool. If a library is missing, you will get unresolved externals errors like you have seen already.

There are two problems here:
- The project you downloaded is for Visual Studio but you are using C++ builder.
- The source files from the library directory are C files (not C++).

So it may be necessary to edit the downloaded source files to be compatible with your compiler. But such conversions are beyond the scope of CP Q&A. Especially when you are new to C/C++ programming. You may try to find a tutorial in the web on how to compile Visual Studio projects with C++ builder. Alternatively, read the error messages, have a look at the source code line that raises it, try to understand the error using the help files of your dev tool or search the web, and finally try to fix it. When doing so, start with a single error message. When that is fixed, recompile and fix the next error.

If you stuck with a specific error message, you may ask a new question here. When doing so, cite the complete single error message, copy the corresponding code lines and state also that you are using the C++ builder.

If the question is related to the downloaded files (e.g. which libraries are required, what does this function), you should ask in the article forum.

Don't post this under Quick Answers - if you got the code from an article, then there is a "new message" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.
   
You have to be sure that:
  • You have built the library (in order to generate the referenced symbols).
  • The linker is able to find it (assuming you are using Visual Studio, you have to both add the library as linker input file and add the libray's path to VC directories).
   
Comments
raniam 17-Mar-14 6:07am
   
thank you for replying, but this is my first time to use a code from another vendor.
how can i build the library? since the package does not contain any *.Lib or *.Dll files!

And i'm using C++ Builder XE3 (not VC++)
Regards.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900