473,227 Members | 1,469 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,227 software developers and data experts.

link error problem because of decorated names

Hello!

I've a link error problem problem with VS .NET 2003.
I give you the complete description of a simple test (to simplify) :

First, I make a WIN32 static library supporting MFC and using precompiled
header. It contains :

*****
testlib.h:
#pragma once
class CTestLib
{
public:
CTestLib(void){}
~CTestLib(void){}

int gettruc(wchar_t const * truc);
int gettrucbis(int truc);
};

****
testlib.cpp:
#include "StdAfx.h"
#include ".\testlib.h"
int CTestLib::gettruc(wchar_t const * truc)
{
return 0;
}
int CTestLib::gettrucbis(int truc)
{
return truc;
}

This project compiles and links.
In second time, I naturally want to use my static library... In fact, I need
it in a DLL. So my second project is a DLL MFC (normal dll using a MFC
shared DLL). I have a function which uses the object of my library :

****
test.h:
void coucou(LPVOID t);

****
test.cpp:
#include "stdafx.h"
#include "test.h"
#include "..\lib\testlib.h"
void coucou(LPVOID t)
{
CTestLib ti;
int i = ti.gettruc(NULL);
int i2 = ti.gettrucbis(2);
}

And I include the previous .lib file in the project options.
This project compile but does not link on ly for "gettruc" function:
"Création de la bibliothèque Debug/dll.lib et de l'objet Debug/dll.exp
test.obj : error LNK2019: symbole externe non résolu "public: int __thiscall
CTestLib::gettruc(wchar_t const *)" (?gettruc@CTestLib@@QAEHPB_W@Z)
référencé dans la fonction "void __cdecl coucou(void *)"
(?coucou@@YAXPAX@Z)"

So it is surprising that with a int parameter, it works, but not with a
wchar_t parameter. And I have the same problem with other parameter :
LPCWSTR, CAtlStringW, CAtlArray, etc.

I noticed that the decorated name in the .lib generated in the first project
are not exactly the same that those generated in the second project to link
with the library. So It's normal that it doesn't link. But I don't know why
and how to cure this problem.

Thanks for your help !!!!!!

Jul 21 '05 #1
0 998

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

Similar topics

4
by: Jason Rowland | last post by:
I created a .NET assembly and made it accessable as a COM object. When I tried to instantiate it in an ASP page, I got error '80131509'. If I create the COM object in a simple HTML page it works...
3
by: joseluismarchetti | last post by:
Hello everybody, Although I am sure this is an important question for this group, I am not sure this question belongs to this group and I will be happy to move it to the correct one after you...
0
by: Martin Aliger | last post by:
Hi all, is there any way how to access type which is decorated with mine attribute within that attribute? E.g. public class Whatever {
9
by: Peter Oliphant | last post by:
For some reson my code is generating a LNK1215 error, which 'suggests' I re-install VS C++. So I did. which did NOT solve the problem. The weid part is it seems to be caused by my one CPP file, but...
0
by: david | last post by:
Hello! I've a link error problem problem with VS .NET 2003. I give you the complete description of a simple test (to simplify) : First, I make a WIN32 static library supporting MFC and using...
14
by: hgraham | last post by:
Hi, I'm trying to understand how to work the dom, and all I'm trying to do is insert a link right before another link in the html based on it's href value. This isn't a real world example - I'm...
4
by: sbowman | last post by:
I'm linking a bunch of tables that are in SQL to my Access db and I get the following error on 3 of the tables: "Seq.Group is not a valid name." I tried doing an import instead of a link, but I got...
7
by: ApexData | last post by:
Hello I currently Link the FE/BE using the LinkTables Option and the Linked Table Manager. Any time I need to move the BE to another location, I have to go through this process over again. I...
38
by: ted | last post by:
I have an old link that was widely distributed. I would now like to put a link on that old page that will go to a new page without displaying anything.
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
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: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.