It is currently Fri Nov 17, 2017 4:08 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Mon Sep 16, 2013 11:52 pm 
Offline

Joined: Sun Sep 08, 2013 7:03 pm
Posts: 45
lidnariq wrote:
Imperial wrote:
I'm sure there's a tool in BSD-land somewhere that can open deb packages
They're AR chives. 7z also can unpack them.
Naively you could do something like ar p foo.deb data.tar.gz | bsdtar xzvf -

Fantastic! Thank you lidnariq.

(EDIT:) It seems to work well with the wine-dev headers, if with warnings. So that's good! But then it gets to FFT/Fft.cpp and throws another error:
Code:
In file included from Source/FFT/Fft.h:9,
                 from Source/FFT/Fft.cpp:9:
Source/FFT/Complex.h:45:7: warning: no newline at end of file
In file included from Source/FFT/Fft.cpp:9:
Source/FFT/Fft.h:62: error: expected unqualified-id before numeric constant
Source/FFT/Fft.h:62: error: expected ';' before numeric constant
Source/FFT/Fft.h: In member function 'double Fft::GetIntensity(int) const':
Source/FFT/Fft.h:26: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.h: In member function 'void Fft::PutAt(int, double)':
Source/FFT/Fft.h:54: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.cpp: In constructor 'Fft::Fft(int, long int)':
Source/FFT/Fft.cpp:41: error: lvalue required as left operand of assignment
Source/FFT/Fft.cpp: In destructor 'Fft::~Fft()':
Source/FFT/Fft.cpp:85: error: type 'int' argument given to 'delete', expected pointer
Source/FFT/Fft.cpp: In member function 'void Fft::Transform()':
Source/FFT/Fft.cpp:147: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.cpp:148: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.cpp:148: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.cpp:149: error: invalid types 'int[int]' for array subscript
Source/FFT/Fft.cpp:150: error: invalid types 'int[int]' for array subscript
gmake: *** [Fft.o] Error 1


It is having trouble with Fft::_X, an array of Complex's. Have you gotten this error, or anything like it?


Top
 Profile  
 
PostPosted: Tue Sep 17, 2013 8:49 am 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1049
Location: Minneapolis, MN
Imperial wrote:
Source/FFT/Fft.h:62: error: expected unqualified-id before numeric constant
Source/FFT/Fft.h:62: error: expected ';' before numeric constant

It is having trouble with Fft::_X, an array of Complex's. Have you gotten this error, or anything like it?

No I haven't seen this error. But from the error it seems that perhaps something in the compile chain is #define'ing Complex as a numeric value. I can't look right now to see where else Complex class might be used, but you could try renaming the class to ComplexFT or something else. If that fixes this then we should post that as a bug/cross-platform issue to jsr so he can adjust the MFC source for future drops.


Top
 Profile  
 
PostPosted: Tue Sep 17, 2013 10:44 pm 
Offline

Joined: Sun Sep 08, 2013 7:03 pm
Posts: 45
cpow wrote:
Imperial wrote:
Source/FFT/Fft.h:62: error: expected unqualified-id before numeric constant
Source/FFT/Fft.h:62: error: expected ';' before numeric constant

It is having trouble with Fft::_X, an array of Complex's. Have you gotten this error, or anything like it?

No I haven't seen this error. But from the error it seems that perhaps something in the compile chain is #define'ing Complex as a numeric value. I can't look right now to see where else Complex class might be used, but you could try renaming the class to ComplexFT or something else. If that fixes this then we should post that as a bug/cross-platform issue to jsr so he can adjust the MFC source for future drops.
I did try renaming it to CComplex, but the error was the same. If you Google this error, there are a few threads on stackoverflow, etc., and the solution is a missing semicolon. But I can't find a missing semicolon anywhere in FFT/*.


Top
 Profile  
 
PostPosted: Tue Sep 17, 2013 11:15 pm 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1049
Location: Minneapolis, MN
Imperial wrote:
cpow wrote:
Imperial wrote:
Source/FFT/Fft.h:62: error: expected unqualified-id before numeric constant
Source/FFT/Fft.h:62: error: expected ';' before numeric constant

It is having trouble with Fft::_X, an array of Complex's. Have you gotten this error, or anything like it?

