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

lnk2005 issue with nafxcw.lib and libc.lib

I've been reading other groups related to this error and I'm only
getting more confused. I'm still quite new to MC++ and I could use a
swift kick in the right direction. The application I'm developing is a
mixed mode Managed wrapper dll.

I have written a class to encapsulate the unmanaged code.

I have also created a managed wrapper class that uses the unmanaged
class

I've been reading a lot concerning a stackoverflowexception, so I have
the /INCLUDE:DLLetc and the /NODEFAULTLIB:nochkclr.obj on purpose. The
project compiles clean but I get these link errors:

nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator
new(unsigned int)" (??2@YAPAXI@Z) already defined in libc.lib(new.obj)
D:\libprt\Debug\libxxx.dll : fatal error LNK1169: one or more multiply
defined symbols found
NMAKE : fatal error U1077: 'link' : return code '0x491'
Stop.

I am compiling everything via nmake on the command line because the
project wouldn't remove the /FU mscorlib from my unmanaged .cpp file.

I'm not sure what else to say regarding this. I'm just lost at this
point and I need some guidance as to how to change my command line to
include the right library versions to get rid of my linker errors. If
you see any other issues with my code please feel free to comment.

Thanks for the help

Jason
These are the includes for my unmanaged class

//added because of http://support.microsoft.com/?kbid=814472
#include "stdafx.h"
#include <afx.h>
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "_vcclrit.h"

//includes for poprietary code
#include "inc_path\xx.h"
#include "inc_path\xxx.h"
#include "inc_path\xxx.h"
#include "inc_path\xxxx.h"
#include "inc_path\xxxxx.h"

These are the includes for my managed class

//added because of http://support.microsoft.com/?kbid=814472
#include "stdafx.h"
#include "unmanaged class header.h"
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "_vcclrit.h"

these are my linker options:

/NOENTRY /NODEFAULTLIB:"libcmt.lib nochkclr.obj"
/INCLUDE:__DllMainCRTStartup@12 /OUT:"D:\libxxx\Debug\libxxx.dll"
/INCREMENTAL /NOLOGO /LIBPATH:"D:\libxxx\lib" /DLL /FIXED:No libc.lib
libc.lib nafxcw.lib mscoree.lib msvcrt.lib proprietary.lib
"d:\libxxx\xxx.obj" "d:\libxxx\xxxx.obj"

Nov 17 '05 #1
0 2743

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

Similar topics

0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
1
by: Florian Liefers | last post by:
"Hello World\n", i have the following problem: One of my headerfiles for a lib is including <vector>. When i compile the lib, everything is done well. In my application another file is...
1
by: arkam | last post by:
Hi, Here are my link errors : atlsd.lib(ATLComTime.obj) : error LNK2005: "public: __thiscall ATL::COleDateTime::COleDateTime(struct tagVARIANT const &)"...
2
by: bosse | last post by:
Hi, i have got a linker problem, i don't know how to handle; there are three projects in my workspace. In the Project called modules_common is a class called Features. In the second project...
0
by: Taran | last post by:
Hi all, I have this config.h file which has all the declarations for the vars being used in the application. There are no compilation errors but link errors for all the vars declared in this...
1
by: sethuganesh | last post by:
HI, i have ported vc++ 6.0 code to visual studio 2005. During batch build in debug mode i din't get any error.But if i build the same in release mode i am getting the following error. ...
1
by: dewi | last post by:
Dear All, I am trying to compile a C code using Visual C++. Can anyone explain how to solve it? Thank You. #include <math.h> #include <string.h> #include "RV2AJFRONT_NEW.h" #include...
9
by: dewi | last post by:
Dear All, I have several problem about VC++. I succeed to convert Simulink MATLAB to C code using Real-Time Workshop. I am trying to compile a C code using Visual C++ and found the error. Can...
5
by: reachanil | last post by:
Hi, We've interposed malloc/calloc/realloc/memalign/valloc in our application. While all of our application calls our own implementation of these functions, there seems to be some issue with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.