Author Topic: wxWindows-2.4.2 problem....  (Read 8826 times)

robal

  • Guest
wxWindows-2.4.2 problem....
« on: June 10, 2005, 11:02:43 pm »
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?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
wxWindows-2.4.2 problem....
« Reply #1 on: June 11, 2005, 12:02:45 am »
Hmmmmmmmm

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

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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
wxWindows-2.4.2 problem....
« Reply #2 on: June 11, 2005, 09:35:03 am »
Check the resource compiler's dirs...

Yiannis.
Be patient!
This bug will be fixed soon...

Matroc

  • Guest
wxWindows-2.4.2 problem....
« Reply #3 on: June 11, 2005, 12:20:14 pm »
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%

        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);
        }
        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 :-)

        Offline rickg22

        • Lives here!
        • ****
        • Posts: 2283
        wxWindows-2.4.2 problem....
        « Reply #4 on: June 12, 2005, 01:29:41 am »
        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).


         :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?).

        Matroc

        • Guest
        wxWindows-2.4.2 problem....
        « Reply #5 on: June 12, 2005, 10:46:00 am »
        well, yeah i can reproduce them, importing the wx.dsw causes hundrets of them for me...

        //edit
        i just noticed: importing the wx_dll.sln file is even worse, it seems to try to read a null pointer somewhere, crashing c::b immediately (can be reproduced too ;-)

        Offline David Perfors

        • Developer
        • Lives here!
        • *****
        • Posts: 560
        wxWindows-2.4.2 problem....
        « Reply #6 on: June 12, 2005, 02:54:23 pm »
        I can't reproduce it... or should I try to compile first? I tried the wx.dsw. (with C::B 1.0finalbeta, Mingw, Windows XP.) I can't try that sln file, because I don't have it.
        OS: winXP
        Compiler: mingw
        IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

        Anonymous

        • Guest
        wxWindows-2.4.2 problem....
        « Reply #7 on: June 13, 2005, 10:11:44 am »
        Resolution was simple, as mandrav said it was enough to set compilers resource directories and wxWidgets is building. But when i try to link it with my own program i get few hundreds linker errors about unresolved external symbols (for example Mutex::Unlock(void)).

        Offline rickg22

        • Lives here!
        • ****
        • Posts: 2283
        wxWindows-2.4.2 problem....
        « Reply #8 on: June 13, 2005, 06:12:12 pm »
        Matroc: Null pointers are EASY to diagnose! :D Run codeblocks in "debug mode" and wait for the segfault. Then do a backtrace and paste the results in a new bug report.