473,326 Members | 2,023 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,326 software developers and data experts.

[Linker Error] Unresolved external 'function_name... using assemby code

6
Hello!
i´m trying to run a project in c++ Builder (windos) that uses assembly code.
i assembly the code with ml.exe, then i have a .obj
i add this .obj to the project

then in a .cpp i write

Expand|Select|Wrap|Line Numbers
  1. extern estados(char *, char *, char *, int, int)
  2.  
and then i try to call this function just as my teachers teach me to do
and appears that:
[Linker Error] Unresolved external 'estados(char *, char *, char *, int, int)' referenced from C:\REDE\MAINUNIT.OBJ

it's the first time i use assembly soutines in c++ so i don't really know what to do, but this is what a saw in every places i looked for.
i think it could be a compiler option that i don't know or something like that.

Thanks
Jun 12 '07 #1
4 1739
I know that when using normal C++ and header files, getting that error would indicate that the file just doesn't see the source .cpp file
So just include that
#include "file.cpp"
Jun 12 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
This is not correct:

know that when using normal C++ and header files, getting that error would indicate that the file just doesn't see the source .cpp file
So just include that
#include "file.cpp"
You do not #include source files. If a program has multiple source files and you #include "file.cpp" in each file you will die in the link with redefinition errors.

What you should do is put the function prototype in the first source file and add the second source file to the build. If you are using a tool with projects, this means adding the second source file to the project.

You can put the function prototype in the header file and then #include the header file. This helps where many source files need that function prototytpe.
Jun 13 '07 #3
timon
6
thanks for the replies.
But the problem is that there's no .cpp file with the implementation of the function. The function is implemented in a .asm file. Then i assembly the code to obtain a .obj.
I have solved the problem jet by making a C project and without making changes in the code at all, but i want to use C++.
if anyone knows hot to do that in another compiler could help me to.
i may should start another discussion
Jun 13 '07 #4
weaknessforcats
9,208 Expert Mod 8TB
How have you added the .obj of the .asm file to your C project??

The same should work for your C++ project.

Most of these tools allow files in projects to be a mixture of .c and .cpp. The .c files are compiled using C and the .cpp files compiled using C++.

That is, a C++ project ddoes not need all the source files to be .cpp files.
Jun 14 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: KS | last post by:
I am getting linker error for a code that was tested and running. I opened the project in VS.NET 2003 and now i get these errors - I am sure it is some options issue. Can anyone please help? ...
1
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a...
1
by: endo55 | last post by:
Hi I've got the following errors when trying to compile a program cvision error LNK2001: unresolved external symbol _IID_IGraphBuilde cvision error LNK2001: unresolved external symbo...
4
by: Joel Whitehouse | last post by:
Hello All, I have a Visual C++ 2003 dll solution in a directory called "Antenna Test Range Control", and when I comile it, I get the error LNK1104: cannot open file "antenna.obj". When I remove...
3
by: Chucker | last post by:
Hi Folks, I got a Wrapper Dll around a native C++ static library. In .NET 1.1 this worked fine. When moving to .NET 2.0 I get a couple of unresolved externals / linker errors: Error 16 error...
1
by: developer | last post by:
Hi All I have made a .NET project. the files included are borland c++ files that i am migrate to VC++ .NET I am using Microsoft Visual C++ .NET 2003. the compilation goes through properly,...
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,...
1
by: iiitsunny | last post by:
i have ported one project which was working in VC6 to VC7. Now the project is working fine in VC7 also. I have made some additions in VC7 environment only. But the problem is that the project is not...
1
by: Deepath G | last post by:
This is deepath.. I am getting some linker error when i am trying to connect Websphere MQ using Borland C++ Builder 2006 using imqi.hpp on windows. Error Message ----------------------- ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.