×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    21

    Codewarrior, libraries and #pragma

    I was trying to programmatically include a library file within my Codewarrior project: i don't wanna include it by selecting a file and adding it via the IDE, i wanna be able to include a library file as soon as a preprocessor directive with "#pragma comment(lib, "mylib.lib")".

    Any chance to get this working?!

    Thank you anyone will respond

  2. #2
    chrisauk0
    Guest
    The mmp files contain the static libraries that are linked with the DLL. You can conditionally include source files and libraries in the MMP file.

    Are you able to provide an example of what it is that you are trying to do?

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    21
    Thank you for replying chrisauk0!

    Well, due to a Nokia error, the "vibractrl.dll" file is missing on a Nokia 6600 v4.09.1- and some other phones, so if you link with the "vibractrl.lib" library, running the generated app will result in a runtime error.
    I wanna be able to build different version of my app and by using a "#pragma" will simplify my life because i would only have a simple preprocessor switch instead of a full Codewarrior project messing.
    I think the gcc toolchain is missing this pragma but it would be usefull to have something like this!

  4. #4
    chrisauk0
    Guest
    Static linking on symbian (and windoze, but not all flavours of UN*X, where the failure occurs when the symbol that is being referenced cannot be loaded) means that when the loader (ie. at run time) tries to load the DLL (in this case your APP), it will fail due to missing libraries.

    I believe what you are trying to achieve is runtime loading, or put simply to load this libarary and call functions therefrom if this library exists.

    Look in the "Dynamically Loading Link Libraries" of the SDK help for how this can be done.

    (Use RLibary Load to load the lib , Lookup() to get a pointer to the function by ordinal that you wish to call)

  5. #5
    Registered User
    Join Date
    Jul 2004
    Posts
    21
    Yes, this is the idea i have had so i'll try this way. Thank you much chrisauk0 for your time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •