"_puttchar" redefined

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
geon
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Tue Sep 07, 2004 4:10 pm
Location: Sweden, Uppsala

"_puttchar" redefined

Post by geon » Mon Sep 13, 2004 11:05 am

When I link a project with Dev-C++ (latest release) with wxWidgets-2.5.2, I get this warning. The executabe works fine, though.

Does anyone know how to fix it?


Error log:

C:/Dev-Cpp/include/tchar.h:272:1: warning: "_puttchar" redefined
In file included from C:/Dev-Cpp/include/wx/platform.h:414,
from C:/Dev-Cpp/include/wx/defs.h:25,
from C:/Dev-Cpp/include/wx/wxprec.h:13,
from interface.cpp:11:
C:/Dev-Cpp/include/wx/msw/gccpriv.h:97:1: warning: this is the location of the previous definition

User avatar
ABX
Can't get richer than this
Can't get richer than this
Posts: 810
Joined: Mon Sep 06, 2004 1:43 pm
Location: Poznan, Poland
Contact:

Re: "_puttchar" redefined

Post by ABX » Mon Sep 13, 2004 11:11 am

geon wrote:Does anyone know how to fix it?
That has been fixed in the CVS Head probably. See the change:

http://cvs.wxwidgets.org/viewcvs.cgi/wx ... 15&r2=1.16

ABX

cg
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Sun Aug 29, 2004 12:33 am
Location: Canada
Contact:

Post by cg » Tue Sep 14, 2004 2:40 pm

I got this error recently becuase I was including the GCC(3.4.1) include directories in my makefile. I just removed them and it went away.

wxMSW
GCC3.4.1

CG

eros
I live to help wx-kind
I live to help wx-kind
Posts: 162
Joined: Mon Sep 06, 2004 1:40 am
Location: Argentina

Post by eros » Wed Sep 15, 2004 7:20 pm

I'm getting something like:

Code: Select all

22 C:\wx\include\wx\wxchar.h:143,               from C:\wx\include\wx\debug.h In file included from C:/wx/include/wx/wxchar.h:143,               from C:/wx/include/wx/debug.h 
403 C:\wx\include\wx\debug.h:22,               from C:\wx\include\wx\defs.h                  from C:/wx/include/wx/debug.h:22,               from C:/wx/include/wx/defs.h 
13 C:\wx\include\wx\defs.h:403,               from C:\wx\include\wx\wxprec.h                  from C:/wx/include/wx/defs.h:403,               from C:/wx/include/wx/wxprec.h 
1 C:\wx\include\wx\wxprec.h:13,               from main.cpp                  from C:/wx/include/wx/wxprec.h:13,               from main.cpp 
Using fresh CVS. Binary works fine aswell.
...

cg
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Sun Aug 29, 2004 12:33 am
Location: Canada
Contact:

Post by cg » Thu Sep 16, 2004 2:26 pm

Can you run your gcc command on that one file and post it. That would help.

CG

eros
I live to help wx-kind
I live to help wx-kind
Posts: 162
Joined: Mon Sep 06, 2004 1:40 am
Location: Argentina

Post by eros » Thu Sep 16, 2004 2:42 pm

make it u mean?
...

cg
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Sun Aug 29, 2004 12:33 am
Location: Canada
Contact:

Post by cg » Fri Sep 17, 2004 3:24 pm

Sure run make, paste the command and the all the errors for that one gcc line. That will help.

Thanks

CG

eros
I live to help wx-kind
I live to help wx-kind
Posts: 162
Joined: Mon Sep 06, 2004 1:40 am
Location: Argentina

Post by eros » Fri Sep 17, 2004 6:04 pm

I get exactly what I pasted above.
...

cg
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Sun Aug 29, 2004 12:33 am
Location: Canada
Contact:

Post by cg » Fri Sep 17, 2004 7:54 pm

You dont get the g++ line?? something like:

g++ -D__WXMSW__ -D__WXDEBUG__ -c -o myfile.o myfile.cpp

I dont use devcpp so youll have to excuse me :D

CG

eros
I live to help wx-kind
I live to help wx-kind
Posts: 162
Joined: Mon Sep 06, 2004 1:40 am
Location: Argentina

Post by eros » Fri Sep 17, 2004 9:30 pm

Oh, now I follow you. I'm using these params:

-DWINVER=0x0400
-D__WIN95__
-D__GNUWIN32__
-D__WIN32__
-DHAVE_W32API_H
-D__WXMSW__
-D__WINDOWS__
-Wall
-fno-pcc-struct-return
-O2
-Os
-fno-rtti
-fno-exceptions
...

cg
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Sun Aug 29, 2004 12:33 am
Location: Canada
Contact:

Post by cg » Fri Sep 17, 2004 11:38 pm

Hmmmm,

Well what I would do is try and simulate the g++ command the devcpp is executing and run that from the command line.

It would be something like:

g++ -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -DHAVE_W32API_H -D__WXMSW__ -D__WINDOWS__ -Wall -fno-pcc-struct-return -O2 -Os -fno-rtti -fno-exceptions -Ic:\wx\include\lib\mswd-2.5\lib -Ic:\wx\include -c -o file.o file.cpp

Its pretty hard to know whats going on without seeing the error or warning that gcc is producing.

HTH

CG

geon
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Tue Sep 07, 2004 4:10 pm
Location: Sweden, Uppsala

Post by geon » Sat Sep 18, 2004 8:31 pm

All this can be found in the tab labeled "compile log" at the bottom of the window.

eros
I live to help wx-kind
I live to help wx-kind
Posts: 162
Joined: Mon Sep 06, 2004 1:40 am
Location: Argentina

Post by eros » Sun Sep 19, 2004 7:16 pm

Damn I'm still having this issue:

Code: Select all

g++.exe -c src/hammer.cpp -o src/hammer.o -I"C:/Dev-Cpp/include/c++/3.3.1"  -I"C:/Dev-Cpp/include/c++/3.3.1/mingw32"  -I"C:/Dev-Cpp/include/c++/3.3.1/backward"  -I"C:/Dev-Cpp/lib/gcc-lib/mingw32/3.3.1/include"  -I"C:/Dev-Cpp/include"  -I"C:/wx/include"  -I"C:/Proyectos/tinyxml"  -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -DHAVE_W32API_H  -D__WXMSW__ -D__WINDOWS__ -DTIXML_USE_STL -Wall -fno-pcc-struct-return -O2 -Os -fno-rtti -fno-exceptions  

In file included from C:/wx/include/wx/wxchar.h:143,
                 from C:/wx/include/wx/debug.h:22,
                 from C:/wx/include/wx/defs.h:403,
                 from C:/wx/include/wx/wxprec.h:13,
                 from src/hammer.cpp:1:
C:/Dev-Cpp/include/tchar.h:272:1: warning: "_puttchar" redefined
In file included from C:/wx/include/wx/platform.h:457,
                 from C:/wx/include/wx/defs.h:25,
                 from C:/wx/include/wx/wxprec.h:13,
                 from src/hammer.cpp:1:
C:/wx/include/wx/msw/gccpriv.h:108:1: warning: this is the location of the previous definition

I get this for each .cpp I compile, I can't see whats wrong. Any ideas?
...

User avatar
ABX
Can't get richer than this
Can't get richer than this
Posts: 810
Joined: Mon Sep 06, 2004 1:43 pm
Location: Poznan, Poland
Contact:

Post by ABX » Mon Sep 20, 2004 6:59 am

eros wrote:Damn I'm still having this issue:

Code: Select all

warning: "_puttchar" redefined
I get this for each .cpp I compile, I can't see whats wrong. Any ideas?
What's the order of #include in your hammer.cpp file ?

ABX

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Mon Sep 20, 2004 7:39 am

I am just stepping into this discussion, but have you tried searhcing for _putchar and see where it is all found? Have you checked if all your include headers are encapsulated into a single include mechanism like:

[syntax="c"]
#ifndef __MYFILE_H__
#define __MYFILE_H__

// your header include here
// classes etc

#endif
[/syntax]

Maybe some headers are included multiple times while they shouldn't. I had a lengthy discussion with my teacher back at school he said that this #ifndef / #define mechanism didn't worked for including-once. I said it did. My end conclusion was, that he wasn't the C++ programmer I thought he was ;-) I didn't meant anything with this, it just surfaced as one of my many technical university memories.

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Post Reply