declspec

A

Abousaid

Bonjour,
Dans un petit programme en C sous Windows, je veux utiliser une
fonction écrite en C (Ouverture_Fic )pour ouvrir un fichier.

Ouverture_Fic ("Nom fic");

Quand je compile , j'ai l'erreur suivante :
prog.o(.text+0x1cf):prog.c: undefined reference to `Ouverture_Fic`

Voilà les references dont je dispose :

dans un fichier.h, ma fonction est déclarée comme suit :
SIC_IN unsigned long SOPE Ouverture_Fic(const char* const nomFic)

Dans un autre fichier.h j'ai ceci :

#ifdef SIC_IN
#undef SIC_IN
#endif
#ifdef SOPE
#undef SOPE
#endif
#ifdef _WINDOWS
#ifdef SOAD_EXPORTS
#define SIC_IN __declspec( dllexport )
#else
#define SIC_IN __declspec( dllimport )
#endif
#define SOPE __stdcall

#else
#define SIC_IN
#define SOPE
#endif

Merci beaucoup
 
R

Russell Hanneken

Abousaid said:
Dans un petit programme en C sous Windows, je veux utiliser une
fonction écrite en C (Ouverture_Fic )pour ouvrir un fichier.

Ouverture_Fic ("Nom fic");

Quand je compile , j'ai l'erreur suivante :
prog.o(.text+0x1cf):prog.c: undefined reference to `Ouverture_Fic`

Voilà les references dont je dispose :

dans un fichier.h, ma fonction est déclarée comme suit :
SIC_IN unsigned long SOPE Ouverture_Fic(const char* const nomFic)
[ Windows-specific code omitted.]

You should post your question to


comp.lang.c++ is for discussion related to ISO C++. See the welcome
message:

http://www.slack.net/~shiva/welcome.txt

Also, there are probably only a few people here who know French. (I barely
understand it well enough to make sense of your message. I hope you can
make sense of my English.)

Bonne chance,

Russell Hanneken
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top