Dev c error 193

поэтому я пытался протестировать мой dev c ++ как обычно, и он сказал, что не удалось выполнить location / name.exe ошибка 193:% 1 не является допустимым...

поэтому я пытался протестировать мой dev c ++ как обычно, и он сказал, что не удалось выполнить location / name.exe ошибка 193:% 1 не является допустимым приложением win 32. Я еще не использовал компилятор для чего-то сложного.

#include<stdio.h>
#include<math.h>
#define PI 3.14
int main()
{
int r      = 3;

float area = PI*pow(r,2);

printf("the area of the circle is %f",area);

return 0;
}

Я использую компилятор Dev c ++ GCC (MinGW).

он компилируется правильно, но когда я пытаюсь запустить, он получает это сообщение об ошибке

Не удалось выполнить «C: Users SIM JONES NIGL TD Desktop c language areaofcircle2.exe»:
Ошибка 193:% 1 не является допустимым приложением Win32.

нажмите любую клавишу для продолжения

4

Решение

Я только что столкнулся с этой проблемой, и заметил, что если вы просто сохраните свои программы в папке без пробелов. Моя папка по умолчанию была установлена ​​в Мои документы, поэтому я создал папку на F: Drive с именами программ, сохранил в ней программы и затем скомпилировал их. Я не испытывал эту ошибку тогда 🙂

5

Другие решения

Других решений пока нет …

wxExecute problem — «Error 193: unknown error c1»

Topic is solved

NickDX

Knows some wx things
Knows some wx things
Posts: 39
Joined: Thu Sep 30, 2010 8:18 pm

wxExecute problem — «Error 193: unknown error c1»

I´ve tried to execute a simple instruction using wxExecute, as it was meant to substitute the system() commands.
So, instead of

I tried to use

but, while the system() function opened the notepad with the text.txt file (although showing that ugly black screen on the back of the app) the wxExecute just gave me the following error:

«Execution of command ‘text.txt’ failed (Error 193: unknown error c1)»

I tried to use wxExecute with .exe files and it seemed to have worked…

Also, for general information:
Using Dev-C++ 4.9, wxWidget 2.9, Win7 64bit

DavidHart

Site Admin
Site Admin
Posts: 4166
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post

by DavidHart » Fri Oct 22, 2010 4:41 pm

Hi,

Well, you’re trying to execute a text file, so…

Have a look at wxMimeTypesManager and wxFileType::GetOpenCommand for the way forward.

BTW, _(«text.txt») says: Please mark this string for translation. Were it successfully translated on a user’s system, the file would be unlikely to open, as the name would have changed.
On <wx2.9 you should use wxT(«text.txt»); on >=2.9 just «text.txt».

Regards,

David

NickDX

Knows some wx things
Knows some wx things
Posts: 39
Joined: Thu Sep 30, 2010 8:18 pm

Post

by NickDX » Mon Oct 25, 2010 5:46 pm

Hi David, thanks for your quick reply.
I read about the wxMimeTypeManager and the wxFileType and, messing around with it, tried to open the txt file. (notice that opening the txt file is just an example, I actually want to be able to open any kind of file that the system() command would allow me to)

Code: Select all

    wxMimeTypesManager *MIME;
    wxFileType *FT = MIME->GetFileTypeFromExtension("text.txt");
    wxExecute(FT->GetOpenCommand(wxT("text.txt")));

By doing this I actually got a fatal error in my program, so I got a bit confused on what I should actually do.

BTW, _(«text.txt») says: Please mark this string for translation. Were it successfully translated on a user’s system, the file would be unlikely to open, as the name would have changed.
On <wx2.9 you should use wxT(«text.txt»); on >=2.9 just «text.txt».

Regarding the wxString remark, I still don´t get what are strings that should be «translated».
I only use _(), _T() or wxT() whenever a function or method asks for a wxString, or I need to use some Unicode8 characters, other than that, I dont find much use to simple strings, other than non-wx related commands, such as system().

DavidHart

Site Admin
Site Admin
Posts: 4166
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post

by DavidHart » Mon Oct 25, 2010 6:17 pm

Code: Select all

    wxMimeTypesManager *MIME;
    wxFileType *FT = MIME->GetFileTypeFromExtension("text.txt");
    wxExecute(FT->GetOpenCommand(wxT("text.txt")));

By doing this I actually got a fatal error in my program

Well, you’re dereferencing a pointer, MIME, that points to random memory, so…

