Thread: #pragma ?

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    28

    #pragma ?

    Can anyone tell me what #pragma does? I'm trying to write DLL's and I see examples using the line:

    Code:
    #pragma comment(lib, "theDLL.lib")
    I know that if u include that line u can call functions from the dll file, but then i see some examples do this:

    Code:
    extern "C" __declspec(dllimport) void fuction_name( ); 
    void funtion_name();
    Can someone tell me the details of what is happening?

    THX!

    Dat
    Dat
    http://hoteden.com <-- not an porn site damnit!

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    My book says #pragma is specifically for implementation defined options, so its affect will be described in your compiler documentation, and any #pragma directive that isn't recognized by the compiler will be ignored.

    Declaring a variable as extern implies that it is defined somewhere outside the present scope.

    As far as the details of the code you posted, I have no idea.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Here is the reference for all the MSVC pragma's.
    Enjoy.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. labels inside the code #pragma mark label
    By nacho4d in forum C++ Programming
    Replies: 6
    Last Post: 01-11-2009, 02:50 AM
  2. #pragma pack(push,bitmap_data,1) ?
    By te5la in forum C++ Programming
    Replies: 3
    Last Post: 10-07-2008, 03:38 PM
  3. Programming a PIC 16F84 microcontroller in C
    By Iahim in forum C Programming
    Replies: 1
    Last Post: 05-13-2004, 02:23 PM
  4. what does #pragma do?
    By cbc in forum C++ Programming
    Replies: 2
    Last Post: 10-16-2003, 06:51 AM
  5. what is a pragma comment?
    By Shadow12345 in forum C++ Programming
    Replies: 9
    Last Post: 11-25-2002, 05:50 AM