• What do you need help with? V. 3.0
    4,884 replies, posted
Does anyone know if i can build stuff in cygwen (with linux makefiles) and then use it in MinGW? I have a couple of libraries that only include makefiles :/ Also is it possible to create a single makefile that would build both static and dynamic release and debug files with CMAKE?
[QUOTE=Richy19;31366159]Does anyone know if i can build stuff in cygwen (with linux makefiles) and then use it in MinGW? I have a couple of libraries that only include makefiles :/[/QUOTE] Do you mean Cygwin? I'm sure IDEs do that automaticly. [editline]27th July 2011[/editline] I'm PRETTY sure*
[QUOTE=Map in a box;31366170]Do you mean Cygwin? I'm sure IDEs do that automaticly.[/QUOTE] Yea Cygwin, the problem is I only have linux makefiles, so I cant build it in anything else
What do you mean? What are you trying to compile?
well glew for example only has makefiles and VC6 project, I tried importing the vc6 into codeblocks but it didnt seem to work
Mmm, I don't use codeblocks so I won't beable to help you. Good luck, though. Since the people at stack exchange are being super helpful, I'll ask here. How would I make a bootloader in the Eclipse IDE?
[QUOTE=ROBO_DONUT;31361710]If you're writing a codec or running some sort of feedback loop, you probably can't afford that overhead.[/QUOTE] Smart pointers don't incur [i]that[/i] much overhead. And if you're writing a real-time application where any unplanned delay is problematic, C++ is a poor choice anyway.
[QUOTE=Wyzard;31367004]Smart pointers don't incur [i]that[/i] much overhead. And if you're writing a real-time application where any unplanned delay is problematic, C++ is a poor choice anyway.[/QUOTE] Why would pointers have any delay in the first place?(compared to normal variable getting)
[QUOTE=Map in a box;31367022]Why would pointers have any delay in the first place?(compared to normal variable getting)[/QUOTE] [I]Smart[/I] pointers. The kind that automatically get rid of the object they point to when they get out of scope, etc.
[QUOTE=esalaka;31367145][I]Smart[/I] pointers. The kind that automatically get rid of the object they point to when they get out of scope, etc.[/QUOTE] Didn't think about smart pointers. But still, not much overhead.
[QUOTE=Richy19;31366159]Does anyone know if i can build stuff in cygwen (with linux makefiles) and then use it in MinGW? I have a couple of libraries that only include makefiles :/ Also is it possible to create a single makefile that would build both static and dynamic release and debug files with CMAKE?[/QUOTE] It seems MSYS is what I was looking for
MSYS is nice
[QUOTE=Richy19;31366159]Does anyone know if i can build stuff in cygwen (with linux makefiles) and then use it in MinGW?[/QUOTE] Yes, but you'll need to ship your stuff with cygwin1.dll and other stuff.
How can I change the mouse cursor type (eg to the hand) in .NET when I'm not developing a Windows Forms app?
[QUOTE=Map in a box;31367166]Didn't think about smart pointers. But still, not much overhead.[/QUOTE] It's actually a buttload of overhead. Simple reference counting generally doesn't suffice, as you can have a reference loop and the memory will never be de-allocated. You either need some sort of loop detection heuristic or you need a full garbage collection system. Garbage collection, of course, means that your program will have to stop every so often to iterate through [i]each and every object[/i], mark, and sweep. Depending on the implementation, it could mean that your program comes to a complete grinding halt while the GC runs, or it could be distributed over a period of time (but still the same amount of net work).
Linking problem: I'm trying to build a project that uses Gwen for Windows using MINGW on Linux. (Cross compile from Linux -> Windows) Unfortunately, I must have missed a linker option and/or header file since some of the wide string functions aren't declared. The first function not declared is _wtof. [code] include/Gwen/Controls/TextBoxNumeric.cpp: In member function &#8216;virtual float Gwen::Controls::TextBoxNumeric::GetFloatFromText()&#8217;: include/Gwen/Controls/TextBoxNumeric.cpp:73: error: &#8216;_wtof&#8217; was not declared in this scope [/code] I thought _wtof would be in <stdio.h>, but it isn't there? It is worth noting that the project builds fine for Linux natively. [b]Update:[/b] Is there a way to link with MSVCRT when cross compiling like this? I think that is where all these functions are defined.
[QUOTE=Night-Eagle;31373291]I thought _wtof would be in <stdio.h>, but it isn't there?[/QUOTE] It's in <stdlib.h> [editline]28th July 2011[/editline] It just might be that on Linux header shuffle causes something weird to happen. Although on Windows the procedure to use wide characters is hilariously complicated. Waitaminute. [editline]28th July 2011[/editline] [url]http://en.wikibooks.org/wiki/Windows_Programming/Unicode[/url] I know they meant good with that, but I mean damn
esalaka: MINGW supplies its own stdlib.h, so let me take a second look at that... [code] shane@s:/usr/i586-mingw32msvc/include$ grep "_wtof" *.h shane@s:/usr/i586-mingw32msvc/include$ grep "_wtol" *.h stdlib.h:_CRTIMP long __cdecl __MINGW_NOTHROW _wtol (const wchar_t *); tchar.h:#define _ttol _wtol shane@s:/usr/i586-mingw32msvc/include$ [/code] No luck. I've somehow convinced myself that the missing functions are in the MSVCRT dlls, however.
MinGW is supposed to be header-compatible with VC so MSDN info should apply to it.
Anyone else cross compile Gwen for Windows from Linux? What libraries did you link to, and what version of MINGW are you using?
[QUOTE=Night-Eagle;31374580]Anyone else cross compile Gwen for Windows from Linux? What libraries did you link to, and what version of MINGW are you using?[/QUOTE] Cant you just commpile it on windows?
Not all of us really want to use Windows.
[QUOTE=Richy19;31374951]Cant you just commpile it on windows?[/QUOTE] I'd waste more time doing that than if I just rolled my own GUI. I've already gotten Bullet Physics, glew, and FreeImage cross compiling. [editline]27th July 2011[/editline] I think I need to generate a .def or .h file for libmsvcr90.a using dlltool or something...
The following Ruby code works just fine: [code]f = File.new(ARGV.shift) i = 0 f.each_byte {printf("%08X\n", i - 1) if (i += 1) % 16 == 1} f.close[/code] But this code doesn't. It has the exact same output as the above, however it doesn't exit. It does the each_byte loop and then hangs, using 100% CPU, until you kill the process. [code]f = File.new(ARGV.shift) i = 0 f.each_byte {printf("%08X\n", f.pos - 1) if (i += 1) % 16 == 1} f.close[/code] The only difference is that the second, rather than using the variable i, uses the pos function, which returns the position of the file pointer. WHY!?
How do I use a boolean operator in a class function definition? [editline]27th July 2011[/editline] Also, why am I getting this message? " [Linker error] undefined reference to `fraction::fraction(int, long)' " Header: [cpp] class fraction { public: void fraction(); fraction (int, long); fraction AddedTo(fraction) const; fraction Subtract(fraction) const; fraction MultipliedBy(fraction) const; fraction DividedBy(fraction) const; bool isGreaterThan(fraction otherfraction) const; bool isEqualTo(fraction otherfraction) const; void print() const; private: int num; long denom; }; [/cpp] Specification [cpp] #include <iostream> #include "fraction.h" using namespace std; fraction::fraction() { num = 0; denom = 1; } fraction fraction::AddedTo(fraction otherfraction) const // Pre: Both operands have been initialized. // Post: value + self is returned. { fraction result; result.denom = denom * otherfraction.denom; result.num = num * otherfraction.num; return result; } void fraction::print() const { cout << num << "/" << denom; } [/cpp] Initialization [cpp] #include <cstdlib> #include <iostream> #include "fraction.h" using namespace std; int main(int argc, char *argv[]) { fraction f1(9,8); fraction f2(2,3); fraction result; cout << "The sum of "; f1.print(); cout << " and "; f2.print(); cout << " is "; result = f1.AddedTo(f2); //a class binary operation - function result.print(); cout << endl; system("PAUSE"); return EXIT_SUCCESS; } [/cpp]
You define a method, line 5 of the first file. You don't implement it. Also, you may want to try to overload operator+, that way instead of f1.AddedTo(f2), you can use f1 + f2.
[QUOTE=Jookia;31376518]You define a method, line 5 of the first file. You don't implement it.[/quote] Explain what you mean by this? [QUOTE=Jookia;31376518] Also, you may want to try to overload operator+, that way instead of f1.AddedTo(f2), you can use f1 + f2.[/QUOTE] Cant, the assignment forces me to use classes.
[QUOTE=ROBO_DONUT;31370263]Simple reference counting generally doesn't suffice, as you can have a reference loop and the memory will never be de-allocated. You either need some sort of loop detection heuristic or you need a full garbage collection system. Garbage collection, of course, means that your program will have to stop every so often to iterate through [i]each and every object[/i], mark, and sweep. Depending on the implementation, it could mean that your program comes to a complete grinding halt while the GC runs, or it could be distributed over a period of time (but still the same amount of net work).[/QUOTE] What mark-and-sweep garbage-collecting smart pointer did you have in mind? My suggestions to Chrispy_645 were shared_ptr (which uses reference counting) and auto_ptr (which does even less). [editline]27th July 2011[/editline] [QUOTE=agnl;31376616]Cant, the assignment forces me to use classes.[/QUOTE] You're still using classes, you're just naming the function "operator+" instead of "AddedTo".
[QUOTE=agnl;31376616]Explain what you mean by this?[/QUOTE] Line 5 of the first file you posted. Your class has a method, but it doesn't exist in the other files.
Can someone help here please? [url]http://stackoverflow.com/questions/6854461/serializing-xna-rectangle-with-json-net[/url] It's about Json.NET Why can't it serialize / deserialize rectangles correctly ?
Sorry, you need to Log In to post a reply to this thread.