Help! Linker can't find definitions in ".a" library!

This is a discussion on Help! Linker can't find definitions in ".a" library! within the Windows Programming forums, part of the Platform Specific Boards category; Yes, I was just point out that the differences between the two may be leading to the difference of understanding ...

  1. #16
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Yes, I was just point out that the differences between the two may be leading to the difference of understanding between you and Elysia.
    What is C++?

  2. #17
    Registered User
    Join Date
    Nov 2006
    Posts
    184
    Quote Originally Posted by Elysia View Post
    Yes, that explains how I use different files in all my projects and it compiles fine without the extern keyword.
    Actually, the linker will search through all object files when searching for a function. The difference is a variable. You can't redefine it, so you must use something to tell the compiler it exists, yet not redefine it. Therefore the "extern" keyword exists.
    This is not needed for functions, because declarations are not definitions. They do not produce any code.
    Actually extern is partially marking whatever you used it on as a declaration.

    But that aside, I've finally been able to compile a DLL using a ".a" lib file but now I can't get an MSVC DLL to use my MinGW/GCC created DLL (won't link, says unresolved symbols!) Any ideas?

  3. #18
    Registered User
    Join Date
    Nov 2006
    Posts
    184
    Quote Originally Posted by Vicious View Post
    Yes, I was just point out that the differences between the two may be leading to the difference of understanding between you and Elysia.
    Ah, gotcha. Thanks.

  4. #19
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,629
    Quote Originally Posted by 6tr6tr View Post
    Actually extern is partially marking whatever you used it on as a declaration.
    Untrue. Declarations do not need "extern."

    But that aside, I've finally been able to compile a DLL using a ".a" lib file but now I can't get an MSVC DLL to use my MinGW/GCC created DLL (won't link, says unresolved symbols!) Any ideas?
    I really don't know. GCC does a lot of weird stuff.
    Visual Studio makes it all simple if you compile the DLL in Visual Studio, however.
    You can just link the projects in the solution.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #20
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    extern can be used with functions, but I'm pretty sure the only time you'd need to do it is if you're specifying extern "C" func();
    http://msdn2.microsoft.com/en-us/lib...9d(VS.80).aspx

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. university library
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 09-10-2003, 03:05 PM
  3. linked list recursive function spaghetti
    By ... in forum C++ Programming
    Replies: 4
    Last Post: 09-02-2003, 02:53 PM
  4. Won't Return pointer, i can't find why...
    By ss3x in forum C++ Programming
    Replies: 2
    Last Post: 02-28-2002, 07:50 PM
  5. Linker errors with simple static library
    By Dang in forum Windows Programming
    Replies: 5
    Last Post: 09-08-2001, 09:38 AM

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