#pragma ?

This is a discussion on #pragma ? within the C++ Programming forums, part of the General Programming Boards category; Can anyone tell me what #pragma does? I'm trying to write DLL's and I see examples using the line: Code: ...

  1. #1
    dat
    dat is offline
    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,662
    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,701
    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, 04:38 PM
  3. Programming a PIC 16F84 microcontroller in C
    By Iahim in forum C Programming
    Replies: 1
    Last Post: 05-13-2004, 03:23 PM
  4. what does #pragma do?
    By cbc in forum C++ Programming
    Replies: 2
    Last Post: 10-16-2003, 07:51 AM
  5. what is a pragma comment?
    By Shadow12345 in forum C++ Programming
    Replies: 9
    Last Post: 11-25-2002, 05:50 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21