help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mkoctfile problem


From: Allahyari Rahim
Subject: Re: mkoctfile problem
Date: Tue, 20 Jan 2009 08:21:31 +0000 (GMT)

hello

I have command mkoctfile –v TWUsetUserAgent.cc

 

> mkoctfile   -v TWUsetUserAgent.cc

mingw32-g++-4.3.0-dw2 -c -march=i686 -mtune=i686  -IC:\Programme\Octave\3.0.2_gcc-4.3.0\include\octave-3.0.2 -IC:\Progra

mme\Octave\3.0.2_gcc-4.3.0\include\octave-3.0.2\octave -IC:\Programme\Octave\3.0.2_gcc-4.3.0\include -mieee-fp -D_DLL -O

2 -Wall    TWUsetUserAgent.cc -o TWUsetUserAgent.o

mingw32-g++-4.3.0-dw2 -shared -shared-libgcc -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseu

do-reloc  -o TWUsetUserAgent.oct  TWUsetUserAgent.o   -LC:\Programme\Octave\3.0.2_gcc-4.3.0\lib\octave-3.0.2 -LC:\Progra

mme\Octave\3.0.2_gcc-4.3.0\lib -loctinterp -loctave  -lcruft -shared-libgcc -llapack -lblas -lfftw3 -lreadline  -lncurse

s -lhdf5 -lz -lm -lstdc++_s -lws2_32 -lkernel32 -lgfortran -lstdc++_s

TWUsetUserAgent.o:TWUsetUserAgent.cc:(.text+0x4d6): undefined reference to `_TWUsetUserAgent'

collect2: ld returned 1 exit status

octave-3.0.2.exe:65:C:\Programme\Octave

>

 

I try to compile this code

 

 

// TWUsetUserAgent.cc

#include <octave/oct.h>                                   

#include "TWUsetUserAgent.h"

 

DEFUN_DLD(TWUsetUserAgent, args, , "")

{

  octave_value retval;

 

  if (args.length() == 1)

  {

    std::string ua = args(0).string_value();

    if (! error_state)

    {

      retval = std::string(TWUsetUserAgent(ua.c_str()));

 

 

    }

   

  }

  else

    print_usage();

 

  return retval;

}

 

 

 

 

// TWUsetUserAgent.h

 

#ifndef TWUSETUSERAGENT_H

#define TWUSETUSERAGENT_H

 

#ifdef  __cplusplus

extern "C"

{

#endif

 

    typedef   char const *    TWUsetUserAgent_t(char const * );               

    TWUsetUserAgent_t TWUsetUserAgent;

   

#ifdef  __cplusplus

}

#endif

 

#endif

 

and

 

// TWUsetUser.c

#include "TWUsetUserAgent.h"

 char const * TWUsetUserAgent(char const * new_user_agent)

{

    char const* user_agent_name;

    if( new_user_agent && *new_user_agent  && ( 81 > strlen(new_user_agent)))

    {

        user_agent_name = new_user_agent;

    }

    return user_agent_name;

}

 

I have compiled program with msvc und build TWUClib.lib and TWUClib.dll

 

 

 

If I use

 

mkoctfile TWUsetUserAgent.cc, then it’s with following error

 

> mkoctfile TWUsetUserAgent.cc

TWUsetUserAgent.o:TWUsetUserAgent.cc:(.text+0x4d6): undefined reference to `_TWUsetUserAgent'

collect2: ld returned 1 exit status

octave-3.0.2.exe:66:C:\Programme\Octave

 

Ok link error my header file can not find TWUsetUser.c

 

 

If I try the code like following to write

 

// TWUsetUserAgent.h

#ifndef TWUSETUSERAGENT_H

#define TWUSETUSERAGENT_H

 

#ifdef  __cplusplus

extern "C"

{

#endif

 

    typedef   char const *    TWUsetUserAgent_t(char const * );               

    TWUsetUserAgent_t TWUsetUserAgent;

   

#ifdef  __cplusplus

}

#endif

 

#endif

 

char const * TWUsetUserAgent(char const * new_user_agent)

{

    char const* user_agent_name;

    if( new_user_agent && *new_user_agent  && ( 81 > strlen(new_user_agent)))

    {

        user_agent_name = new_user_agent;

    }

    return user_agent_name;

}

Then it’s is ok but it is not normal I need to call a lot of source.

 

I have to call either my TWUClib.lib or direct connect to TWUsetUser.c

 

 

Thanks

 



--- Tatsuro MATSUOKA <address@hidden> schrieb am Di, 20.1.2009:
Von: Tatsuro MATSUOKA <address@hidden>
Betreff: Re: mkoctfile problem
An: address@hidden, address@hidden
CC: "MATSUOKA Tatsuro" <address@hidden>
Datum: Dienstag, 20. Januar 2009, 5:51

Hello

How did you use mkoctfile command?

From octave prompt?

Did you try

`-v'
`--verbose'
Echo commands as they are executed.
like
octave:>mkoctfile -v foo.cc

?

Anyway your information is not enough to answer.

Regards

Tasuro

--- Allahyari Rahim <address@hidden> wrote:

> hello,
> can anyone help me?
>
> i have problem with command mkoctfile
-LC:\Programme\Octave\3.0.2_gcc-4.3.0\lib\octave-3.0.2
>
-LC:\Programme\Octave\3.02_gcc-4.3.0\octave-3.0.2\TWUClib.lib
TWUsetUserAgent.cc
>
> i have the following Message
>
c:\programme/octave/3.0.2_gcc-4.3.0/mingw32/bin../lib/gcc/mingw32/4.3.0-dw2/../../../../mingw32/bin/ld.exe:
> cannot open output file
--library=C:\Programme\Octave\3.0.2_gcc-4.3.0\lib\octave-3.0.2.oct:
> Invalid argument collect2: ld returned 1 exit status
>
> best regards
> rahim
>
>
>
> > _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>


--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]