Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 09-01-2009
Avatar de rastafarey
rastafarey rastafarey is offline
Miembro
 
Registrado: nov 2003
Posts: 927
Poder: 21
rastafarey Va por buen camino
$L .Obj no funciona

problemas para linkear un obj c++ a delphi 2007

Aqui el que produce el archivo c_obj.obj escrito y compliado en c++

c_obj.cpp
Código PHP:
extern "C" int _stdcall suma(int aint b);

int _stdcall suma(int aint b) { return (b); } 
Unidad.pas
Código Delphi [-]
unit Unidad;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm2 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

{$L c_obj.obj}

Function suma(a, b: integer): Integer; StdCall; external;

procedure TForm2.Button1Click(Sender: TObject);
begin
  Caption := IntToStr(Suma(1, 2));
end;

end.

he aqui el error
[Pascal Error] Unidad.pas(28): E2065 Unsatisfied forward or external declaration: 'suma'

Alquien sabe por que este codigo no funciona si deberiaf uncionar.

Aqui es un link a la misma pagiana de codegear jemplo donde hay un ejemplo que no funciona.
__________________
Todo se puede, que no exista la tecnología aun, es otra cosa.
Responder Con Cita
  #2  
Antiguo 09-01-2009
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Poder: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Creo que la declaración de la función ha de estar en la cláusula "interface", y no en la cláusula "implementation". ¿No será por eso?
__________________
David Esperalta
www.decsoftutils.com
Responder Con Cita
  #3  
Antiguo 09-01-2009
Avatar de Al González
[Al González] Al González is offline
In .pas since 1991
 
Registrado: may 2003
Posts: 5.604
Poder: 29
Al González Es un diamante en brutoAl González Es un diamante en brutoAl González Es un diamante en brutoAl González Es un diamante en bruto
¡Hola!

Encontré esto con Find in Files en Delphi 7, tal vez te sea de ayuda.

Código Delphi [-]
unit IdCompressionIntercept;

{  This file implements an Indy intercept component that compresses a data
   stream using the open-source zlib compression library.  In order for this
   file to compile on Windows, the follow .obj files *must* be provided as
   delivered with this file:

   deflate.obj
  ...
}
{
You may sometimes get the following compiler errors with this file:

...
IdCompressionIntercept.pas(152) Error: Unsatisfied forward or external declaration: '_tr_init'
IdCompressionIntercept.pas(153) Error: Unsatisfied forward or external declaration: '_tr_tally'
...

Do not be alarmed.  This is due to a bug in DCC32 in Delphi 4, 5, 6, plus C++Builder, 4, 5, and 6.

There is a workaround for this issue.  The workaround is to compile this unit separately from the other units and than build
Indy with a command such as DCC32 using the /M parameter.  DO not use the /B parameter as that does force everything
to be recompiled triggering the DCC32 error.

The batch files FULLC4.BAT, FULLC5.BAT, FULLC6.BAT, FULLD4.BAT, FULLD5.BAT and FULLD6.BAT now have the workaround in them so
we recommend that you use those to build Indy.

Borland is aware of the issue.
}

Es probable que haya un reporte al respecto en QualityCentral.

Saludos.

Al.

Última edición por Al González fecha: 09-01-2009 a las 19:53:06.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
No funciona PHP silviodp PHP 6 07-06-2008 21:51:29
¿Así funciona el BETWEEN? Faust Firebird e Interbase 4 13-05-2008 01:58:40
No me funciona TRY - EXCEPT - END leanfreue OOP 13 14-04-2007 18:08:38
IIS no funciona YaninaGenia .NET 2 26-07-2006 14:21:59
BDE, no funciona martita Conexión con bases de datos 4 26-05-2006 22:21:12


La franja horaria es GMT +2. Ahora son las 05:06:59.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi