473,406 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

declspec

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
Jul 19 '05 #1
1 4171
"Abousaid" <bs*****@free.Fr> wrote in message
news:69**************************@posting.google.c om...
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

news:fr.comp.os.ms-windows.programmation

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
rh*******@pobox.com
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: cipher | last post by:
I have created a C++ MFC dialog based appliction with .NET 2003. I am trying to use a functioning MFC extension dll. There is a header file for this dll that defines a template class. .NET...
5
by: Robert A Riedel | last post by:
I have a class that is intended to be exported in a DLL that uses another class that is in a static library. All clients that use the DLL will also link with the same static library. In summary,...
6
by: WXS | last post by:
In VS2003 using /clr meant that you could not use declspec import/export to import or export methods from a .dll so they could be used externally thus requiring you to wrap a class using managed...
7
by: Wanjun Yu | last post by:
I have just loaded my VC++6 projects in Visual Studio 2003. It converted the project files just fine. I have a MFC dll that links against a WIN32 dll. In the WIN32 dll, I have exported some...
6
by: Pucca | last post by:
Hi, I have a few C BER coding that I would like to compile into a C++ Class library project and then use it in my C# windows application. Can I do that from C# using pinvoke? If not then does...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
14
by: shuisheng | last post by:
Dear All, I want to start a c++ software project. It is used to simulate the propagation of sound waves in complex media. It may contain 4 parts: GUI, preprocession, simulation and...
3
by: 2b|!2b==? | last post by:
I have a C++ library partitioned by namespaces. I want to export some of the functions in one of the namespace - how do I do it. Assuming I have the macro MYAPI_EXPORTS #defined to be a declspec...
15
by: Grey Alien | last post by:
I have a class that contains a std::map variable. I need to export the class via a DLL. the class looks something like this: class MyClass { public: MyClass(); MyClass(const MyClass&); ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.