[so] compilare tema4 windows

Razvan Deaconescu razvand at cs.pub.ro
Sun May 25 12:28:26 EEST 2008


On Sun, 2008-05-25 at 12:14 +0300, Andrei Stefanescu wrote:
> Am comentat clauzele de extern "C" si s-a compilat, cel putin
> momentan:) Atasez si makefile, tot raman curios dece apareau erorile
> acelea:

Ntz ntz ntz. Acele clauze se pun in fata functiilor C care sunt folosite
in programe C++. Tu le definisei tot in programe C++ (Monitor.cpp,
RW.cpp) si nu avea nici un sens folosirea clauzei extern "C".

Altfel spus:
* am fisierul anaconda.c, anaconda.h
* folosesc functiile exportate din anaconda.c in piton.cpp
* antetele functiilor din anaconda.h vor fi prefixate de clauza extern
"C"

Acelasi lucru e valabil cand folosesti functii exportate _dintr-un_
fisier C++ _intr-un_ fisier C.

Daca insa:
* am fisierul anaconda.cpp, anaconda.h
* folosesc functiile exportate din anaconda.cpp in piton.cpp
* antetele functiilor din anaconda.h NU vor fi prefixate de clauza
extern "C" (nu are sens pentru ca sunt toate fisiere .cpp)

Mai multe detalii aici[1].

> CPPFLAGS = /nologo /W2 /EHsc
> CC = cl
> 
> build: Monitor.obj RW.obj
>     link /release /dll /out:LibMonitor.dll  Monitor.obj
> ControlMonitor.obj
>     link /release /dll /out:LibRW.dll RW.obj  ControlRW.obj
> LibMonitor.lib
>     
> Monitor.obj: Monitor.cpp Monitor.h
>     $(CC) $(CPPFLAGS) /c Monitor.cpp
> 
> RW.obj: RW.cpp RW.h
>     $(CC) $(CPPFLAGS) /c RW.cpp
> 
> clean :
>         del *.obj libvm.dll *.lib *.dat *.exe

Makefile-ul pare OK.

Razvan

[1] http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the so mailing list