gcc - linking to cwd

This is a discussion on gcc - linking to cwd within the Tech Board forums, part of the Community Boards category; I am attempting to make a very simple dll, but I am having trouble linking it. First I compile my ...

  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,702

  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, 10:38 AM
  3. Replies: 4
    Last Post: 09-02-2007, 09:47 PM
  4. gcc 3.2 & linking
    By rotis23 in forum Linux Programming
    Replies: 1
    Last Post: 06-23-2003, 07: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

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