Thread: gcc - linking to cwd

  1. #1
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218

    gcc - linking to cwd

    I am attempting to make a very simple dll, but I am having trouble linking it. First I compile my dll:
    Code:
    gcc -Wall -c dll.c
    Then I create a shared dll:
    Code:
    gcc -shared -o test.dll dll.o
    Now i try and link it:
    Code:
    gcc main-c -L./ -ltest
    but gcc end up looking for it in /usr/bin/ld

    What am I doing wrong here? I thought that -L./ would tell gcc to look for it in the cwd.

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    DLLs are under windows. Unix/Linux uses .so.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981

  4. #4
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    Thanks for the link. Apparently things are done quite a bit differently to what I was trying (Windows style).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gcc compiling and linking problem
    By maven in forum C Programming
    Replies: 6
    Last Post: 11-14-2008, 05:28 AM
  2. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  3. Replies: 4
    Last Post: 09-02-2007, 08:47 PM
  4. gcc 3.2 & linking
    By rotis23 in forum Linux Programming
    Replies: 1
    Last Post: 06-23-2003, 06:46 AM
  5. Linking an assembly routine into a GCC project
    By huh in forum C++ Programming
    Replies: 3
    Last Post: 11-21-2002, 03:14 PM