Chapters involving graphics libraries, FLTK, etc.

631 views
Skip to first unread message

Aiden

unread,
Dec 20, 2010, 9:39:58 PM12/20/10
to PPP-public
Alright, I have a problem with these and I do NOT know where to turn.

I have spent so much time on this and I need help.

I have Code::Blocks, and am a bit reluctant to turn to Microsoft
Visual C++(only because I've heard more and more negatives about it)

I, however, cannot figure out how to get ANY of the things necessary
to start this part of the book.

I've tried installing FLTK files, but can't figure how to use them, I
tried getting CYGWIN and using that, but no dice, it wouldn't work.

I have really no clue what to do now.

Please, suggest a different IDE if needed, I'll even use Microsoft VC+
+ if it's really just going to work for that, but I need help in order
to begin this part of the book.

Aiden

unread,
Dec 20, 2010, 9:41:18 PM12/20/10
to PPP-public
In case this wasn't clear enough, I just want to clarify.

I'm at the part where the book teaches about graphs, windows, etc, but
they use FLTK and I can't figure how to get the things necessary to
make them work.

cipri_arad_77

unread,
Dec 21, 2010, 12:50:37 PM12/21/10
to PPP-public
Hello,

I have succeded to do the graphic chapters with Visual C++ 2010
Express Edition.
I do not have any experience, not the time to try it with other ide or
compilers like Code::Blocks.

Unfortunately for me, I am working at quality in automotive industry,
and have little time for programming.
I managed to do something like 2/3 of "PPP using C++", and now I am
studiing algorithms with STL implementation: recursion (Divide et
Impera), greedy, stacks, queues, lists, binary trees, backtracking,
graphs ... I have a romanian book for this, and now I finish
frecursion.

So what I can explain it is only what I have done untill now.
To start with please see this topic on our forum for teh book PPP
using C++ :

http://groups.google.com/group/ppp-public/browse_thread/thread/f3627f4d723b940c

And to not get stucked in the uselless discusions, look at my post
from 24 Oct. There I explain in detail what is to be done to run the
drills.
But before that just do exactly as Dr Stroustrup said in the book at
Appendix D. It must work.
Try it on Visual C++, and come back with the step where you are
stucked. Will go from there.

Best regards,

Zaharie Ciprian
> > to begin this part of the book.- Ascundeţi textul citat -
>
> - Afişare text în citat -

Aiden

unread,
Jan 5, 2011, 11:04:01 AM1/5/11
to PPP-public
Alright, here's the deal, I tried on both 2005 and 2010 versions of
Microsoft Visual C++ and I followed the instructions.

Here's what I did in full.

-I installed the program
-I downloaded FLTK
-I copied the FL folder into the include folder
-I copied the header AND .cpp files given for the book specifically
into the include file, but NOT the FL file
-I tried the exercise from the book
-I got this message:
1>------ Build started: Project: test1, Configuration: Debug Win32
------
1>Build started 1/5/2011 9:58:09 AM.
1>InitializeBuildStatus:
1> Touching "Debug\test1.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1> test1.cpp
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\window.h(36): error C3861: 'copy_label':
identifier not found
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(35): error C2065: 'FL_DARK_RED' :
undeclared identifier
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(36): error C2065: 'FL_DARK_GREEN' :
undeclared identifier
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(37): error C2065: 'FL_DARK_YELLOW' :
undeclared identifier
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(38): error C2065: 'FL_DARK_BLUE' :
undeclared identifier
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(39): error C2065:
'FL_DARK_MAGENTA' : undeclared identifier
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(41): error C2065: 'FL_DARK_CYAN' :
undeclared identifier
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(45): warning C4305: 'initializing' :
truncation from 'Graph_lib::Color::Transparency' to 'char'
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(45): warning C4309: 'initializing' :
truncation of constant value
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(47): warning C4305: 'initializing' :
truncation from 'Graph_lib::Color::Transparency' to 'char'
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(47): warning C4309: 'initializing' :
truncation of constant value
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(384): error C2664:
'Fl_Image::Fl_Image(const uchar *,int,int,int,int)' : cannot convert
parameter 1 from 'int' to 'const uchar *'
1> Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\graph.h(385): error C3861: 'draw_empty':
identifier not found
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\gui.h(107): warning C4018: '<' : signed/
unsigned mismatch
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\gui.h(112): warning C4018: '<' : signed/
unsigned mismatch
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\gui.h(117): warning C4018: '<' : signed/
unsigned mismatch
1>c:\documents and settings\023207\my documents\visual studio
2010\projects\test1\test1\test1.cpp(22): error C2039:
'wait_wait_for_button' : is not a member of 'Simple_window'
1> c:\documents and settings\023207\my documents\visual
studio 2010\projects\test1\test1\simple_window.h(17) : see declaration
of 'Simple_window'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.60
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========


I honestly have no idea what to do now, any idea?

On Dec 21 2010, 11:50 am, cipri_arad_77 <23cipri4...@gmail.com> wrote:
> Hello,
>
> I have succeded to do the graphic chapters with Visual C++ 2010
> Express Edition.
> I do not have any experience, not the time to try it with other ide or
> compilers like Code::Blocks.
>
> Unfortunately for me, I am working at quality in automotive industry,
> and have little time for programming.
> I managed to do something like 2/3 of "PPP using C++", and now I am
> studiing algorithms with STL implementation: recursion (Divide et
> Impera), greedy, stacks, queues, lists, binary trees, backtracking,
> graphs ... I have a romanian book for this, and now I finish
> frecursion.
>
> So what I can explain it is only what I have done untill now.
> To start with please see this topic on our forum for teh book PPP
> using C++ :
>
> http://groups.google.com/group/ppp-public/browse_thread/thread/f3627f...
> > > to begin this part of the book.- Ascundeþi textul citat -
>
> > - Afiºare text în citat -

cipri_arad_77

unread,
Jan 5, 2011, 2:23:14 PM1/5/11
to PPP-public
Hello,

I wonder were you dissapeared. Good to have you back.
So you have downloaded the FLTK libraries, and then copied the FL
folder into the include folder.
Firts of all what wersion of FLTK you have downloaded ?
So for me worked the folowing combination : Visual Studio
2010 Express Edition, and fltk-1.3.x-r7725 .
Now I see on the FLTK website that they have the version fltk-1.3.x-r.
8145. I think that this will be ok for
Visual C++ 2010.
After that you must do what Dr Stroustrup said on page 1159 of "PPP
using CPP".
You must open fltk.dsw in Visual C++, because this make the library
ready for use (it will be compiled).
After doing all the steps from the appendix D, you must try the
example from appendix D.
Only if that workes, then you can go to exercises from chapter 12-16.
If you do not succed, we will talk on google talk, or yahoo messenger.
My time is GMT +2.

So try this steps and after that we will see what to do.

Best regards,
Zaharie Ciprian,
> > > - Afiºare text în citat -- Ascundeţi textul citat -

Adrian Mowrey

unread,
Jan 5, 2011, 3:28:53 PM1/5/11
to ppp-p...@googlegroups.com
Hi, Ciprian! Happy New Year! || La Multi Ani! :) I've been quite busy studying for my entrance exams at the U.S. Navy - Computer Science. If I will get to join, then I'll have plenty of time to study this beautiful and amazing field (which I'm pretty sure they will also teach C++). ;) Besides that, I've been working and partying over the holidays. :)