No I haven't seen this error. But from the error it seems that perhaps something in the compile chain is #define'ing Complex as a numeric value. I can't look right now to see where else Complex class might be used, but you could try renaming the class to ComplexFT or something else. If that fixes this then we should post that as a bug/cross-platform issue to jsr so he can adjust the MFC source for future drops.
I did try renaming it to CComplex, but the error was the same. If you Google this error, there are a few threads on stackoverflow, etc., and the solution is a missing semicolon. But I can't find a missing semicolon anywhere in FFT/*.

My bad. Try renaming the _X to something else. *That* is what it is complaining about, not Complex. Something is redefining _X as a number in your toolchain/environment. While you're at it, change _W too...


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 12:39 am 
Offline

Joined: Sun Sep 08, 2013 7:03 pm
Posts: 45
@cpow - Done and done, and onto the next error. :)

Code:
Makefile:2926: warning: overriding recipe for target `install_target'
Makefile:2917: warning: ignoring old recipe for target `install_target'
Makefile:2930: warning: overriding recipe for target `uninstall_target'
Makefile:2921: warning: ignoring old recipe for target `uninstall_target'
g++ -c -pipe -O2 -fno-wrapv  -I/usr/local/include -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/X11R6/include -DXTHREADS -I/usr/include/wine/windows/ -DUSE_WS_PREFIX -DWINE_UNICODE_NATIVE -O2 -fno-wrapv  -Wall -W -Wno-reorder -Wno-unused -pthread -fPIC -DFAMITRACKER_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/lib/qt4/mkspecs/openbsd-g++4 -I. -I/usr/local/include/X11/qt4/QtCore -I/usr/local/include/X11/qt4/QtGui -I/usr/local/include/X11/qt4 -I. -ISource -I../../common -I. -I/usr/local/include -I/home/bjh/include/wine/windows -o Fft.o Source/FFT/Fft.cpp
g++ -c -pipe -O2 -fno-wrapv  -I/usr/local/include -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/X11R6/include -DXTHREADS -I/usr/include/wine/windows/ -DUSE_WS_PREFIX -DWINE_UNICODE_NATIVE -O2 -fno-wrapv  -Wall -W -Wno-reorder -Wno-unused -pthread -fPIC -DFAMITRACKER_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/lib/qt4/mkspecs/openbsd-g++4 -I. -I/usr/local/include/X11/qt4/QtCore -I/usr/local/include/X11/qt4/QtGui -I/usr/local/include/X11/qt4 -I. -ISource -I../../common -I. -I/usr/local/include -I/home/bjh/include/wine/windows -o cqtmfc.o ../../common/cqtmfc.cpp
In file included from ../../common/cqtmfc.cpp:1:
../../common/cqtmfc.h:3645:1: warning: "MB_CANCELTRYCONTINUE" redefined
In file included from /home/bjh/include/wine/windows/windows.h:44,
                 from ../../common/cqtmfc.h:231,
                 from ../../common/cqtmfc.cpp:1:
/home/bjh/include/wine/windows/winuser.h:2621:1: warning: this is the location of the previous definition
../../common/cqtmfc.cpp: In function 'void AfxGetFileTitle(const CHAR*, CHAR*, UINT)':
../../common/cqtmfc.cpp:291: error: unknown escape sequence '\]'
../../common/cqtmfc.cpp: In constructor 'CFrameWnd::CFrameWnd(CWnd*)':
../../common/cqtmfc.cpp:5533: warning: comparison between signed and unsigned integer expressions
../../common/cqtmfc.cpp: In member function 'void CToolBar::SetButtonStyle(int, UINT)':
../../common/cqtmfc.cpp:5911: warning: too few arguments for format
../../common/cqtmfc.cpp: In member function 'BOOL CCmdUI::DoUpdate(CCmdTarget*, BOOL)':
../../common/cqtmfc.cpp:9366: warning: empty body in an if-statement
gmake: *** [cqtmfc.o] Error 1

At line 291 of cqtmfc.cpp (is that your code?), there is this:
Code:
$ echo 291 | ed ../../common/cqtmfc.cpp
217285
   str = str.right(str.length()-str.lastIndexOf(QRegExp("[/\\\]")));

One two many \'s? I don't know what this regex is for, but I changed it to "[/\\]" so it would compile. I don't know what effect this will have. And also, I'm getting a lot of redefinition warnings for MB_CANCELTRYCONTINUE.