You could try wxMimeTypesManager *MIME = new wxMimeTypesManager;. But reading the doc, I see it says:
«Global instance of wxMimeTypesManager is always available. It is defined as follows:
wxMimeTypesManager *wxTheMimeTypesManager;»
so using that would be a better choice.

Regarding the wxString remark, I still don´t get what are strings that should be «translated».

You should mark-for-translation strings that the end-user of your app will see e.g. (quote stolen from auria’s sig):
_(«Keyboard not detected. Press F1 to continue»).
If the program runs a non-English locale (and is set up correctly), and there’s a translation available for that locale, the user will see the message in his native language.

Now consider what would happen if you did that for a filename. The good news is: it probably won’t have a translation anyway, so no harm (or good) will be done except to annoy any potential translator. But if it were a common filename e.g. ‘README’ or ‘setup’, and it did get translated, then instead of trying to load that filename, your app would instead try to load a file using the translated string as the name. Such a file is highly unlikely to exist.

wxT() and the identical _T() are nothing to do with translations. They just mark a string as being ‘long’ in a unicode build, and do nothing elsewhere. So they’re needed to make a 2.8 app compile against a unicode build.

The _() macro does wxT() internally, so you don’t need both for the same string.

NickDX

Knows some wx things
Knows some wx things
Posts: 39
Joined: Thu Sep 30, 2010 8:18 pm

Post

by NickDX » Mon Oct 25, 2010 7:34 pm

DavidHart wrote:

Regarding the wxString remark, I still don´t get what are strings that should be «translated».

You should mark-for-translation strings that the end-user of your app will see e.g. (quote stolen from auria’s sig):
_(«Keyboard not detected. Press F1 to continue»).
If the program runs a non-English locale (and is set up correctly), and there’s a translation available for that locale, the user will see the message in his native language.

Now consider what would happen if you did that for a filename. The good news is: it probably won’t have a translation anyway, so no harm (or good) will be done except to annoy any potential translator. But if it were a common filename e.g. ‘README’ or ‘setup’, and it did get translated, then instead of trying to load that filename, your app would instead try to load a file using the translated string as the name. Such a file is highly unlikely to exist.

wxT() and the identical _T() are nothing to do with translations. They just mark a string as being ‘long’ in a unicode build, and do nothing elsewhere. So they’re needed to make a 2.8 app compile against a unicode build.

The _() macro does wxT() internally, so you don’t need both for the same string.

Wow, this would really create several problems with my program, as it creates and handles several files.
The problem is that I already have thousand of line of coding, using arbitrarily either _() or _T() or wxT(), so it would take a while to correct every _(), since I have no way of quickly finding where I used them improperly.

