VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: [1] ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 08:14:13 10/18/01 Thu
Author: Marcel Pursche
Subject: DLL erstellen

Hallo,
Ich versuche seit ein paar Tagen mit Dev-C++ eine DLL zuerstellen. Zum üben habe ich volgenden Quellcode erstellt.

MainDll.cpp
-----------

#include "C:\Dev-C++\FastX\MainDll.h"
#include
#include

/* Externs */
DllClass DLLIMPORT global_dllclass1 (1);
DllClass DLLIMPORT global_dllclass2 (2);
int DLLIMPORT global_int_variable = 5;

int DllClass::instances;

DllClass::DllClass (int i) : i_(i) { ++instances; }
DllClass::~DllClass () { --instances; }

void DllClass::virtual_method ()
{
printf("Hello from virtual method :-)\n\n");
}

void DllClass::non_virtual_method ()
{
printf("Hello from non-virtual method ;-)\n\n");
}

float HOCH(float basis, unsigned int exponent) {
float temp=1;
unsigned int i;
for (i=0; i return temp;
}

DllClass DLLIMPORT potenz;

BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason,
LPVOID reserved /* Not used. */ );

/* DllMain Results:
TRUE on success, FALSE on failure. */

BOOL APIENTRY
DllMain (
HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{

switch (reason)
{
case DLL_PROCESS_ATTACH:
break;

case DLL_PROCESS_DETACH:
break;

case DLL_THREAD_ATTACH:
break;

case DLL_THREAD_DETACH:
break;
}
return TRUE;

Dll.def
-------

LIBARY "Test.dll"
DESCRIPTION 'Test-DLL'
EXETYPE WINDOWS
EXPORTS
HOCH

Beim linken kommt aber die Fehlermeldung:
gcc: c:\dev-c++\fastx\dll.def: linker input file unused since linking not done

Was mache ich falsch?

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:


[ Contact Forum Admin ]


Forum timezone: GMT-8
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.