Now here's the good news. :) It's still compiling. If this works, you just found a great way to compile Windows MFC code on systems that do support Qt but don't support even Wine. That deserves its own repository.

Aaaaand still compiling libs/famitracker. C++, gotta love it. EDIT: libfamitracker.so.1.0 compiled! :) Onto apps/famitracker.


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 1:17 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
I can't help with the overall "stuff" being discussed here (no familiarity with Qt), but quickly read up on QRegExp. But, re:

Code:
str = str.right(str.length()-str.lastIndexOf(QRegExp("[/\\\]")));

The regex in question does look to contain one too many backslashes -- and how that compiled at all for anyone is beyond me (shame on whoever wrote that parser!). The fixed regex in English would read "match the character slash (/) or backslash (\)". If the individual really did mean to say in addition "... or close-bracket (])" then that should have been QRegExp("[/\\\]]")

Also, I urge whoever's writing that code to read this and be aware of the performance hit. It appears QRegExp is really quite awful performance-wise compared to PCRE (or just change the code to just look for '/' or '\' using other means than a regex engine; come on this is easy :P): http://blog.rburchell.com/2011/12/why-i ... nd-so.html


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 1:18 am 
Offline

Joined: Sun Sep 08, 2013 7:03 pm
Posts: 45
Apps/famitracker:

Code:
/usr/local/lib/libglib-2.0.so.3400.0: warning: stpcpy() is dangerous GNU crap; don't use it
mainwindow.o(.text+0xef): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'
mainwindow.o(.text+0xf6): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'
mainwindow.o(.text+0x13f): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'
mainwindow.o(.text+0x146): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'
mainwindow.o(.text+0x16f): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'
mainwindow.o(.text+0x176): more undefined references to `vtable for MainWindow' follow
collect2: ld returned 1 exit status
gmake: *** [famitracker] Error 1
I love that warning for "dangerous GNU crap". :) I also looked up this "undefined reference to vtable" error, which pulled up this thread. Unfortunately, reordering the object files doesn't seem to have any effect. Same error. But, we're close.


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 1:22 am 
Offline

Joined: Sun Sep 08, 2013 7:03 pm
Posts: 45
koitsu wrote:
I can't help with the overall "stuff" being discussed here (no familiarity with Qt), but quickly read up on QRegExp. But, re:

Code:
str = str.right(str.length()-str.lastIndexOf(QRegExp("[/\\\]")));

The regex in question does look to contain one too many backslashes -- and how that compiled at all for anyone is beyond me (shame on whoever wrote that parser!). The fixed regex in English would read "match the character slash (/) or backslash (\)". If the individual really did mean to say in addition "... or close-bracket (])" then that should have been QRegExp("[/\\\]]")

Also, I urge whoever's writing that code to read this and be aware of the performance hit. It appears QRegExp is really quite awful performance-wise compared to PCRE (or just change the code to just look for '/' or '\' using other means than a regex engine; come on this is easy :P): http://blog.rburchell.com/2011/12/why-i ... nd-so.html

Noted. :) Thank you!


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 1:35 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
Imperial wrote:
Code:
/usr/local/lib/libglib-2.0.so.3400.0: warning: stpcpy() is dangerous GNU crap; don't use it

RL LOL -- that warning is stupid. The glib folks (assuming it's coming from them -- maybe it's coming from the compiler) should be ashamed. stpcpy() is POSIX compliant (specifically POSIX 2008), specifically quoting the FreeBSD man page STANDARDS section:

Quote:
The stpcpy() and stpncpy() functions conform to IEEE Std 1003.1-2008 (``POSIX.1'').


stpcpy() returns a pointer to the trailing NULL that was copied into the destination; strcpy() returns a pointer to the start of the beginning of the string copied. If the warning is annoying (and I agree it is), you can accomplish the exact same thing as stpcpy() by using a combination of strcpy() and strrchr() (searching for '\0' in strrchr() -- yes, strrchr(buf, '\0') will work and find the last occurrence of a NULL in buf)).

Quote:
Code:
mainwindow.o(.text+0xef): In function `MainWindow::~MainWindow()':
: undefined reference to `vtable for MainWindow'


This error is weird. Notice that it's not saying "undefined reference to `vtable'", it's saying "...to `vtable for MainWindow'", almost if that long string is a symbol name. What's the code in MainWindow's destructor look like, specifically what mentions of vtable does it have? EDIT: Never mind, once I read what a vtable was, I can see how the error in question make sense. It's just that the visual formatting (use of backtick and apostrophe) don't generally jibe well with me when I see them. Note: this is hardcore C++ bullshit and I do not do C++ (this is a great example why. ;-) ). I had no idea what a vtable was until I read this gobbledegook. Way to make programming confusing for virtually no gain. Check out my hate-on! ;)