Do you think a simple «replace all _(» for «wxT(» would solve this without any consequences?
I´m a little worried about doing it and replacing some bizarre and uncalled for occurence generating a run time error bug that will be hidden for days…

DavidHart

Site Admin
Site Admin
Posts: 4166
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post

by DavidHart » Mon Oct 25, 2010 7:44 pm

Do you think a simple «replace all _(» for «wxT(» would solve this without any consequences?

Well, no translations would be better than difficult-to-debug errors. But if you ever want translations for your app, you’ll need to go through all the strings eventually.

Some of the ones that need to be translated should cluster e.g. menu labels, which makes it easier.

  • Remove From My Forums
  • Question

  • I had a program developed in C# VS2010 and VS2005. The program still works just fine on all Window OSs from Win 2000->XP->Windows 7. All 32 bit versions. The problem came when this program runs on 64 bit Windows7. The program fails during
    the call to LoadLibrary(). Used P/Invoke method to use this function. The LoadLibrary fails with
    any dll and not only the one I want. My project settings are «built on x86» and the Target Platform as «Any CPU». Infact I tried a small program(thinking that My original program is buggy), a windows forms application with two buttons.
    One Button will use LoadLibrary() and one for FreeLibrary(). Same issue on 64 bit. The LoadLibrary fails with error code 193. used same P/Invoke method for making  use of the native kernel32.dll in the System32 folder. Can anyone point
    me if I need to do anything additonal for the program to work. I am using the C# VS2010 for development and still has to use .Net 2.0. Any suggestion is greatly appreciated.

    Thanks.

    Here is my code:

    using

    using

    using

    using

    using

    using

    using

    using

    using 

    using

    using

    namespace

    {

    {

    public
    Form1()
    public
    class
    UnManagedCodeB

    {

    InitializeComponent();

    }

    {

    #region

    Kernel32 DLL Import Functions

    arSet =
    CharSet.Auto,
    BestFitMapping =
    false,
    SetLastError =
    true)] 

    public
    static
    extern
    IntPtr
    LoadLibrary(
    string
    lpFilename);

    [

    [

    [

    [

    [

    #endregion

    }

    {

    m_DllHandle =

    {

    {error_code = 

     M

    }

    }

    {

    error_code = U

    }

    }

    {

    }

    nManagedCodeB.GetLastError();
    MessageBox.Show(error_code.ToString(),
    «Dll Handle Return code»);
    Application.Exit();
    private
    void
    button3_Click(
    object
    sender,
    EventArgs
    e)
    UnManagedCodeB.FreeLibrary(m_DllHandle);

     }

    catch
    (
    Exception
    x)
    MessageBox.Show(x.Message,
    «DLL Loading problem(LoadUSBLibrary())!»);if
    (m_DllHandle ==
    IntPtr.Zero)
    UnManagedCodeB.GetLastError();
    essageBox.Show(error_code.ToString(),
    «Dll load failed(LoadLibrary()»);
    throw
    new
    ApplicationException(«Error
    loading «
    + filename.ToString());private
    IntPtr
    m_DllHandle;
    private
    void
    button1_Click(
    object
    sender,
    EventArgs
    e)
    int
    error_code ;
    string
    filename =
    «C:\Windows\SysWOW64\UAUSBIP.dll»;
    UnManagedCodeB.LoadLibrary(
    filename);
    trypublic
    static
    extern
    int
    GetLastError();
    DllImport(«C:\Windows\System32\kernel32.dll»,
    CharSet =
    CharSet.Ansi,
    ExactSpelling =
    true)]
    public
    static
    extern
    IntPtr
    GetProcAddress(
    IntPtr
    hModule,
    string
    procName);
    DllImport(«C:\Windows\System32\kernel32.dll»)]
    public
    static
    extern
    bool
    FreeLibrary(
    IntPtr
    hModule);
    DllImport(«C:\Windows\System32\kernel32.dll»)]
    public
    static
    extern
    bool
    SetDllDirectory(
    string
    path);
    DllImport(«C:\Windows\System32\kernel32.dll»,
    SetLastError =
    true)]
    public
    static
    extern
    void
    SetLastError(
    int
    errorCode);
    DllImport(«C:\Windows\System32\kernel32.dll»)][DllImport(«C:\Windows\System32\kernel32.dll»,
    Ch
    CS_64bit_TestApp
    public
    partial
    class
    Form1
    :
    FormSystem.Windows.Forms;System.Runtime.InteropServices;System.Threading;System.IO.Ports;System.IO;System.Text;System.Drawing;System.Data;System.ComponentModel;System.Collections.Generic;System;

Answers

  • Any CPU will give you a 64 bit process on win64, you cannot load a 32bits dll into a 64 bits process. If you have no 64 bits versions of your dlls you can change your soltion platform from ‘any cpu’ to ‘x86’ to force a 32 bits process which has no issues
    loading 32 bits dlls.

    • Marked as answer by

      Tuesday, August 24, 2010 2:06 PM

Topic: Error 193 :(  (Read 16049 times)

when I start debugging it shows following…

Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:Documents and SettingsIrfanDesktopTemptest_1
Adding source dir: C:Documents and SettingsIrfanDesktopTemptest_1
Adding file: binDebugtest_1.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.7.50.20071127
Error creating process C:Documents and SettingsIrfanDesktopTemptest_1/bin/Debug/test_1.exe, (error 193).

The program has no error.
Any idea how to solve this problem?


Logged


You should try a path without spaces.

Dje


Logged


You should try a path without spaces.

Dje

sorry, i didnt understand.

could u plz clarify?


Logged


Try to move project to another place -> full path to the *.exe file should be without spaces and non-ascii characters.


Logged


Also you could try newer gdb, current version is 7.x.x


Logged

(most of the time I ignore long posts)
[strangers don’t send me private messages, I’ll ignore them; post a topic in the forum, but first read the rules!]


You should try a path without spaces.

Dje

Thanks,it worked….but isn’t this a little weird solution?

is there any explanation behind this?


Logged


Lots of command line tools use space as argument separator and you have to quote «your args with spaces» to use spaces in args.

Dje


Logged


Понравилась статья? Поделить с друзьями:

Читайте также:

  • Deus ex mankind divided ошибка при запуске приложения 0xc0000906
  • Deus ex mankind divided ошибка драйвера дисплея
  • Deus ex mankind divided не запускается на windows 10 ошибка 0xc0000142
  • Deus ex mankind divided dxgi error device hung
  • Deus ex invisible war как изменить разрешение

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии