Solved

make DLL

Posted on 1997-09-17
9
440 Views
Last Modified: 2011-10-03
Little help needed.
Using  C++ 40  Win NT
Failure to build DLL file
----
#include <windows.h>
#include <ole2.h>
#include <sql.h>
#include <sqlext.h>

#ifdef _WIN32
  #define CCONV _stdcall
  #define NOMANGLE
#else
  #define CCONV FAR PASCAL _export
  #define NOMANGLE EXTERN_C
  #include <stdlib.h>
  #include <compobj.h>    
  #include <dispatch.h>
  #include <variant.h>
  #include <olenls.h>  
#endif

NOMANGLE LONG CCONV PassByte ()
{
RETCODE rs;
HENV henv;
rs=SQLAllocEnv(&henv);
rs=SQLFreeEnv(henv);
return      rs;
}
-----------------------------def, file
LIBRARY vb4dll

CODE      PRELOAD MOVEABLE DISCARDABLE
DATA      PRELOAD MOVEABLE

EXPORTS
      PassByte      @1
-----------
Error message LNK1141
Failure durning bulild of export file

Please give a clue.

mativare@i-2000.com
Please make corrections to code and post , then every
beginner(like me) can see it on a net.
Matt
0
Comment
Question by:mativare
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 3

Expert Comment

by:msmits
ID: 1254830
Is the file a .c file or a .cpp. When .cpp you must use:

extern "C" {
...
}

or just use a .c file.
This will disable the name mangling so the linker can find the right function.

0
 
LVL 1

Author Comment

by:mativare
ID: 1254831
filenames were  vb4dll.c
and vb4dll.def
Unfortunately question remains unanswered.
Thanks  for a attempt.
Matthew
0
 
LVL 3

Expert Comment

by:msmits
ID: 1254832
except for the SQL stuff I could generate your DLL fine. I use Borland C++ 5.02 on win95 at the moment.

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 1

Expert Comment

by:navigator010897
ID: 1254833
Um,
you have a real strange problem.

I just compiled your dll, the .cpp and the .def file on MSVC++ 4.0 Standard on Win95 and if compiled flawlessly.  

Perhaps you set up the project wrong, and instead of just a pure dll you set up an app wizard mfc dll?  Or maybe perhaps you didn't do a full install with msvc and are missing some of the header files needed for the ole/sql?
0
 
LVL 1

Author Comment

by:mativare
ID: 1254834
I used "pure dll Option". It compiled too, but building(linking) went wrong
Messages LNK 4044, LNK1181,  LNK1141
Still hoping
Matthew
0
 
LVL 1

Expert Comment

by:navigator010897
ID: 1254835
Are you sure you included all of the database support options when you installed MSVC 4.0?  It seems very odd that you are having this trouble, as I said, I just cut and pasted your code, and it worked flawlessly...
0
 
LVL 1

Expert Comment

by:Seeker092397
ID: 1254836
Along with LNK1181 error must come a name of a file linker could not find. What is it?
0
 
LVL 1

Author Comment

by:mativare
ID: 1254837
fatal error LNK1181: cannot open input file "Files\DevStudio\BIN\link.exe"
Good man you solved it, because my Dev Studio is located in
"Program Files."
Seems I need to do reinstallment of VC++, if you have any other hints
how to "tell" compiler where are files, let me know.
 I know there are files  like
setup .ini and...
Thanks a lot.
Matt
Matthew


0
 
LVL 1

Accepted Solution

by:
Seeker092397 earned 100 total points
ID: 1254838
I am glad I helped You. If You'd be so kind, please transfer me the value of the answer. Thanx.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
In desperate need of help 8 136
How to get time_t value that is a week old 6 168
chcp 65001 File encoding 66 247
sameEnds challenge 3 159
Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

773 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