Find the answer to your Linux question:
Results 1 to 3 of 3
Hi all!!! I have been trying to port a piece of C++ code from windows to Linux environment. I'm using redhat9 which has KDE3 and QT3.1.x on it. I used ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3

    Question gmake error: No rule to make target lib_file.a

    Hi all!!!
    I have been trying to port a piece of C++ code from windows to Linux environment. I'm using redhat9 which has KDE3 and QT3.1.x on it.

    I used KDevelop 2.1 bundled with it. I created a new C++ project with KDevelop.
    The code needs to import headers and .a files containing the definitions of functions contained therein. I supplied the path of the folder containing the headers as "-Ipath_of_header_folder" as a compiler flag and supplied the path of library files' folder as "-Lpath_of_lib_folder" as a linker flag. Then I mentioned the names of the libraries that need to be linked with the code in the linker options->additional libraries. I have used -Wall compiler flag.

    The code is compiling properly but when I hit make, the compiler is throwing up the following error:
    gmake[3]: *** No rule to make target `lib_file.a,', needed by `project_name'. Stop.

    Seems something is wrong with the make options but I haven't changed any of the defaults..

    Please Help!!!

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Quote Originally Posted by chaos buddha View Post
    gmake[3]: *** No rule to make target `lib_file.a,', needed by `project_name'. Stop.

    Please Help!!!
    I have a few questions about your error:

    1. Does lib_file.a exist on your hard drive?
    2. If it does are you pointing to it in the compile/link process?
    3. Or do you have to down load it or create it..

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3

    Question Re: gmake error: No rule to make target lib_file.a

    >1. Does lib_file.a exist on your hard drive?

    Yes. It does!!

    >2. If it does are you pointing to it in the compile/link process?

    I guess this is where the problem lies... I supplied the directory path as a linker flag("-Lpath_of_lib_folder"). And mentioned the name of the .a to be searched into the additional libraries space.. It uses multiple .a(s). Initially it was throwing an error with the very first .a that I mentioned. So I tried fixing it by adding a -l to the .a files viz. -llib_file1.a lib_file2.a lib_file3.a...
    Now it doesn't throw an error with the first file but the same error is thrown with the second file - lib_file2.a. When I tried appending the -l to the other files, the make is not able to locate it at all...

    >3. Or do you have to down load it or create it..

    No! This part I've already done... )

Posting Permissions

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