If I compile this QT c++ program in SuSE Linux
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
When I type
i386-mingw32-g++ helloworld.cpp
I get the following error
i386-mingw32-g++: error trying to exec 'cc1plus': execvp: No such file or directory
Is this because MinGW ...
Hi,
I'm setting up a C++ project, on Ubuntu x64, using Eclipse-CDT. I'm basically doing a hello world and linking to a commerical 3rd party library.
I've included the header files, linked to their libraries, but I still get linker errors. Are there some possible problems here other than the obvious (e.g. I am 99% sure I'm linking to ...
I am writing a program that is cross platform. There are a few spots where I have to specify an operating system dependent call.
#ifdef WINDOWS
..do windows only stuff
#endif
#ifdef LINUX
..do linux only stuff
#endif
Are there any preprocesser directives that get defined by the compiler so I don't have to explicitly define them w...
When compiling :
#include <vector>
template<class T> class foo {
void bar() {
std::vector<T> x;
std::vector<T>::iterator i = x.begin();
}
};
int main() {
return 0;
}
I get :
# g++ ~test.cpp
test.cpp: In member function `void foo<T>::bar()':
test.cpp:7: error: expected `;' before "i"
Shouldn't this w...
Trying to use the RHEL5.3 GCC 4.3.2 compiler to build my software on that platform. I get the following error no matter what I try when compiling with -O2, but it builds fine without optimization. Any ideas?
/usr/bin/ld: myapp: hidden symbol `void std::__ostream_fill<char, std::char_traits<char> >(std::basic_ostream<char, std::char_tr...
I'm trying to learn the details behind how the compiler works and I was wondering what the symbol B means when using nm. I tried to follow std::cout into libstdc++, but it ends with
nm -DC /usr/lib/libstdc++.so.6 | grep cout
000e8da0 B std::cout
000e9020 B std::wcout
Where is the link to the actual function and what does the B mean?
...
Hello, all!
I am writing a program in C++ which uses the CLAPACK ATLAS library. However, I cannot get the program to link successfully to the library. I have written a small C program to better demonstrate the problem. Interestingly enough, this small demonstration program links just fine if I compile it with GCC, but I get the same link...
Is it possible to use a library compiled by visual studio in an application compiled by g++ (mingw) on Windows?
...
Hi Guys,
Ok so I have an app that I'm writing that uses a library that someone at work developed. I've included the xcode project in my project and included the output target of that project in my project's target as a framework. I also included the .a file in my target under the "Link Binrary with Libraries" folder. I also have put in ...
Hello all,
I'm quiet familiar with gcc assembly... Recently I was forced to turn back to g++ for some codes clean up. Let me mention I'm too much familiar with assembly, hence, for some curiosity purposes, I often get a look at how good the compiler generated asm is.
But the naming conventions with g++ are just bizaare. I was wondering...
Hello, I'm have an application built with the -std=gnu++0x parameter in tdm-mingw g++ 4.4.0 on windows.
It is using an ofstream object and when I build, it gives the following linking error:
c:\opt\Noddler/main_func.cpp:43: undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream(std::string const&, st...
I'm learning C++ and when I was testing the Microsoft Visual C++ 2008 Express and Eclipse Ganymede, but with the g++ compiler as default, I've noted that a same code in VC++ get some errors and in g++ compile normally, without errors or warnings and execute normally, but I want to know what is the difference between VC++ syntax and g++ s...
Hi,
I am very aware of compiling C++ programs with g++ in linux environment. But, may be I am missing something, I am getting this strange output/behaviour.
I have source file in test.cpp.
To compile this, I did
(1)
g++ -c test.cpp
g++ -o test test.o
./test
Everything works fine.
But when I did compling and linking in same stage, ...
This seems like it should be really simple. I compiled a library in Qt (this newmat library), and produced the file libnewmat.a. Now I need to integrate this library into another project but I just can't get it to work.
I've tried a few different things with the LIBS variable in my .pro file including:
Win32:LIBS += libnewmat.a #libr...
I have a C function that contains all the code that will implement the bytecodes of a bytecode interpreter.
I'm wondering if there is a way to align segments of the compiled code in memory on fixed size boundaries so that I could directly calculate the address to jump to from the value of the bytecode? Sort of the same way an array work...
Hello! I would like to know if I can use g++ to compile C++ source files stored on an FTP server? Can this be done?
Thanks
NOTE: The FTP server is within the local network
...
I'm trying out the solution to a question about specialized template classes.
This code with a compiles fine in g++, but throws up linker errors when compiled with gcc. What's the cause of these errors ?
$ g++ traits2.cpp
$ gcc traits2.cpp
/tmp/ccI7CNCY.o: In function `__static_initialization_and_destruction_0(int, int)':
traits2.cpp...
In C++, I know that the compiler can choose to initialize static objects in any order that it chooses (subject to a few constraints), and that in general you cannot choose or determine the static initialization order.
However, once a program has been compiled, the compiler has to have made a decision about what order to initialize these...