How about you?

P.S.
--
I think he'll be able to figure it out based on your reply. ;) 


--
You received this message because you are subscribed to the Google Groups "PPP-public" group.
To post to this group, send email to ppp-p...@googlegroups.com.
To unsubscribe from this group, send email to ppp-public+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ppp-public?hl=en.




--
Sincerely/Cu sinceritate,

Adrian Mowrey

Aiden

unread,
Jan 6, 2011, 10:10:34 AM1/6/11
to PPP-public
Hi, I was gone because it was break and I didn't want to really mess
with it during break, I'm back and have been trying to test it now.
Thanks for the info, but something went wrong still.
Here's what happened now.
I still did what the book said, AND what you said, and I went to go
build the solution to create said libraries.

After I hit "Build Solution" it indeed took a while, but at the end of
the thing it said 12 succeeded and 81 failed.

So I don't really know what to do now.

Thank you for your help.
> > - Afişare text în citat -- Hide quoted text -
>
> - Show quoted text -

Aiden

unread,
Jan 6, 2011, 10:20:29 AM1/6/11
to PPP-public
If it's important, the only .dsw file I was able to find on the set of
FLTK files you mentioned was one in IDE/VC6

The folder for VC2010 didn't have a dsw file.
> > - Show quoted text -- Hide quoted text -

cipri_arad_77

unread,
Jan 7, 2011, 1:47:38 PM1/7/11
to PPP-public
Hello Aiden,

Follow this steps. I made this steps myself couple of minutes ago,
using the new version fltk-1.3.x-r8207.
I opened from Visual C++ 2010, the fltk.sln file from fltk-1.3.x-
r8207\fltk-1.3.x-r8207\ide\VisualC2010
This is the path inside the folder were you unzip the fltk library
downloaded from the FLTK site.

You are wright. There is no fltk.dsw in VC2010 folder, only a fltk.sln
file.
When Dr Stroustrup wrote the book, there was no such suport from the
developers of FLTK library.
If I am corect there was also no Visual C++ 2010.
But if you look carefully there is a fltk.dsw file in the VC6 folder
of your unzipped library. I think that this file is for older versions
of Visual C++. Older than Visual C++ 2008, because for this one there
is also a fltk.sln, not a fltk.dsw.
So to conclude : for versions 2010 and 2008 of Visual C++there are
fltk.sln files in there specific folders, and for older versions of
Visual C++, tehre is a fltk.dsw file in VC6 folder of unzipped
library.

Now ...To continue with our issue.
After you have opened from Visual C++ 2010 (with open file), the
fltk.sln file from VisualC2010 folder of the unzipped library, you
must build it with F7, or just Build solution from Buid menu.
Wait couple of minutes, and it must say that all the files were build
sucesfully.

After te build is succesfully, you must go on the unzipped folder of
your library not on ide, like before, but on lib folder, and copy
(with CTRL-X, not CTRL-C) the 7 files that were created there (lib
files, but not the readme file wich is also a lib file). Put them in
the lib folder of Microsoft Visual Studio like it says in the book at
page 1159.

Now go in Visual C++ 2010, close the solution, and create a new
project (Win32 project not console aplication), and do the steps from
page 1159 (go to Properties, Linker, Input, Additional Dependecies ...
add the text that it says there fltkd.lib ..., also do what it says
for Ignore specific libraries ...)
Now do the program from page 1160.
Tell me if it worked.
PS: I did this steps this evening, for Visual C++ Express Edition, and
also for Visual Studio 2010 Professional Edition (I have it with
MSDNAA from my University), and it works for both of them. For this I
unzipped twice the fltk library, and save it with 2 different names.
So it must work also for you, regardless of your version of Visual C++
2010 : Express Edition or Professional Edition.

Best regards

Zaharie Ciprian
> > - Show quoted text -- Ascundeţi textul citat -

cipri_arad_77

unread,
Jan 7, 2011, 2:07:29 PM1/7/11
to PPP-public
Hello Adrian,

Happry New Year ! La Multi Ani!
Congratulations for yor choice to apply to U.S. Navy - Computer
Science.
Succes la examene.
I will finish this summer the master sudies in Computer Science, and
after that I will search for work in
IT as a programmer. I still do C++ at home, and in 3 month I hope to
conclude the C++ training, and do some Java
for 2 or 3 month, to have 2 programming languages to offer in my CV.
The issue is that it is hard to get your first job in a field,
because every body whant's experience.
Same old problem.
I also whant to study the posibility to make a doctorate in a foreign
country where Computer Science is studied intensivily, and more
adapted to real world.

Best regards,

Zaharie Ciprian,
> > ppp-public+...@googlegroups.com<ppp-public%2Bunsubscribe@googlegrou­ps.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/ppp-public?hl=en.
>
> --
> *Sincerely/Cu sinceritate,
>
> Adrian Mowrey*- Ascundeţi textul citat -

Aiden

