FLTK with CodeLite

General questions regarding the usage of CodeLite
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: FLTK with CodeLite

Post by eranif »

I should have asked these at the first time:
Which version of codelite are you using and are you using the MinGW that comes with codelite?

Try running the build command from a CMD window:

To mimic codelite behavior *EXACTLY* do this:
- Right click on the file you are compiling (main.cpp ?)
- Select the option 'Open Shell at File Path' - this will load CMD with the exact same environment variables as seen by codelite
- cd to the workspace directory and type the build command line from the CMD window:

Code: Select all

"mingw32-make.exe"  -j 2 -f "CLtest_wsp.mk"
Eran
Make sure you have read the HOW TO POST thread
Hacker John
CodeLite Enthusiast
Posts: 19
Joined: Tue Aug 16, 2011 11:31 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: FLTK with CodeLite

Post by Hacker John »

I installed with codelite-2.10.0.4778-mingw4.4.1-wx2.8.12.exe.. I'm afraid the option 'Open Shell at File Path' does not appear when I right-click the main.cpp file.

EDIT: I pasted the command directly into CMD anyway, and the output is

CMD

Code: Select all

C:\Users\john\DEV\C\CLtest>"mingw32-make.exe"  -j 2 -f "CLtest_wsp.mk"
----------Building project:[ CLtest - Debug ]----------
mingw32-make.exe[1]: Entering directory `C:/Users/john/DEV/C/CLtest'
'makedir' is not recognized as an internal or external command,
operable program or batch file.
mingw32-make.exe[1]: *** [makeDirStep] Error 1
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
<built-in>:0: fatal error: opening dependency file ./Debug/main.o.d: No such file or directory
compilation terminated.
mingw32-make.exe[1]: *** [Debug/main.o.d] Error 1
mingw32-make.exe[1]: Leaving directory `C:/Users/john/DEV/C/CLtest'
mingw32-make.exe: *** [All] Error 2
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: FLTK with CodeLite

Post by eranif »

Hacker John wrote: I'm afraid the option 'Open Shell at File Path' does not appear when I right-click the main.cpp file.
It does exists, you need to right click the files' tab (not the file on the tree view)

Sorry for not mentioning it earlier

Eran
Make sure you have read the HOW TO POST thread
Hacker John
CodeLite Enthusiast
Posts: 19
Joined: Tue Aug 16, 2011 11:31 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: FLTK with CodeLite

Post by Hacker John »

Oooops! Silly me.

<Kicks self very hard up the backside>

We have a result - doing it at the command line compiles and gives me an executable.

UPDATE: From Codelite, "Build project" doesn't work but "Build Workspace" does. Should I have been using Build Workspace all this time?

It doesn't seem to work for wxWidgets though

Code: Select all

----------Build Started--------
C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 2 -f "myapp.mk"  all"
----------Building project:[ myapp - Debug ]----------
mingw32-make.exe: *** [Debug/gui.o.d] Error 1
mingw32-make.exe: *** Waiting for unfinished jobs....
mingw32-make.exe: *** [Debug/main.o.d] Error 1
----------Build Ended----------
0 errors, 0 warnings
Hacker John
CodeLite Enthusiast
Posts: 19
Joined: Tue Aug 16, 2011 11:31 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: FLTK with CodeLite

Post by Hacker John »

Bump!
tetragono
CodeLite Curious
Posts: 3
Joined: Thu Sep 17, 2009 1:30 am
Contact:

Re: FLTK with CodeLite

Post by tetragono »

Hi.
Did you see in the build tab (the one on the bottom left corner) if the build ended successfully?
Because I have the same problem as you, with fltk 1.3; I found that even though codelite says "build successfully" in the window with the triangle icon with a "!" inside (i.e.: errors), if I push the build window button, there's an unresolved reference in libfltk_images.a to Fl_Shared_Image that the error window doesn't show. That is the reason there's no executable.
So: the undefined reference is my or fltk 1.3 fault.
But codelite should show this error instead saying "Build successfully". It happens to me with both 2.9.0.4684 and 2.10 Win version of codelite with the bundled mingw (4.4.1).
Hope that this can help you.
Thanks for this great IDE, Eran.

Bye

Sim
Hacker John
CodeLite Enthusiast
Posts: 19
Joined: Tue Aug 16, 2011 11:31 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: FLTK with CodeLite

Post by Hacker John »

Hi Tetrango, I'm getting a failure to build with everything, not just FLTK. I can build from the command line as directed by eran but I just can't seem to build from the IDE, full stop.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: FLTK with CodeLite

Post by eranif »

tetragono wrote:Because I have the same problem as you, with fltk 1.3; I found that even though codelite says "build successfully" in the window with the triangle icon with a "!" inside (i.e.: errors), if I push the build window button, there's an unresolved reference in libfltk_images.a to Fl_Shared_Image that the error window doesn't show. That is the reason there's no executable.
This is a different error. The regex probably does not cover that link errors. If you are getting such errors, please make sure to post the entire build output

Eran
Make sure you have read the HOW TO POST thread
tetragono
CodeLite Curious
Posts: 3
Joined: Thu Sep 17, 2009 1:30 am
Contact:

Re: FLTK with CodeLite

Post by tetragono »

Hi.
This what I get in the build window even if I get "Build successfull" in the errors window:

Code: Select all

----------Build Started--------
C:\WINDOWS\system32\cmd.exe /c ""mingw32-make.exe"  -j 2 -f "ticpp_wsp.mk""
----------Building project:[ cap14_stroustrup - Debug ]----------
mingw32-make.exe[1]: Entering directory `C:/Documents and Settings/SimBa/Documenti/prove/mio_prog/c++ex/thinkingCPP/ticpp/cap14_stroustrup'
g++ -c  "C:/Documents and Settings/SimBa/Documenti/prove/mio_prog/c++ex/thinkingCPP/ticpp/cap14_stroustrup/main.cpp" -g -mwindows -DWIN32 -DUSE_OPENGL32 -mno-cygwin  -D_THREAD_SAFE -D_REENTRANT  -o ./Debug/main.o -I. -IC:\msys\1.0\local\include -IC:\msys\1.0\local\include/FL/images 
g++ -c  "C:/Documents and Settings/SimBa/Documenti/prove/mio_prog/c++ex/thinkingCPP/ticpp/cap14_stroustrup/Simple_window.cpp" -g -mwindows -DWIN32 -DUSE_OPENGL32 -mno-cygwin  -D_THREAD_SAFE -D_REENTRANT  -o ./Debug/Simple_window.o -I. -IC:\msys\1.0\local\include -IC:\msys\1.0\local\include/FL/images 
g++ -c  "C:/Documents and Settings/SimBa/Documenti/prove/mio_prog/c++ex/thinkingCPP/ticpp/cap14_stroustrup/Window.cpp" -g -mwindows -DWIN32 -DUSE_OPENGL32 -mno-cygwin  -D_THREAD_SAFE -D_REENTRANT  -o ./Debug/Window.o -I. -IC:\msys\1.0\local\include -IC:\msys\1.0\local\include/FL/images 
g++ -c  "C:/Documents and Settings/SimBa/Documenti/prove/mio_prog/c++ex/thinkingCPP/ticpp/cap14_stroustrup/Graph.cpp" -g -mwindows -DWIN32 -DUSE_OPENGL32 -mno-cygwin  -D_THREAD_SAFE -D_REENTRANT  -o ./Debug/Graph.o -I. -IC:\msys\1.0\local\include -IC:\msys\1.0\local\include/FL/images 
g++ -c  "C:/Documents and Settings/SimBa/Documenti/prove/mio_prog/c++ex/thinkingCPP/ticpp/cap14_stroustrup/GUI.cpp" -g -mwindows -DWIN32 -DUSE_OPENGL32 -mno-cygwin  -D_THREAD_SAFE -D_REENTRANT  -o ./Debug/GUI.o -I. -IC:\msys\1.0\local\include -IC:\msys\1.0\local\include/FL/images 
g++ -o ./Debug/cap14_stroustrup ./Debug/main.o ./Debug/Simple_window.o ./Debug/Window.o ./Debug/Graph.o ./Debug/GUI.o  -L. -LC:\msys\1.0\local\lib -LC:\MinGW/lib  -lfltk -lfltk_forms -lfltk_gl -lfltk_images -lfltk_jpeg -lfltk_png -lfltk_z  -mwindows -mno-cygwin -lglu32 -lopengl32 -lpthread -lole32 -luuid -lcomctl32 -static-libgcc
C:\msys\1.0\local\lib/libfltk_images.a(Fl_JPEG_Image.o):Fl_JPEG_Image.cxx:(.text+0x3aa): undefined reference to `Fl_Shared_Image::Fl_Shared_Image(char const*, Fl_Image*)'
C:\msys\1.0\local\lib/libfltk_images.a(Fl_JPEG_Image.o):Fl_JPEG_Image.cxx:(.text+0x3b2): undefined reference to `Fl_Shared_Image::add()'
C:\msys\1.0\local\lib/libfltk_images.a(Fl_JPEG_Image.o):Fl_JPEG_Image.cxx:(.text+0x6da): undefined reference to `Fl_Shared_Image::Fl_Shared_Image(char const*, Fl_Image*)'
C:\msys\1.0\local\lib/libfltk_images.a(Fl_JPEG_Image.o):Fl_JPEG_Image.cxx:(.text+0x6e2): undefined reference to `Fl_Shared_Image::add()'
C:\MinGW/lib/libmingw32.a(tlssup.o):tlssup.c:(.text+0x15f): undefined reference to `FreeLibrary@4'
collect2: ld returned 1 exit status
mingw32-make.exe[1]: *** [Debug/cap14_stroustrup] Error 1
mingw32-make.exe: *** [All] Error 2
Thanks a lot.

Bye

Sim
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: FLTK with CodeLite

Post by eranif »

Go to:

'Settings | Build Settings | Compilers | gnu g++ | patterns'

Under the 'Compiler Errors Patterns' click the 'Add' button.

In the dialog that opens, type:
Regex pattern: undefined reference to
file index: 0
line number index: 0

Close the dialog
Build your project again

Eran
Make sure you have read the HOW TO POST thread
Post Reply