Page 1 of 1

Linker problem

Posted: Fri Feb 13, 2015 2:37 pm
by mrsauce
Hi,
I have this issue.
I maked a Dynamic Library with the template in the "New project.....ecc"
I saw that the wizard template produced "include" and "src" empty.
This is not the problem because i add the .h and .cpp with the functions of my librar.
I compile my library without problems and i have the output file of my library provadll.dll and provadll.cpp.o
I set my project to use this library but when i start the BUILD i receive this error:

C:\Windows\system32\cmd.exe /C "C:/MinGW/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f Makefile"
"----------Building project:[ Prova - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'D:/Download Internet/Progetti_CodeLite/Fabio/Prova'
C:/MinGW/bin/g++.exe -o ./Debug/Prova @"Prova.txt" -Lc:/libreria -lprovadll
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot find -lprovadll
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[1]: *** [Debug/Prova] Error 1
mingw32-make.exe: *** [All] Error 2
Prova.mk:78: recipe for target 'Debug/Prova' failed
mingw32-make.exe[1]: Leaving directory 'D:/Download Internet/Progetti_CodeLite/Fabio/Prova'
Makefile:4: recipe for target 'All' failed
1 errors, 0 warnings

I set the linker path in "Project-Setting" like this:
"Library Path": c:\libreria (where there is my library)
"Libraries": provadll.cpp.o
but the error persist.

I'm missing something?
Probably i'm wrong something but i don't understand where.

thank's in advanced for eventually reply

Fabio

Re: Linker problem

Posted: Fri Feb 13, 2015 2:50 pm
by eranif
"Libraries": provadll.cpp.o
You should not attempt to link to object files directly, but rather to libraries and DLLs

The "Library Path" should point to the location where your DLL exists
The "Libraries" should contains list of **libraries**, in your case: Just this: "provadll" (notice that I did not add the .dll suffix as the linker will add it automatically)

Eran

Re: Linker problem

Posted: Fri Feb 13, 2015 3:22 pm
by mrsauce
Hi Eran,
ok now it works properly.
Why if i create a newproject-dynamic library i see the structure with "src" and "include" but are empty and there isn't
a simple .h and .cpp with a basically example of library?
this is only a curiosity.

best regards
Fabio