User forums > Using Code::Blocks

Code::Blocks command line requires to export DISPLAY

(1/3) > >>

LittleJawa:
I am using Code::Blocks to develop programs that run on both Win32 and Linux.
Then I have two developpment environment, both with Code::Blocks, so that I can switch from one to the other depending on the developpement/debugging issues.
This is perfect, really :-)

Now the bad point...
Sometimes, I just do a simple change on the windows environment, and just want to recompile on the Linux one. I could move to the linux box and log in, but I would rather SSH to it, and do a command-line build. It is far easier and, if I don't need to edit the code, I don't need the graphical environement either.
BUT when I do it, Code::Blocks returns an error saying :

ERROR: Unable to iitialize gtk, is DISPLAY set properly ?

And I cannot go further.

If I use the exact same command line on windows, or on the linux box after login in the X server, then no problem, the build is done. But it opens the build log window, which is probably why I had the error.
Finally, if I install cygwin's X server on my windows box and export the display to it, the build can be done...

This is a problem for me, because my team is preparing to use a build server for the team work, and this build server will not have an X server installed. Then this mean I would not be able to make it build my Code::Blocks projects.
Would it be possible to add an option on command line that says : "I don't want ANY window to get opened" or something like that ?

Regards,
LittleJawa

LittleJawa:

 I have retrieved C::B source code and looked at it.
 It seems that separating the graphical part from the build part of C::B is really complicated... All the main classes of C::B are derived from wxWidget classes, so it is not possible to load a small subset of the application without having to load/initialize a graphical display of some sort...
 Then having the batch build work on command line though SSH (without X export) is impossible with the current shape of the project.

 I am in the process of locating what part of C::B I would need to get an external build executable that could interprete C::B project files and do the exact same build... Not sure it is feasable :-(
 The next option is to export my projects settings to Makefiles, but this is something that must be automated anyway.
 If anyone can give me advice or ideas, you're welcome.

LittleJawa:

 I am raising this toppic again, because I have a real need for a "unattended" build.

 My problem actually appears on both Linux and Windows. When I want to use a build software to make scheduled, unattended build, the build process (that calls codeblocks on commandline) is launched by a service. This service have no display (neither on Windows or Linux). On Linux, this makes the process exit. On windows, it just hangs.

 I have tried to set the commandline option that removes the splash screen, but it doesn't help : CodeBlocks' batch process tries to display the log in a new window whatever you do, and it seems to be the cause of the problem.
 On Linux, I was able to cheat by creating a fake X server (using Xvfb) and redirecting the session's DISPLAY to it, but on Windows, I have no clue of what I can do to make the unattended build :-(

 Does anyone have done this successfully ? Do you have any idea I should try ?
 I really appreciate the use of CodeBlocks, but if I fail to use it for builds, I'll have to return to Makefile and the like, with different behavior/setup for each OS, and I really don't want it anymore :-(

 Any help is appreciated.

 Regards,
 Little Jawa

zabzonk:
Couldn't you simply run an X server on your Windows box? I've been doing that for years. There are a lot of such servers available - google for "windows x server" for a list.

LittleJawa:

--- Quote from: zabzonk on October 27, 2009, 11:32:16 am ---Couldn't you simply run an X server on your Windows box? I've been doing that for years. There are a lot of such servers available - google for "windows x server" for a list.

--- End quote ---

How do you make CodeBlocks use an X server on the windows host ?
The windows version of CodeBlocks uses Windows display, how do you change that ?
All the X servers that I've seen on Windows allow you to get the remote display of a linux/unix machine, but I don't remember seeing them display the GUI of a windows app...

Navigation

[0] Message Index

[#] Next page

Go to full version