Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

Lazarus(free pascal compiler) i dll napisan u c jeziku na Windows platformi

  • 3 odgovora
  • 3.905 pregleda

Najnovija ↓

Lazarus(free pascal compiler) i dll napisan u c jeziku na Windows platformi 07.03.2007. u 18:03 · pre 239 meseci #1
ovo je sa Lazarus - foruma.

Citat:

I wrote a pascal unit to use a c dll.
and I used this to create two test programs, one in delphi 7 and the other in lazarus, both running under windows

The delphi version run without any problem.

the lazarus version, after the first call to a dll function give me a sigsegv error. I think there could be a stack corruption.

But wy the same is working good with delphi?

Wath must I do to cacth and fix the problem?

Thanns, angman


ovo sam ja napisao:
Citat:

I can tell you about the stuff people on www.elitesecurity.org were talking about>
If you use a Borland C++ or VC++ library (dll or just lib) it WILL work with delphi, but
in many cases not with gcc or other free compilers and I am almost sure because of a stack corruption.
This happens especially when you are passing a vector to a function in dll, so maybe it should be done
by just passing pointers around, but there could be a problem because in some cases you need to have
a class declaration to be able to work with that type of pointer. This is avoidable via smart pointers in c++,
but it can cause confusion.

How does this help you? It probably doesn't but you should know that these stuff happen to other people aswell, so maybe you should ask some c++ developers about it...

SambucusELF


moze li neko malo vise da pomogne???

link ka strani je ovde: [link]http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=viewtopic&p=16122#16122[/link] - tu se nalazi i code o kome se radi.
Potpis
Sve se menja.
Promena je stanje koje je konstanto. ??? Ups, kako to?

http://blender-srbija.forummotion.com/
Re: Lazarus(free pascal compiler) i dll napisan u c jeziku na Windows platformi 07.03.2007. u 18:35 · pre 239 meseci #2
> If you use a Borland C++ or VC++ library (dll or just lib) it WILL work with delphi, but
> in many cases not with gcc or other free compilers and I am almost sure because of a stack corruption.

To što je neki compiler free ne znači da je loš, da postoje tako krupni problemi oni bi do sada bili otkriveni i ispravljeni. Najpre treba proveriti da i funkcije u dllu i u programu koriste istu calling konvenciju. Ako dolazi do manipulacije sa memorijom u dllu ili programu proveriti kako se to radi, videti uputstvo za dll.
Potpis
Do not be a help vampire (http://slash7.com/pages/vampires), use the google.

How to ask questions the smart way:
http://www.catb.org/~esr/faqs/smart-questions.html
http://solair.eunet.rs/~fangor...stions/smart-questions.sr.html
Re: Lazarus(free pascal compiler) i dll napisan u c jeziku na Windows platformi 08.03.2007. u 09:16 · pre 239 meseci #3
potpuno se slazem, ja licno koristim gcc/c++ u okviru Dev-C++ paketa i 100% sam zadovoljan.

inace, (sad nemam vremena, ali) radim u linux-u i cenim sve sto GPL nudi, takodje se trudeci da i sam tome doprinesem, koliko je u mojoj skromnoj moci.

cinjenica je da je bilo problema oko linkovanja biblioteka izmedju gcc (i slicnih) kompajera sa proprietary kompajlerima.

sto se tice calling convention - nesto su pricali o tome,nisam imao vremene da ulazim dublje u temu, a i source se nalazi na linku koji sam dao u prethodnom postu.

moje pitanje je bilo usmereno (na ovom forumu) ka Lazarus/Delphi/Kylix programerima koji su se mogli sresti sa ovakvim provblemom kod linkovanja VC++ dll-ova.

pitanje i dalje stoji. moze li neko da kaze vise, pa da to citiram na lazarus.freepascal.org ?

SambucusELF

P.S. ovo Elf jeste kao vilenjak, ali je ELF nesto sto ce korisnicima linux-a biti poznato... :D


Potpis
Sve se menja.
Promena je stanje koje je konstanto. ??? Ups, kako to?

http://blender-srbija.forummotion.com/
Re: Lazarus(free pascal compiler) i dll napisan u c jeziku na Windows platformi 08.03.2007. u 11:23 · pre 239 meseci #4
> sto se tice calling convention - nesto su pricali o tome,nisam imao vremene da ulazim dublje u temu, a i source se nalazi na linku koji sam dao
> u prethodnom postu.

Tamo je samo dat pascal source ne i originalni od C dlla.

> moje pitanje je bilo usmereno (na ovom forumu) ka Lazarus/Delphi/Kylix programerima koji su se mogli sresti sa ovakvim provblemom kod
> linkovanja VC++ dll-ova.

Vidim da kaže da je nešto ispravljao u svom kodu pa sada radi, dakle problem nije ni bio do kompajlera već pogrešnog prepeva ili upotrebe.
Potpis
Do not be a help vampire (http://slash7.com/pages/vampires), use the google.

How to ask questions the smart way:
http://www.catb.org/~esr/faqs/smart-questions.html
http://solair.eunet.rs/~fangor...stions/smart-questions.sr.html
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme