premake / premake/premake-core

gmake project reference problem

Open
#361 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug gmake
Dominant language
C
Stars
3.6k
Forks
654
Avg merge
1d 1h
Merged PRs (30d)
13

Description

I am a beginner in programming on Linux, so this could well be my problem. However I found out that when linking shared object to an executable (that is defined in the same workspace) seem not to work. Compiling and linking works fine. Though when I run the application like:

LD_LIBRARY_PATH=. ./UnitTest

Then I get the following error:

./UnitTestd: error while loading shared libraries: ../../bin/libCored.so: cannot open shared object file: No such file or directory

The Makefile contains:

 LIBS += ../../../bin/libCored.so
 LDDEPS += ../../../bin/libCored.so

I noticed codelite (and Makefile) that it generated as linker option: -shared;../../bin/libCored.so. When I change the settings in codelite to -shared and add a library search path ../../bin and then link to Cored that it links and then also runs fine.

As stated, I am not sure if this is something I did wrong or that the automatic linking of projects in a workspace generates the wrong setting in Alpha6. Please let me know if you need more info.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the generated Makefile setup with LD_LIBRARY_PATH=. ./UnitTest and compare it with the working codelite configuration. Inspect the LIBS, LDDEPS, linker options, and generated shared-library path; done means the generated project links and the resulting application starts without the missing-library error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.