473,406 Members | 2,707 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,406 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 1003

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.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.