LinuxQuestions.org
Review your favorite Linux distribution.
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 03-18-2016, 01:28 PM   #1
minux
LQ Newbie
 
Registered: Dec 2015
Location: Jakarta
Distribution: Tiny Core
Posts: 13
Blog Entries: 1

Rep: Reputation: Disabled
FLTK fl_input problem


Good morning, i have little problem this fltk code.
My goal is to create a small shell scripting with fltk(common dialog stuff)

this an example code
Code:
#include <FL/Fl.H>
#include <FL/Fl_File_Chooser.H> 
int main(){
  //fl_message("Test");
  const char *val=fl_input("Your input");
  return Fl::run();
}
I got segfault without the dummy fl_message for both winxp and linux(fltk 1.3)
My question is how to get rid this without a dummy?

Thanks
 
Old 03-18-2016, 01:45 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I've got 1.3.1 and your program works fine. No segfault.
 
Old 03-18-2016, 01:58 PM   #3
minux
LQ Newbie
 
Registered: Dec 2015
Location: Jakarta
Distribution: Tiny Core
Posts: 13

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
This is embarassing for me,sorry the windows is ok, i'll switch to tiny core again.

Code:
User@user-gfyvamjhfr ~
$ fltk-config --compile test.cpp
g++ -I/usr/local/include -mwindows -DWIN32 -DUSE_OPENGL32 -D_LARGEFILE_SOURCE -D
_LARGEFILE64_SOURCE -o 'test' 'test.cpp' -mwindows /usr/local/lib/libfltk.a -lol
e32 -luuid -lcomctl32

User@user-gfyvamjhfr ~
$ ./test

User@user-gfyvamjhfr ~
$
 
Old 03-18-2016, 02:09 PM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Well, I salute you using XP

Just ran into a very nasty W8 problem where my customer claims, "You can't just scoff that off! You HAVE to fix it!" Happily the boss said something profane back on the call, which settled the issue.
 
Old 03-18-2016, 02:15 PM   #5
minux
LQ Newbie
 
Registered: Dec 2015
Location: Jakarta
Distribution: Tiny Core
Posts: 13

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
I can't buy 10
@rtmistler is your compilation from win or linux ?
Still no luck from TC
Code:
tc@box:~$ cd /tmp
tc@box:/tmp$ fltk-config --compile test.cpp
g++ -march=i486 -mtune=i686 -Os -s -pipe -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fvisibility-inlines-hidden -Wl,-O1 -Wl,-gc-sections -Wl,-as-needed -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include -fvisibility-inlines-hidden -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -o 'test' 'test.cpp' /usr/local/lib/libfltk.a -lXcursor -lXfixes -lXft -lfontconfig -lXinerama -lpthread -ldl -lm -lX11
tc@box:/tmp$ ./test
Segmentation fault
tc@box:/tmp$
 
Old 03-18-2016, 02:17 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Linux: Ubuntu
 
Old 03-18-2016, 02:22 PM   #7
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I'd recommend you run that in the debugger or add the GDB flag to the compile so you can review the core file, however I don't know how to use fltk-config to change your flags, or where you'd change them. I do see instructions as to how to use the native G++ compiler instead of fltk-config. I'd consider exploring that.

Nothing wrong with your code, IMHO though

Perhaps something wrong with your FLTK install?
 
1 members found this post helpful.
Old 03-18-2016, 04:20 PM   #8
minux
LQ Newbie
 
Registered: Dec 2015
Location: Jakarta
Distribution: Tiny Core
Posts: 13

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
@rtmistler , you're right nothing wrong with my code
I just made 2 compilations for 1.3.1(i see from yours) and 1.3.3
My win version is 1.3.0
Code:
tc@box:~$ cd /tmp
tc@box:/tmp$ fltk-config --compile test.cpp
g++ -I/usr/local/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -o 'test' 'test.cpp' /usr/local/lib/libfltk.a -lXext -lXinerama -lpthread -ldl -lm -lX11
tc@box:/tmp$ ./test
tc@box:/tmp$ fltk-config --version
1.3.1
tc@box:/tmp$ fltk-config --compile test.cpp
g++ -I/usr/local/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -o 'test' 'test.cpp' /usr/local/lib/libfltk.a -lXcursor -lXfixes -lXext -lXinerama -lpthread -ldl -lm -lX11
tc@box:/tmp$ ./test
Segmentation fault
tc@box:/tmp$ fltk-config --version
1.3.3
tc@box:/tmp$
Got quick answer from Mr Ercolano
Quote:
I can confirm a crash with that code using 1.3.3 with linux.
(See below for a backtrace)

I can also tell you the code runs OK in the current version of
FLTK in svn, so if its an option to use svn current, try that.

Last edited by minux; 03-18-2016 at 05:16 PM.
 
  


Reply



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
FLTK linker problem (Eclipse & Windows) vectrum Programming 7 09-07-2015 03:46 PM
[SOLVED] Is FLTK 2.X Compatible With FLTK 1.X? Zssfssz Programming 3 04-24-2012 03:28 AM
Problem compiling fltk with opengl crisostomo_enrico Programming 1 07-18-2006 09:05 AM
Compilation problem with fltk + opengl crisostomo_enrico Linux - Software 0 07-18-2006 06:49 AM

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

All times are GMT -5. The time now is 08:10 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