LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-28-2015, 12:47 PM   #1
vectrum
Member
 
Registered: Jul 2011
Posts: 92

Rep: Reputation: Disabled
FLTK linker problem (Eclipse & Windows)


When I try to link this with fltk lib (1.3 win-bin) I get the following errors. My gcc is TDM 4.8 (32 bit). I use eclipse cdt. Please tell me what goes wrong here.
Code:
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>

int main(int argc, char **argv) {
  Fl_Window *window = new Fl_Window(340,180);
  Fl_Box *box = new Fl_Box(20,40,300,100,"Hello, World!");
  box->box(FL_UP_BOX);
  box->labelfont(FL_BOLD+FL_ITALIC);
  box->labelsize(36);
  box->labeltype(FL_SHADOW_LABEL);
  window->end();
  window->show(argc, argv);
  return Fl::run();
}
Info: Internal Builder is used for build g++ "-IC:\fltk\include" "-includeC:\fltk\include\FL\Fl.H" "-includeC:\fltk\include\FL\Fl_Box.H" "-includeC:\fltk\include\FL\Fl_Window.H" -O0 -g3 -Wall -c -fmessage-length=0 -o fltkcpp.o "..\fltkcpp.cpp" g++ "-LC:\fltk\lib" -o fltkproject.exe fltkcpp.o -lfltk -lfltk_forms -lfltk_gl -lfltk_images -lfltk_jpeg -lfltk_png -lfltk_z

C:\fltk\lib/libfltk.a(Fl.o):Fl.cxx.text+0x179): undefined reference to OleUninitialize@0' . .(18 errors) . C:\fltk\lib\/libfltk.a(Fl.o):Fl.cxx.text+0x537): undefined reference toGdiFlush@0' c:/gcc/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:\fltk\lib/libfltk.a(Fl.o): bad reloc address 0x4 in section `.data' c:/gcc/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation collect2.exe: error: ld returned 1 exit status

It seems eclipse's found the libs and linked.
 
Old 08-29-2015, 07:36 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
umm...is'nt that a ***dows question? Unless I'm mistaken, then...sowwyyyy
Thor
 
Old 08-29-2015, 09:27 AM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
A similar question suggests to link Gdi32.lib.

Quote:
Originally Posted by MortenMacFly
You are missing to link against the windows libs. Search on MSDN for each of the symbols the linker complains about. MSDN will tell you which lib(s) you have to link against.
For example "DeleteObject": Find it here:
https://msdn.microsoft.com/en-us/library/dd183539.aspx [ed: URL updated]
Find the info about libs as there are: "Library: Use Gdi32.lib" -> written on that webpage
Add "gdi32" to the libs to link against.
For gcc I think would mean adding -lgdi32, I'm not sure how to accomplish that via Eclipse.

Quote:
Originally Posted by Thor_2.0
umm...is'nt that a ***dows question?
The Programming forum is under "Non-*NIX Forums".
 
1 members found this post helpful.
Old 08-29-2015, 11:55 AM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
The Programming forum is under "Non-*NIX Forums".
Indeed, however, OP's (very complete) info makes some suggestions to windows...hence my observation...if the problem lies there...there's not a lot we can do...
Thor
 
Old 08-29-2015, 12:46 PM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
> undefined reference to OleUninitialize

If your linker is able to link from *.dll files, simply specify this DLL: c:\windows\system32\ole32.dll (in case 64-bit Windows, 64-bit linker, 32-bit target: c:\windows\syswow64\ole32.dll)

Otherwise you have to find/create an ole32.lib file.

Last edited by NevemTeve; 08-29-2015 at 12:50 PM.
 
1 members found this post helpful.
Old 08-29-2015, 12:47 PM   #6
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Quote:
Originally Posted by Thor_2.0 View Post
umm...is'nt that a ***dows question? Unless I'm mistaken, then...sowwyyyy
Thor
and ?
mingw ,gcc , fltk , all open source,


Non-*NIX Forums > Programming

Quote:
This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
you have problems with reading, or is it that you just want to rant around a little bit
 
1 members found this post helpful.
Old 08-30-2015, 03:48 AM   #7
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
you have problems with reading, or is it that you just want to rant around a little bit
yea sure...
Basic politeness and a misunderstanding (for which I apologised beforehand)...but...politeness seems not to be your strongest point...
excusing myself from this thread...
Quote:
Unless I'm mistaken, then...sowwyyyy
Seems you dont read well...
maybe this helps?
Keep wankin'...maybe that'll help
Peace...for those that understand what it is...
Edit
Quote:
a4z has not made any friends yet
figures...added to my ignore list, so we dont clash anymore...distance seems the safer option...

Last edited by ButterflyMelissa; 08-30-2015 at 04:02 AM.
 
Old 09-07-2015, 03:46 PM   #8
vectrum
Member
 
Registered: Jul 2011
Posts: 92

Original Poster
Rep: Reputation: Disabled
@ntubski, @NevemTeve

Thank you very much. I've got the clue 'n I'm quite relieved that I have got no issue with eclipse and fltk lib itself.

Thanks again.

P.S Do I have to fight the tons of ego for the rest of life?

I can hit it wrong...
I can not know everything...
I can cry...
I can laugh...
I can be happy...
...because I'm human... and lunatic....

Last edited by vectrum; 09-07-2015 at 04:06 PM.
 
  


Reply

Tags
fltk



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse CDT - Gcc compiler, linker-need your help parvathi reddy Linux - Newbie 1 03-09-2014 06:40 AM
[SOLVED] Is FLTK 2.X Compatible With FLTK 1.X? Zssfssz Programming 3 04-24-2012 03:28 AM
Fedora 10, Eclipse & fstream Problem SocietyIsBroken Fedora 1 02-13-2009 08:28 PM
Compilation problem with fltk + opengl crisostomo_enrico Linux - Software 0 07-18-2006 06:49 AM
Satiek Eclipse Keyboard & 2.6 test kernel problem Potatopopper Linux - Hardware 3 03-04-2006 12:35 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration