C++ simple problem, doesn't recognize some std::cout
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
C++ simple problem, doesn't recognize some std::cout
I don't know what's goin' on, it happens to me in every project but I don't know what I'm doing wrong! looked for solution in the code for over a hour.
in any source files that use cout, cerr, endl, etc.
Is there more error?
it says now that there are multiple definitions for the constructor...
weird//
Quote:
cd '/home/zuki/Scripts/stigno2/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k
gmake all-recursive
Making all in src
/bin/sh ../libtool --tag=CXX --mode=link g++ -O0 -g3 -o stigno2 stigno2.o cimage.o
g++ -O0 -g3 -o stigno2 stigno2.o cimage.o
cimage.o(.text+0x104): In function `CImage::CImage(int)':
/home/zuki/Scripts/stigno2/src/cimage.cpp:26: multiple definition of `CImage::CImage(int)'
stigno2.o(.text+0x104):/home/zuki/Scripts/stigno2/src/cimage.cpp:26: first defined here
cimage.o(.text+0x112): In function `CImage::CImage(int)':
/home/zuki/Scripts/stigno2/src/cimage.cpp:26: multiple definition of `CImage::CImage(int)'
stigno2.o(.text+0x112):/home/zuki/Scripts/stigno2/src/cimage.cpp:26: first defined here
cimage.o(.text+0x120): In function `CImage::~CImage()':
/home/zuki/Scripts/stigno2/src/cimage.cpp:33: multiple definition of `CImage::~CImage()'
stigno2.o(.text+0x120):/home/zuki/Scripts/stigno2/src/cimage.cpp:33: first defined here
cimage.o(.text+0x126): In function `CImage::~CImage()':
/home/zuki/Scripts/stigno2/src/cimage.cpp:33: multiple definition of `CImage::~CImage()'
stigno2.o(.text+0x126):/home/zuki/Scripts/stigno2/src/cimage.cpp:33: first defined here
collect2: ld returned 1 exit status
gmake[2]: *** [stigno2] Error 1
gmake[2]: Target `all' not remade because of errors.
gmake[2]: Nothing to be done for `all-am'.
gmake[1]: *** [all-recursive] Error 1
gmake: *** [all] Error 2
*** Exited with status: 2 ***
You need to #endif at the end of cimage.h
Do you by any chance #include cimage.cpp in any other files?, the #include should be cimage.h, the header file not the source code.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.