unread,
Jan 8, 2011, 3:04:23 AM1/8/11
to PPP-public
Thank you for your help, I'll try it as soon as I'm able and will let
you know how it goes.
> ...
>
> read more »

cipri_arad_77

unread,
Jan 8, 2011, 6:03:29 AM1/8/11
to PPP-public
OK.
If you do not succeed (I am not so good in explaining stuff) you can
find me on Google Talk, today and tomorrow at an hour that suites both
of us.
I will be online most of the day.
> ...
>
> citiţi mai multe »- Ascundeţi textul citat -

Aiden

unread,
Jan 10, 2011, 11:06:18 AM1/10/11
to PPP-public
Thank you SO much, it's made a lot of progress, now, there's only one
problem left.

As you said to do, I got that version, used the /sln file, ran it, and
it succeeded flawlessly. Then I got said 7 .lib files and moved them
completely over to the lib folder of VC++ and did EVERYTHING the book
told me to do, but then a problem occurred when I tried to run the
test program.

1>------ Build started: Project: fltktest, Configuration: Debug Win32
------
1>Build started 1/10/2011 10:01:22 AM.
1>InitializeBuildStatus:
1> Touching "Debug\fltktest.unsuccessfulbuild".
1>ClCompile:
1> test.cpp
1>c:\program files\microsoft visual studio 10.0\vc\include\fl
\fl.h(943): warning C4800: 'int' : forcing value to bool 'true' or
'false' (performance warning)
1>c:\program files\microsoft visual studio 10.0\vc\include\fl
\fl.h(958): warning C4800: 'int' : forcing value to bool 'true' or
'false' (performance warning)
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>LINK : fatal error LNK1104: cannot open file 'fltkd.lib wsock32.lib
comctl32.lib fltkjpegd.lib fltkimagesd.lib'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.74
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========

Maybe it's simple enough for you to know what's going on just by
looking at it.

Just to clarify, the 7 files, EXCLUDING the README.lib file are all in
the vc++ folder "lib", and I looked in the book and the only thing it
said about this was that the compiler might not be able to find it,
though I have no clue how to make it easier... So I'm not exactly sure
what's up with it.

I hope you can figure what's wrong.

Again, thank you for all the help.
> ...
>
> read more »- Hide quoted text -

cipri_arad_77

unread,
Jan 10, 2011, 2:53:40 PM1/10/11
to PPP-public
Hello,

It seems that the propblem is with your library files, the ones that
you should put in the text field
of the Aditional Dependencies.
Put a picture on files of this forum, with the printscreen of your
Aditional Dependencies text box.
And please look that I put there a picture of what I have in that
Properties dialog box.

Best regards,

Zaharie Ciprian,

Aiden

unread,
Jan 10, 2011, 4:39:46 PM1/10/11
to PPP-public
NO NEED!

Yes! It compiled and ran perfectly.

The problem was that when entering the libraries in the dependencies
box, I mistakenly did it EXACTLY as the book said, so I whitespaced
instead of entering after each library, so VC++ thought it was all one
library.

Thank you so much for the help, I can now finally get started!

Happy Day! :D

Thanks again.

bjarne

unread,
Jan 17, 2011, 10:27:11 AM1/17/11
to PPP-public
Great! And thanks to all who helped; installing libraries can be so
frustrating.

Happy New Year.
> ...
>
> read more »

cipri_arad_77

unread,
Jan 19, 2011, 12:37:40 AM1/19/11
to PPP-public
Hello,

Yes but it's a good experience for future libraries installing.
Happy New Year.

Best regards,
Zaharie Ciprian

jbos...@gmail.com

unread,
May 23, 2013, 3:00:35 AM5/23/13
to ppp-p...@googlegroups.com
Hello, I had the same problem described above by AIden.  I followed his solution but I am still getting this error: LINK : fatal error LNK1104: cannot open file 'fltkd.lib'.  Does anyone have any advice on how to get this fixed?

jbos...@gmail.com

unread,
May 27, 2013, 9:24:10 PM5/27/13
to ppp-p...@googlegroups.com
I figured out what my problem was.  When copying the header files, I somehow skipped copying the fltkd file.
Reply all
Reply to author
Forward
0 new messages