Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo zusammen.

Ich versuche scho seit Stunden den C++ Wrapper von PCRE (Pascal C.... Regular Expression) zum laufen zu bringen (Linux!).

Das Problem is mmer an den Methoden FullMatch(..) / PartialMatch(...).

Laut der man site sollte es ja recht einfach sein.

pcrecpp::RE("ell").PartialMatch("hello");

Is ja verständlich wass dies macht.

Jedoch wenn ich es compiliere kommt folgende Fehlermeldung:

undefined reference to `pcrecpp::RE::PartialMatch(pcrecpp::StringPiece const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&, pcrecpp::Arg const&) const'

Ich versteh dat nisch .... will mich pcrecpp ********en?

Oder muss ich hierbei noch etwas holen/konfigurieren?

Wäre nett wenn jemand da weiter weis ....

Danke im vorraus

ich kann ein Objekt vom Typ pcre::RE so wie auch pcre::options (werd ich noch für UTF-8 benötigen, da ja pcre auch mit multibytes auskommt sowiet ich gelesen habe) erstellen.

da das system vorinstalliert ist weiss ich jetz gar nich ob nur der wrapper installiert is oder ob pcre mit automatisch installiert wurde.

wo sollte norm. weisse pcre liegen?

edit:

ich hab mal ein locate pcre gemacht und habe unter /usr/bin/ ein pcretest und pcre-config gefunden.

mit pcretest kann ich sogar testweise re machen -> also muss ja pcre schon installiert sein, oder?

Bearbeitet von Shamharoth

/usr/lib/libpcre.a

/usr/lib/libpcrecpp.so.0

/usr/lib/libpcreposix.so

/usr/lib/libpcre.so

/usr/lib/libpcrecpp.a

/usr/lib/libpcrecpp.so.0.0.0

/usr/lib/libpcreposix.so.3

/usr/lib/libpcre.so.3

/usr/lib/libpcrecpp.so

/usr/lib/libpcreposix.a

/usr/lib/libpcreposix.so.3.12.0

/usr/lib/libpcre.so.3.12.0

so randinfo: ich benutze debian (was ja gern mal mit aktuallität etwas hinterher hinkt ^^)

gaaah danke :upps

Hmmm jetzt habe ich momentan in meiner makefile folgenden linkbefehl

g++ -g -lm -lrt objs/application.o /usr/lib/libpcre.a /usr/lib/libpcrecpp.a lib/application.a -o prog

(Ja es ist selbst eine library (weshalb ich mich doppelt schlagen müsst ... :upps :upps ))

Doch wenn ich das mach bekomme ich folgende Fehler:

/usr/lib/libpcrecpp.a(pcrecpp.o): In function `pcrecpp::RE::NumberOfCapturingGroups() const':

(.text+0xb8f): undefined reference to `pcre_fullinfo'

/usr/lib/libpcrecpp.a(pcrecpp.o): In function `pcrecpp::RE::TryMatch(pcrecpp::StringPiece const&, int, pcrecpp::RE::Anchor, int*, int) const':

(.text+0xc6e): undefined reference to `pcre_exec'

/usr/lib/libpcrecpp.a(pcrecpp.o): In function `pcrecpp::NewlineMode(int)':

(.text+0x1461): undefined reference to `pcre_config'

/usr/lib/libpcrecpp.a(pcrecpp.o): In function `pcrecpp::RE::Compile(pcrecpp::RE::Anchor)':

(.text+0x1b39): undefined reference to `pcre_compile'

/usr/lib/libpcrecpp.a(pcrecpp.o): In function `pcrecpp::RE::Compile(pcrecpp::RE::Anchor)':

(.text+0x1be4): undefined reference to `pcre_compile'

/usr/lib/libpcrecpp.a(pcrecpp.o): In function `pcrecpp::RE::Cleanup()':

(.text+0x1e1b): undefined reference to `pcre_free'

/usr/lib/libpcrecpp.a(pcrecpp.o): In function `pcrecpp::RE::Cleanup()':

(.text+0x1e2b): undefined reference to `pcre_free'

collect2: ld returned 1 exit status

make[1]: *** [prog] Error 1

make: *** [all] Error 2

Bearbeitet von Shamharoth

Hmmm jetzt habe ich momentan in meiner makefile folgenden linkbefehl

g++ -g -lm -lrt objs/application.o /usr/lib/libpcre.a /usr/lib/libpcrecpp.a lib/application.a -o prog

Statt

/usr/lib/libpcre.a /usr/lib/libpcrecpp.a 
bitte
-lpcre -lpcrecpp

Ich glaube, du brauchst auch noch libpcreposix.a.

RIESSEN DANK :)

ich muss mich mal bezüglich libs mehr informieren. ... zuvor hab ich unter windows (vor allem mit der .NET-Umgebung) gearbetet.

evtl. könntest mir diesbezüglich ein Buchtipp geben... evtl. ein C++ Buch für Linux.

Also noch mal RIESSEN dank :uli

Bearbeitet von Shamharoth

evtl. könntest mir diesbezüglich ein Buchtipp geben... evtl. ein C++ Buch für Linux.

Also die generelle Struktur von C++ ist unter Windows und Linux gleich. Die Tools und z.B. die GUI Interfaces unterscheiden sich. Unter Linux würde ich empfehlen dir make, automake usw einmal anzuschauen. Wenn Du cross-plattform arbeiten willst, wäre evtl cmake oder scons noch einen Blick wert.

Zu den Regular Expr: Wäre das nicht auch eine Alternative für Dich?

Boost.Regex

Also die generelle Struktur von C++ ist unter Windows und Linux gleich.

jein .... also was mich vor allem jetz interessiert is bezüglich Systemprogrammierung. z.B. Signale, Sockets, Pipes (Womit ich mich schon etwas beschäftigt habe.. hab eine bidirektionale pipe machen müssen um zw. php und c++ zu kommunizieren ^^)

vor allem auch linux spezifische Funktionen (WideCharToMultiByte gibt es ja als aktuelles Beispiel nich unter Linux).

Bezüglich Boost hab ich schon überlegt (vor allem da Boost ja auch wchar_t und wstring kompatibel ist ... was mich auch wieder etwas verzweifelt: wchar zu multibyte zu konvertieren) jedoch sollte ich erst mal mit den gegebenen libs probieren ;)

jein .... also was mich vor allem jetz interessiert is bezüglich Systemprogrammierung.

Gut, das stand ja nicht im Post. Ich denke da wäre ja wohl eher direkt die Community der Linux Entwickler der Ansprechpartner

Bezüglich Boost hab ich schon überlegt (vor allem da Boost ja auch wchar_t und wstring kompatibel ist ... was mich auch wieder etwas verzweifelt: wchar zu multibyte zu konvertieren) jedoch sollte ich erst mal mit den gegebenen libs probieren ;)

Ich benutze Boost überwiegend wegen der uBlas Strukturen und der Verbindung zur Atlas Lib bzw MPI. Ich habe selten mit "Strings und Zeichverarbeitung" zu tun :-P

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.