PDA

View Full Version : kdevelop win32 project



rbprogrammer
November 18th, 2006, 05:09 AM
ok, all i want is to get kdevelop to compile and run win32 gui applications. when kdevelop pops up, i choose under the new project mini window the c++ "simple win32 gui app". the code that comes up is:

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <windows.h>

int STDCALL
WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
{
MessageBox (NULL, "Hello, Windows!", "Hello", MB_OK);
return 0;
}


but i get an [x] in a red circle on the side where the line numbers are right on the line with [WinMain]. when i run it, i get the error:

cd '/home/mike/development/kdevelop/xyz' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -f Makefile.cvs && mkdir '/home/mike/development/kdevelop/xyz/debug' && cd '/home/mike/development/kdevelop/xyz/debug' && CC="i586-mingw32msvc-c" CXX="i586-mingw32msvc-c++" LD="i586-mingw32msvc-ld" CXXFLAGS="-O0 -g3" "/home/mike/development/kdevelop/xyz/configure" --enable-debug=full && cd '/home/mike/development/kdevelop/xyz/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make
aclocal
autoheader
automake
autoconf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... yes
checking for working aclocal-1.4... found
checking for working autoconf... found
checking for working automake-1.4... found
checking for working autoheader... found
checking for working makeinfo... missing
checking for C++ compiler default output file name... a.exe
checking whether the C++ compiler works...
configure: error: cannot run C++ compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
*** Exited with status: 1 ***

the only config.log file is in the projects folder under [debug/], and that contains:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.59. Invocation command line was

$ /home/mike/development/kdevelop/xyz/configure --enable-debug=full

## --------- ##
## Platform. ##
## --------- ##

hostname = MWD5025
uname -m = i686
uname -r = 2.6.15-23-386
uname -s = Linux
uname -v = #1 PREEMPT Tue May 23 13:49:40 UTC 2006

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /home/hbin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/bin/X11
PATH: /usr/games


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1540: checking for a BSD-compatible install
configure:1595: result: /usr/bin/install -c
configure:1606: checking whether build environment is sane
configure:1649: result: yes
configure:1664: checking whether make sets $(MAKE)
configure:1684: result: yes
configure:1716: checking for working aclocal-1.4
configure:1723: result: found
configure:1731: checking for working autoconf
configure:1738: result: found
configure:1746: checking for working automake-1.4
configure:1753: result: found
configure:1761: checking for working autoheader
configure:1768: result: found
configure:1776: checking for working makeinfo
configure:1787: result: missing
configure:1893: checking for C++ compiler version
configure:1896: i586-mingw32msvc-c++ --version </dev/null >&5
i586-mingw32msvc-c++ (GCC) 3.4.4 (mingw special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:1899: $? = 0
configure:1901: i586-mingw32msvc-c++ -v </dev/null >&5
Reading specs from /usr/lib/gcc/i586-mingw32msvc/3.4.4/specs
Configured with: /build/buildd/mingw32-3.4.4.20050522.1/build_dir/src/gcc-3.4.4-20050522-1/configure -v --prefix=/usr --target=i586-mingw32msvc --enable-languages=c,c++ --enable-threads --enable-sjlj-exceptions --disable-multilib --enable-version-specific-runtime-libs
Thread model: win32
gcc version 3.4.4 (mingw special)
configure:1904: $? = 0
configure:1906: i586-mingw32msvc-c++ -V </dev/null >&5
i586-mingw32msvc-c++: `-V' option must have argument
configure:1909: $? = 1
configure:1932: checking for C++ compiler default output file name
configure:1935: i586-mingw32msvc-c++ -O0 -g3 conftest.cc >&5
configure:1938: $? = 0
configure:1984: result: a.exe
configure:1989: checking whether the C++ compiler works
configure:1995: ./a.exe
/home/mike/development/kdevelop/xyz/configure: line 1996: ./a.exe: cannot execute binary file
configure:1998: $? = 126
configure:2007: error: cannot run C++ compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=set
ac_cv_env_CC_value=i586-mingw32msvc-c
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value='-O0 -g3'
ac_cv_env_CXX_set=set
ac_cv_env_CXX_value=i586-mingw32msvc-c++
ac_cv_env_F77_set=
ac_cv_env_F77_value=
ac_cv_env_FFLAGS_set=
ac_cv_env_FFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=.exe
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_make_make_set=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='aclocal-1.4'
AR=''
AUTOCONF='autoconf'
AUTOHEADER='autoheader'
AUTOMAKE='automake-1.4'
CC='i586-mingw32msvc-c'
CFLAGS=''
CPP=''
CPPFLAGS=''
CXX='i586-mingw32msvc-c++'
CXXCPP=''
CXXFLAGS='-O0 -g3'
DEFS=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
F77=''
FFLAGS=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='/home/mike/development/kdevelop/xyz/missing makeinfo'
OBJEXT=''
PACKAGE='xyz'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
VERSION='0.1'
ac_ct_AR=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_F77=''
ac_ct_RANLIB=''
ac_ct_STRIP=''
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${prefix}/share'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
includedir='${prefix}/include'
infodir='${prefix}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE "xyz"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define VERSION "0.1"

configure: exit 1

i have no idea why i can run windows projects. the same thin happens if i were to just do a simple terminal window "hello world" win32 application.

there has to be a package in synaptic that i should be downloading, am i right?

llonesmiz
November 18th, 2006, 11:02 AM
I don't know if this is the problem, but you have to make sure that you have the "mingw32" package installed:

sudo apt-get install mingw32

If you have it installed I'm afraid I can't help you and you'll have to wait for someone more experienced.

larytet
December 3rd, 2006, 08:19 AM
I installed mingw and it solved the error "can not compile", but i get another one


configure: error: cannot run C++ compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.


In the config.log


configure:2316: $? = 0
configure:2323: i586-mingw32msvc-c++ -v >&5
Reading specs from /usr/lib/gcc/i586-mingw32msvc/3.4.5/specs
Configured with: /build/buildd/mingw32-3.4.5.20060117.1/build_dir/src/gcc-3.4.5-20060117-1/configure -v --prefix=/usr --target=i586-mingw32msvc --enable-languages=c,c++ --enable-threads --enable-sjlj-exceptions --disable-multilib --enable-version-specific-runtime-libs
Thread model: win32
gcc version 3.4.5 (mingw special)
configure:2326: $? = 0
configure:2333: i586-mingw32msvc-c++ -V >&5
i586-mingw32msvc-c++: `-V' option must have argument
configure:2336: $? = 1
configure:2359: checking for C++ compiler default output file name
configure:2386: i586-mingw32msvc-c++ -O0 -g3 conftest.cpp >&5
configure:2389: $? = 0
configure:2435: result: a.exe
configure:2440: checking whether the C++ compiler works
configure:2450: ./a.exe
run-detectors: unable to find an interpreter for ./a.exe
configure:2453: $? = 2
configure:2462: error: cannot run C++ compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

I will try to look into .configure ...

Update I set cross_compiling to yes - did not help
Update 1. "Run automake&friends", after that edit ./configure


cross_compiling=yes

After that "Build Project"
Win32 "Hello world" application costs 800K on disk (debug info ?) and runs under WINE