You might be getting a lot of these warnings/issues as a result of compiler differences between yourself and the author. g++ -v (assuming it's the g++ compiler being used and not clang) would be useful here from both of you, I think.


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 2:00 am 
Offline

Joined: Sun Sep 08, 2013 7:03 pm
Posts: 45
The vtable error was caused by this:

Code:
class MainWindow : public QMainWindow
{
    Q_OBJECT

Right there. :) This is my first venture with Qt, as well, but a quick search for Q_OBJECT explained that you have to run this header through moc. So I did this: $ moc4 mainwindow.h -o mainwindow.cc. Then I copied the contents of mainwindow.cc, minus #include "mainwindow.h" and the generated comments, right into mainwindow.cpp. Then $ gmake clean; gmake and there it is. :)

FamiTracker on OpenBSD. Tested with Shiru's after_the_rain.ftm. :)


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 2:43 am 
Offline

Joined: Sun Sep 08, 2013 7:03 pm
Posts: 45
koitsu wrote:
Imperial wrote:
Code:
/usr/local/lib/libglib-2.0.so.3400.0: warning: stpcpy() is dangerous GNU crap; don't use it

RL LOL -- that warning is stupid. The glib folks (assuming it's coming from them -- maybe it's coming from the compiler) should be ashamed. stpcpy() is POSIX compliant (specifically POSIX 2008), specifically quoting the FreeBSD man page STANDARDS section:

Quote:
The stpcpy() and stpncpy() functions conform to IEEE Std 1003.1-2008 (``POSIX.1'').


stpcpy() returns a pointer to the trailing NULL that was copied into the destination; strcpy() returns a pointer to the start of the beginning of the string copied. If the warning is annoying (and I agree it is), you can accomplish the exact same thing as stpcpy() by using a combination of strcpy() and strrchr() (searching for '\0' in strrchr() -- yes, strrchr(buf, '\0') will work and find the last occurrence of a NULL in buf)).

I don't know for sure, but that warning sounds like something from Theo de Raadt. :)

Quote:
Note: this is hardcore C++ bullshit and I do not do C++ (this is a great example why. ;-) ).

Oh I can't stand C++. That was my first language, but when I discovered Kernighan & Ritchie's The C Programming Language, and then Roberto Ierusalimschy's Programming in Lua, which is written in the same style, I never wanted to touch C++ again. It is there, and I accept it, because that's life. :)

Quote:
I had no idea what a vtable was until I read this gobbledegook. Way to make programming confusing for virtually no gain. Check out my hate-on! ;)

What language are you more familiar with, then? Vtables aren't unique to C++, of course, and the concept can be crudely mimicked in C.

