473,326 Members | 2,182 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.

Linkage Issue in VC7 (2003) with VC6 Libraries

The Libraries that I am linking with are compiled in Visual 6.0. I have
an exported CEPAttribute with the function
CEPAttribute::GetLineStyle(CString &_strValue). The project that I am
compiling in VC7 (2003) uses the CEPAttribute but doesn't call the
::GetLineStyle(CString) function.

When it links I get the following error:

error LNK2001: unresolved external symbol "public: virtual int
__thiscall CEPAttribute::GetLineStyle(class ATL::CStringT<char,class
StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char &)const "
(?GetLineStyle@CEPAttribute@@UBEHAAV?$CStringT@DV? $StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z )

Any ideas what the work around would be?
Jim

Jul 7 '06 #1
1 1140

ji************@eaglepoint.com wrote:
When it links I get the following error:

error LNK2001: unresolved external symbol "public: virtual int
__thiscall CEPAttribute::GetLineStyle(class ATL::CStringT<char,class
StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char &)const "
(?GetLineStyle@CEPAttribute@@UBEHAAV?$CStringT@DV? $StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z )
Typically C++ compiled modules are not binary compatible among different
compilers. There's nothing you can do about that, your compilers are not
compatible. If you plan to export C++ classes, you must ensure that all
DLLs and the EXE are compiled with the exact same version of the
compiler, using the same compiler settings.
Any ideas what the work around would be?
1. Use the same compiler for all modules, and the dynamic version of the
RTL.
or
2. Export extern "C" functions with no C++ features in their argument list.
or
3. Make a very thin interface (abstract) class that's linked to both the
DLL and the EXE. Put the implementation (inheriting from the interface)
to the DLL, but only export 2 pure C functions that create and delete
your objects. Use virtual function calls to bind the interface to the
implementation. If done carefully, this can work across different
compilers. You must remember that the DLL and the EXE have their own
copy of C RTL (included their separate memory managers).
or
4. Use ActiveX/COM, which provides a portable (cross-compiler and
cross-language) interfacing solution.

Tom
Jul 7 '06 #2

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

Similar topics

5
by: Web Developer | last post by:
Hi, I read that identifiers should not start with an underscore in order to prevent LINKAGE problems. I am not familar with this concept of "linkage", so can someone provide a simple...
9
by: qazmlp | last post by:
const has internal linkage in C++, but external linkage in C. Am I right ? But, linker reports multiply-defined error if the following header is included in multiple .cpp files. //...
4
by: Nimmi Srivastav | last post by:
Once and for all can someone kindly tell me the difference between C and C++ linkage. I thought I understood it till someone showed me the other day that C functions, that would ordinarily require...
3
by: Kuznetsov Dmitriy | last post by:
В проекте в двух разных .cpp файлах определены одинаковые функции, например: void foo () { return; } В третьем .cpp файле есть объявление и вызов 'foo' кто-нибудь знает, существует ли...
47
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
7
by: Generic Usenet Account | last post by:
I am implementing a library that can be linked in with C as well as C++ code. Obviously, the library API is functional, but in my implementation I am using STL. Because of this, my code is...
11
by: scorpion53061 | last post by:
in my head...... I need my application to work with Office 97, 2000, XP and 2003 versions of MS Word and MS Excel. IN order to acomplish this I have to install in different folders: 1....
12
by: Bit byte | last post by:
I have an application written in C (actually PostgreSQL). The application appears to have been built using the Mingw set of tools (mingw compiler tools). I want to write an extension library...
13
by: treble54 | last post by:
I need to build PHP from source with the pdo_ibm extension and I am having an issue with it. Firstly, I am using Visual Studio .NET 2003 and I am building PHP from source through the Visual Studio...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: 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....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.