wxDev.fr, le portail francophone consacré à wxWidgets ! ( The french portal for wxWidgets )  
Esp. membre
Recheche rapide



Recherche avancée
Statistiques
Membres inscrits :2359

Membres en ligne : 0
Invités en ligne : 1

Valid XHTML 1.0 Transitional

Valid CSS2

Menu forum (navigation):
Pages: 1  
 
Accueil » Accueil forums » Utilisation générale wxWidgets
» undefined reference to wx_regfree
Conversation (Résolue) : undefined reference to wx_regfree
12-09-2013 21:00:48  undefined reference to wx_regfree #1
Ded (Membre)
Lieu: Grenoble (38)
Inscrit le : 09-09-2013
Messages: 41
Snippets: 0
Tutoriels: 0
Hors ligne
J'ai besion de regexp alors comme je ne trouve pas de sample avec j'ai récupéré un petit bout de code pour tester la base.

Pour commencer j'include "wx/regex.h"

Ensuite je compile ce bout de code :

Code:

 
void Process_File ( wxString SrcDir_path, wxString DestDir_path, wxString FileName)
{
    wxString New_FileName;
    New_FileName = FileName;
 
    wxRegEx re(wxT("\.mp3"),wxRE_ADVANCED|wxRE_ICASE);
    if(re.IsValid() && re.Matches(New_FileName))
    {
        int replaced = re.ReplaceAll(&FileName, wxT("\.txt"));
    }
 
    wxCopyFile(wxString::Format("%s\\%s",SrcDir_path,FileName),
               wxString::Format("%s\\%s",DestDir_path,New_FileName),
               1);
}
 

et j'obtiens ce build log :

Code:

 
 
-------------- Clean: Release in p-09-12-16-45 (compiler: GNU GCC Compiler)---------------
 
Cleaned "p-09-12-16-45 - Release"
 
-------------- Build: Release in p-09-12-16-45 (compiler: GNU GCC Compiler)---------------
 
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wno-attributes -Wall  -O2    -ID:\CPP\wxBook\wxWidgets-2.9.5\include -ID:\CPP\wxBook\wxWidgets-2.9.5\contrib\include -ID:\CPP\wxBook\wxWidgets-2.9.5\lib\gcc_lib\mswu -ID:\CPP\wxBook\wxWidgets-2.9.5\lib\gcc_lib\mswu -ID:\CPP\wxBook\wxWidgets-2.9.5\include  -c D:\wxWidgetsApp\p-09-12-16-45\p_09_12_16_45Main.cpp -o obj\Release\p_09_12_16_45Main.o
D:\wxWidgetsApp\p-09-12-16-45\p_09_12_16_45Main.cpp: In member function 'void MyFrame::OnGo(wxCommandEvent&)':
D:\wxWidgetsApp\p-09-12-16-45\p_09_12_16_45Main.cpp:241:44: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
D:\wxWidgetsApp\p-09-12-16-45\p_09_12_16_45Main.cpp: In function 'void Process_File(wxString, wxString, wxString)':
D:\wxWidgetsApp\p-09-12-16-45\p_09_12_16_45Main.cpp:331:1: warning: unknown escape sequence: '\.' [enabled by default]
D:\wxWidgetsApp\p-09-12-16-45\p_09_12_16_45Main.cpp:334:1: warning: unknown escape sequence: '\.' [enabled by default]
D:\wxWidgetsApp\p-09-12-16-45\p_09_12_16_45Main.cpp:334:13: warning: unused variable 'replaced' [-Wunused-variable]
mingw32-g++.exe -LD:\CPP\wxBook\wxWidgets-2.9.5\lib\gcc_lib  -o bin\Release\p-09-12-16-45.exe obj\Release\p_09_12_16_45Main.o   -s -mthreads  -lwxmsw29u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32  -mwindows
D:\CPP\wxBook\wxWidgets-2.9.5\lib\gcc_lib/libwxmsw29u.a(monolib_regex.o):regex.cpp:(.text+0x120): undefined reference to `wx_regfree'
D:\CPP\wxBook\wxWidgets-2.9.5\lib\gcc_lib/libwxmsw29u.a(monolib_regex.o):regex.cpp:(.text+0x3dc): undefined reference to `wx_regfree'
D:\CPP\wxBook\wxWidgets-2.9.5\lib\gcc_lib/libwxmsw29u.a(monolib_regex.o):regex.cpp:(.text+0x5f5): undefined reference to `wx_regerror'
D:\CPP\wxBook\wxWidgets-2.9.5\lib\gcc_lib/libwxmsw29u.a(monolib_regex.o):regex.cpp:(.text+0x634): undefined reference to `wx_regerror'
D:\CPP\wxBook\wxWidgets-2.9.5\lib\gcc_lib/libwxmsw29u.a(monolib_regex.o):regex.cpp:(.text+0xccb): undefined reference to `wx_re_comp'
D:\CPP\wxBook\wxWidgets-2.9.5\lib\gcc_lib/libwxmsw29u.a(monolib_regex.o):regex.cpp:(.text+0xd2c): undefined reference to `wx_regfree'
D:\CPP\wxBook\wxWidgets-2.9.5\lib\gcc_lib/libwxmsw29u.a(monolib_regex.o):regex.cpp:(.text+0x1e24): undefined reference to `wx_regfree'
D:\CPP\wxBook\wxWidgets-2.9.5\lib\gcc_lib/libwxmsw29u.a(monolib_regex.o):regex.cpp:(.text+0x1fab): undefined reference to `wx_re_exec'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 5 seconds)
8 errors, 4 warnings (0 minutes, 5 seconds)
 

Où est l'erreur ?
Un include qui manque ?

Merci d'avance.

Code::Blocks 13.12 on Windows 7 (build 7601 service pack 1 64 bit edition).
GNU GCC version 4.7.1 -std=c++11 Make version 3.82.
wxWidgets 3.0.0 compiled shared=0 monolithic=1 unicode=1 build=release.
12-09-2013 21:09:21  Re: undefined reference to wx_regfree #2
Xaviou (Administrateur)
Lieu: Annecy (74)
Inscrit le : 27-08-2007
Messages: 1375
Snippets: 25
Tutoriels: 6
Site web
Hors ligne
Il te manque juste la lib libwxregexu.a dans les options du linker.

@+
Xav'

Le nouveau portail wxWidgets francophone : www.wxdev.fr
Ben en fait, vous y êtes déjà...
12-09-2013 21:13:11  Re: undefined reference to wx_regfree #3
Ded (Membre)
Lieu: Grenoble (38)
Inscrit le : 09-09-2013
Messages: 41
Snippets: 0
Tutoriels: 0
Hors ligne
Merci Xaviou.

Code::Blocks 13.12 on Windows 7 (build 7601 service pack 1 64 bit edition).
GNU GCC version 4.7.1 -std=c++11 Make version 3.82.
wxWidgets 3.0.0 compiled shared=0 monolithic=1 unicode=1 build=release.
Menu forum (navigation):
Pages: 1  
 
Accueil » Accueil forums » Utilisation générale wxWidgets
» undefined reference to wx_regfree