SanderMertens / bake

Bake, A build system for building, testing and running C & C++ projects
GNU General Public License v3.0
681 stars 53 forks source link

Failing to link #80

Closed Ruannilton closed 3 years ago

Ruannilton commented 3 years ago

I have a package that I am porting to the bake environment: { "id": "collections", "type": "package" }

and an application project thats depends on it: { "id": "collec_test", "type": "application", "value": { "use": [ "collections" ] } }

But when try to compile I get this error:

ruan@Mahlik:~/Dev/collec_test$ bake build [ build] application collec_test => '.' /usr/bin/ld: .bake_cache/x64-Linux-debug/obj/main.o: in function 'main': /home/ruan/Dev/collec_test/./src/main.c:5: undefined reference to 'cvector_create_i' collect2: error: ld returned 1 exit status [ error] process 4040 exited with returncode 1 [ from] command returned 1 gcc -Wall -O0 .bake_cache/x64-Linux-debug/obj/main.o -L/home/ruan/bake/x64-Linux/debug/lib -L/home/ruan/bake/lib -lcollections -o ./bin/x64-Linux-debug/collec_test [ from] command for task './bin/x64-Linux-debug/collec_test' failed [ from] failed to build rule 'ARTEFACT' [ error] build interrupted for collec_test in . [ error] project 'collec_test' built with errors, skipping

When I go to the lib directory the .so file is presente there:

ruan@Mahlik:~/bake/x64-Linux/debug/lib$ ls libcollections.so

And when I list the bake enviroment the package is there:

ruan@Mahlik:~$ bake list

Listing projects for platform:

  • x64-Linux

Packages & Applications: P bake.amalgamate => all C bake.lang.c => all C bake.lang.cpp => all C bake.opengl => all C bake.sdl2 => all C bake.sfml2 => all P bake.test => all P bake.util => all P collections => [debug]

Summary: applications: 0, packages: 9, templates: 0

The package code works well in other projects, so, I believe the cvector_create_i function is defined in the .so file. Could someone explain to me what's wrong please?