Quote:
You might be getting a lot of these warnings/issues as a result of compiler differences between yourself and the author. g++ -v (assuming it's the g++ compiler being used and not clang) would be useful here from both of you, I think.

Good point. For posterity, I was able to build all of this with gcc 4.2.1.
Code:
$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd5.3/4.2.1/specs
Target: i386-unknown-openbsd5.3
Configured with: OpenBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070719


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 5:44 am 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1049
Location: Minneapolis, MN
koitsu wrote:
I can't help with the overall "stuff" being discussed here (no familiarity with Qt), but quickly read up on QRegExp. But, re:

Code:
str = str.right(str.length()-str.lastIndexOf(QRegExp("[/\\\]")));

The regex in question does look to contain one too many backslashes -- and how that compiled at all for anyone is beyond me (shame on whoever wrote that parser!). The fixed regex in English would read "match the character slash (/) or backslash (\)". If the individual really did mean to say in addition "... or close-bracket (])" then that should have been QRegExp("[/\\\]]")

Also, I urge whoever's writing that code to read this and be aware of the performance hit. It appears QRegExp is really quite awful performance-wise compared to PCRE (or just change the code to just look for '/' or '\' using other means than a regex engine; come on this is easy :P): http://blog.rburchell.com/2011/12/why-i ... nd-so.html


Thanks for the feedback koitsu. Yes, I wrote the parser. Yes it is meant to match both slashes only. It -- strangely -- compiles in Windows Qt. The function in question is only used once during file saving...so the "performance" isn't terribly concerning here.


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 5:53 am 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1049
Location: Minneapolis, MN
Imperial wrote:
The vtable error was caused by this:

Code:
class MainWindow : public QMainWindow
{
    Q_OBJECT

Right there. :) This is my first venture with Qt, as well, but a quick search for Q_OBJECT explained that you have to run this header through moc. So I did this: $ moc4 mainwindow.h -o mainwindow.cc. Then I copied the contents of mainwindow.cc, minus #include "mainwindow.h" and the generated comments, right into mainwindow.cpp. Then $ gmake clean; gmake and there it is. :)

FamiTracker on OpenBSD. Tested with Shiru's after_the_rain.ftm. :)


Ok first of all...FREAK ON! That's ridiculously cool! Thanks for the effort! Could you do me a favor and post your machine stats and your observations on performance? [I take it since you didn't start out with ... meh it compiles but it sounds like excrement ... that you're happy with how it sounds?]

The Q_OBJECT macro should be automatic when doing qmake/make it should just do what it's supposed to do -- no manual intervention required. That's very strange.

I will cross-post to FamiTracker to have jsr update the MFC Fft.h usage of _X and _W.


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 8:05 am 
Offline

Joined: Sun Sep 08, 2013 7:03 pm
Posts: 45
cpow wrote:
Ok first of all...FREAK ON! That's ridiculously cool! Thanks for the effort!

You're welcome! :)

Quote:
Could you do me a favor and post your machine stats and your observations on performance? [I take it since you didn't start out with ... meh it compiles but it sounds like excrement ... that you're happy with how it sounds?]
I'm on a 2ish-year-old EeePC so I'm not using a power-house over here. :) It doesn't sound fantastic, but I attributed that to the fact that it's Nintendo music. :P Are you saying there's something I could do in the build process to tweak it?

And here ya go. :)
Code:
$ uname -mrs
OpenBSD 5.3 i386
$ dmesg | grep CPU
cpu0: Intel(R) Atom(TM) CPU N270 @ 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz
cpu1: Intel(R) Atom(TM) CPU N270 @ 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz
$ sysctl -a | grep hw.*mem
hw.physmem=1064497152
hw.usermem=1044496384


Quote:
The Q_OBJECT macro should be automatic when doing qmake/make it should just do what it's supposed to do -- no manual intervention required. That's very strange.
I think so, too. I shouldn't have to do anything with generated code, but I did it to make it work.

Quote:
I will cross-post to FamiTracker to have jsr update the MFC Fft.h usage of _X and _W.

That's still weird.

Glad to be of help. :)


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 10:41 am 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1049
Location: Minneapolis, MN
Imperial wrote:
I'm on a 2ish-year-old EeePC so I'm not using a power-house over here. :) It doesn't sound fantastic, but I attributed that to the fact that it's Nintendo music. :P Are you saying there's something I could do in the build process to tweak it?

I am implementing the sound configuration dialog which gives the option to expand the audio buffer and change the sampling rate/size.

Perhaps you could do a quality comparison between a You-Tube video of a FamiTracker song playing and Qt FamiTracker? I'm just not sure what "doesn't sound fantastic means" but I'm very curious. Or...if there's a song that you *know* what it *should* sound like let me know if it *doesn't* sound like that. The reason I ask is because Tepples has had sound quality issues [earlier in this thread]. I am thinking it's partly due to unoptimal drawing routines. [I am emulating GDI/MFC on top of Qt QPainter...]

Quote:
I think so, too. I shouldn't have to do anything with generated code, but I did it to make it work.

Maybe you could try blowing away all generated stuff [debug/, release/, all Makefile*'s] and doing a fresh qmake/make?

Quote:
Quote:
I will cross-post to FamiTracker to have jsr update the MFC Fft.h usage of _X and _W.

That's still weird.

I agree...maybe you can run Fft.cpp through the preprocessor (-E switch?) and see what it is doing to the Fft.h/Complex.h headers it's including?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group