Hi Paolo!
I'm certainly not the best here to help, but I can at
least try to steer you in the right direction...
* The makefile is automaticly generated by Dev-C++, so
you don't have to worry about it. You will indirectly
select what will be in the makefile through 1/ the
files you create/add in your project 2/ the project
options.
* In fact, the problem is (IMO) that the linker
doesn't know where to find the libraries it needs.
Before we come back to the compilation / linkage, some
remarks :
* First point, Qt applications simply won't compile
under Dev-C++ (using MinGW/GCC as compiler). I'd love
to, but this won't work, no luck.
* I've never used FLTK, but it's available as a DevPak
downloadable through vUpdate, so I guess it's ok.
* SDL works great with Dev-C++.
* If you have downloaded FLTK and SDL as DevPaks and
have installed them, most of the work is already done.
Now, let's say you have downloaded and installed the
SDL DevPack, and you're trying to build a SDL prog :
* You should perhaps try first to use the templates
provided. For example, select File->New->Project...,
then select a template : SDL or SDL&GL. Try to build
(Execute->Compile, or Ctrl+F9), and see if it compile
ok.
* Then, try the same, but copy and paste your source
instead of the default source, and see if it's still
compiling ok.
To speak more generally (i.e. for a library which
didn't necessarily come as a DevPak)... There are four
steps to build a project. Once again we take SDL as
example, but this works with all librairies the same
way(just be sure it has been compiled for MinGW!!) :
* Create a new project, using the "Empty" template :
File->New->Project, then select the "Empty Project"
template. Click the "C Project" radio button if your
project is in plain C, "C++ Project" otherwise. Write
its name in the "Name" textfield, then "Ok". Select
the directory where you want to save the project .dev
file (usually where your sources are), then "Save".
* Add your file(s) to the project :
Project->Add to Project, select all the files in the
file dialog, then "Open". Do this as many times as
needed if you have several files in several
directories.
* Tell Dev-C++ where the include files for SDL are :
Project->Project Options->Directories->Include
directories. Use the "..." button to browse to the
right directory, click the directory, then "Ok". Click
the "Add" button, then "Ok".
* Tell Dev-C++ which libraries to link with - this
also tell Dev-C++ where they are :
Project->Project Options->Parameters. In the "linker"
textbox, enter (without quotes) '-lmingw32'. This is
to tell Dev-C++ to use its win32 library (SDL relies
on it).
Click the "Add Library or Object" button, and browse
to the directory where the SDL libraries are. Select
them, then "Open". In the "linker" textbox, ensure
that libSDLmain.a is listed before libSDL.a. Then
"Ok".
Then, finally, in the "linker" textbox, enter
'-lopengl32' and '-glu32' to tell Dev-C++ to use its
default OpenGL library, if your source uses OpenGL.
Now your project *should* be ready to compile and
link!
Another way would be tell Dev-C++ where the SDL
libraries are (Project->Project
Options->Directories->Library directories, browse the
right directory and add it), then to enter all
libraries in the linker this way : '-lmingw32
-lSDLmain -lSDL -opengl32 -lglu32'.
Speaking even more generally : Dev-C++ will
automaticly know where to find all the libraries
bundled with Dev-C++, so you just have to add them
this way : for libopengl32.a, write '-lopengl32'
("-l", forget the "lib", forget the ".a"). For
libraries you have installed elsewhere, you have
either to add them will full name and pathname, or add
their directory in the library directories, and then
their name as above.
That's it. I hope all this will be of some use for
you. And please forgive me if I've misunderstood your
question...
Bye! Sandy/Moonlight
--- Paolo Brasolin <pbr...@ya...> a écrit :
> Hi.
> I'm new to the list. I'm italian and my name is
> Paolo
> Brasolin.
> I've got a question. I tried to compile sources that
> uses FLTK, SDL or QT with dev-cpp but the linker
> told
> me that there were a LOT of errors caused by
> undefined
> references to the components of the libraries (for
> example, "[Linker error] undefined reference to
> 'Fl_Widget::~Fl_Widget()'" ). I put the includes in
> the right directory, but I think that the problem
> lies
> in the fact that I absolutely ignore how to use
> makefiles (I found some in each of the libraries
> packages). Would someone please help me?
>
> Thanks a lot.
>
> Paolo
>
>
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
|