[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

add working uncompiled dll to project?

Posted on 2004-10-04
3
Medium Priority
?
261 Views
Last Modified: 2010-04-24
hi all,

first off: NEWB ALERT!!!!  i don't know much about c++.

I have a managed c++ libary that works great.   The way I compile it is with vs command prompt with a makefile.   This libary consists of a single c++ file that compiles into a dll.   I would like the file to compile with my entire solution, a mix of c, and vb.net projects, instead of it being a separate referenced dll.  I am not the author of the file.

I have tried adding it into it's own c++ class project with in my solution, but I can't get it to compile.   There are several errors.   Pretty much what I did was try to create a blank C++ project, add the file, and compile it.   I also used the wizards blank c++ class library, but still no luck.

How can I create a project in my solution that i can just copy the contents of this already working code?

here is the working makefile that I'm using currently with vs.net command prompt using nmake:

all:            AfSecu.dll
AfS.dll: src\AfS.cpp
cl /nologo /clr /LD  src\AfS.cpp  /link /nodefaultlib /noentry  mscoree.lib nochkclr.obj
del AfS.obj

If this is a super newbie question, forgive me :/

thx in advance.
0
Comment
Question by:OnlineNoob
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 19

Expert Comment

by:drichards
ID: 12223764
What kind of errors do you get?  You should be able to add a new .NET Class Library C++ project and replace the generated cpp file with your existing one.  There will be some additional options used by default, but all the basic options you are using will be the defaults.

Are you using the correct project type?
0
 
LVL 1

Author Comment

by:OnlineNoob
ID: 12223823
Ok, I added a new class project to my solution like before and used the nameofproject.cpp file that is created.  The file comes prebuilt with two includes, some stdafx.h and name of myProject.h.  If I comment out the includes, and append the working code to that default cpp file, then I get this error:

"fatal error C1010: unexpected end of file while looking for precompiled header directive."

If I uncomment out those 2 include files and try to compile, I get 5 errors:

4 of the errors are:
warning C4018: '>=' : signed/unsigned mismatch
and the other error in that group is:
warning LNK4099: PDB 'libc.pdb' was not found with 'C:\vsnetPath\vc7\lib\nochkclr.obj' or at 'C:\myProjectPath\Debug\libc.pdb'; linking object as if no debug info.

The makefile which I use to compile the dll before does mention the files listed in the error code.   All I do is open up the location of the makefile in my vs.net console, and type nmake and it makes the dll without errors, and I use the dll without errors.
0
 
LVL 19

Accepted Solution

by:
drichards earned 2000 total points
ID: 12228585
You can comment out the '#include  "stdafx.h"' line, but you'll have to go into the properties for that file (right click on file in SOlution Explorer and seect "Properties") and choose "Not Using Precompiled Headers" on the Precompiled Headers page "Create/Use Precompiled Header" line.  If you use precompiled headers, stdafx.h must be included in your source files.  The signed/unsigned mismatch was always there and can be either ignored or fixed.  I'm not exactly sure why you get the linker warning, but it shouldn't affect your executable.  It can't find the program database (used for debugging) for libc.

You can look in the linker properties for the project and go to the Input page and see if "Ignore All Default Libraries" is set to No.  If so, select /NODEFAULTLIB to match your makefile settings. That may get rid of the warning.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question