User forums > Help

wxWindows-2.4.2 problem....

(1/2) > >>

robal:
Hi
I try to compile wxWidgets-2.4.2 version to static linke library (both debug and release). I have downloaded VC2003 toolkit and set it as default compiler. I imported dsw workspace into code::blocks and during compilation i have message:

msw\version.rc    12    fatal error RC1015: cannot open include file "wx/version.h",

 what is very strage, because such file existing in appropriate path. Maybe have you some ideas about that?

rickg22:
Hmmmmmmmm

I never built wxwidgets using code::blocks. Instead i use the makefiles.

But the dsw workspace should have been imported correctly...

mandrav:
Check the resource compiler's dirs...

Yiannis.

Matroc:
Well i just tried to import the wxWidgets 2.6.1 dsw to try if it works this way but even on importing there is a lot of errors saying hat heres not enough memory for creating a thread (on an  1gb ram machine).

and the created projects have default compiler/linker settings for all targets

even in the wx_dll.dsw, all projects are seup to create only statically linked librarys.

i dont think c::b is the way to compile wx...


but the makefile too makes some trouble (that can be fixed though)

ill post just a brief howto compile here, maybe someone can make use of it:

1. get the following things
msvctoolkit 2k3[/list:u]MS Platform SDK this one is for all windows versions up to server 2k3 (i havnt tried to compile using this one instead of an old one but it should make no problems)[/list:u]the NMAKE tool[/list:u]and a replacement for the lib.exe (described below)[/list:u]

ok, lets begin with the installation of the above, the order shouldnt matter:

vc tooklit:
this should be pretty easy: install it first
then you need to set your environment variables (im sorry but i cant describe this one here because im using a foreign version of windows ;-) to contain the bin directory in the %path% variable, the include directory in %include% and the lib directiry in %lib% (you may need to create some of these variables)

platform sdk:
this should be the same as above :-)

nmake:
just extract them by executing the downloaded exe and put the extracted files to some folder included in your %path% variable (like the platform sdk\bin directory)

lib.exe:
there are 2 ways to solve the missing lib.exe problem:
1. create a text file in a %path% directory and rename it to "lib.bat", then put the following text into it

--- Code: ---@echo off
SET LIB_ARGUMENTS=/LIB
:LIB_ARG_LOOP
IF $%1$ == $$ GOTO LIB_RUN
SET LIB_ARGUMENTS=%LIB_ARGUMENTS% %1
SHIFT
GOTO LIB_ARG_LOOP
:LIB_RUN
link %LIB_ARGUMENTS%
--- End code ---

the downside of this method is that some librarys (not wxwidgets) wont compile with this, because they're searching for an lib.EXE.
but theres another solution o this problem: make your own lib.exe ;-)
create a new simple c++ project, paste the following code and compile
--- Code: ---/*
 * lib.c
 *
 * simulate missing lib.exe by calling link.exe /lib
 */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

static int
findInPath (
    char * fullpath,
    const char * executable)
{
    const char * pathvar = getenv ("PATH");
    const char * dirstart = pathvar;
    const char * dirend;
    int          dirlen;
    FILE       * dummy;

    if (pathvar == NULL) {
        return 0;
    }
    while (dirstart [0] != '\0') {
        dirend = strchr (dirstart, ';');
        if (dirend == NULL) {
            dirlen = strlen (dirstart);
        }
        else {
            dirlen = dirend - dirstart;
        }
        sprintf (fullpath, "%.*s\\%s", dirlen, dirstart, executable);
        dummy = fopen (fullpath, "rb");
        if (dummy != NULL) {
            fclose (dummy);
            return 1;
        }
        if (dirend == NULL) {
            return 0;
        }
        dirstart = dirend + 1;
    }
    return 0;
}

int main (
    int argc,
    const char ** argv)
{
    char fullpath [255];
    char ** newargs;
    if (!findInPath (fullpath, "link.exe")) {
        fprintf (stderr, "lib.exe: link.exe not found in %PATH%\n");
        exit (2);
    }
    newargs = calloc (argc + 2, sizeof (char*));
    if (newargs == NULL) {
        fprintf (stderr, "lib.exe: allocation of arguments failed\n");
        exit (2);
    }
    memcpy (newargs + 2, argv + 1, (argc - 1) * sizeof (char *));
    newargs [0] = "link.exe";
    newargs [1] = "/lib";
    execv (fullpath, newargs);
}

--- End code ---
note: this and the lib.bat are NOT my creations, i pulled them from another side but cant remember the url :-/


this should be everything thats needed to build wxWidgets.
now edit yout setup.h (located in %WXWIN%\include\wx\msw, and dont forget to copy it to %WXWIN%\include\wx) and your config.vc (located in %WXWIN%\build\msw) to suit your needs ande compile by typing "nmake -f makefile.vc" on the console in the %WXWIN%\build\msw directory.

now lean back and watch your wx libs to compile :-)

rickg22:

--- Quote from: Matroc ---Well i just tried to import the wxWidgets 2.6.1 dsw to try if it works this way but even on importing there is a lot of errors saying hat heres not enough memory for creating a thread (on an  1gb ram machine).
--- End quote ---


 :shock: Oh no! The "cannot create thread (error 8 ) " strikes again!!

Can you REPRODUCE that error? We've been trying to replicate it without success for MONTHS. And I have the hunch that it only happens when imported workspaces can't find a particular file (creating a thread for a nonexistent file, maybe?).

Navigation

[0] Message Index

[#] Next page

Go to full version