Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it
    Registrato dal
    Aug 2010
    Messaggi
    152

    Compilare ed eseguire programma C con Visual C++

    ragazzi come faccio a compilare ed eseguire un programma scritto in linguaggio c con il programma visual c++ ???

  2. #2
    Se parli di un normale programma C "standard", devi creare un progetto nativo console vuoto, aggiungere i file .c/.h alla soluzione e compilare/eseguire con gli appositi pulsanti.
    Amaro C++, il gusto pieno dell'undefined behavior.

  3. #3
    Si, in "Esplora soluzioni" tasto destro sul progetto "Aggiungi" -> "Nuovo Elemento" -> "File di C++" (lo rinomini .c) / "File di intestazione".
    Fracty - The Fractal Generator



    If you cannot choose a concise name that expresses what the method does, it is possible that your method is attempting to perform too many diverse tasks.

  4. #4
    Utente di HTML.it
    Registrato dal
    Aug 2010
    Messaggi
    152
    mmm...credo sarà abbastanza difficile è un ambiente che non ho mai usato ...io incollo il codice poi clicco sull'icona in alto start debugging mi da delle righe nel riquadro in basso, ma non riesco a capire cosa fare...o cosa mi chiede...

  5. #5
    Hai creato un nuovo progetto (presuppongo Console Win32)?

    Hai aggiunto al progetto il file .c nella modalità che ti ho descritto?

    In alto sezione "Compila", clicca su "Compila soluzione". La finestra che si apre probabilmente è la finestra di Output di Compilazione, dove ti verranno segnalati eventuali errori o warnings.

    Una volta compilato con successo (cioè senza errori) potrai eseguire il tuo programma in modalità Debug andando di fianco alla precedente sezione "compila" su "Debug" e "avvia debug"
    Fracty - The Fractal Generator



    If you cannot choose a concise name that expresses what the method does, it is possible that your method is attempting to perform too many diverse tasks.

  6. #6
    Utente di HTML.it
    Registrato dal
    Aug 2010
    Messaggi
    152
    ecco cosa mi esce nel rettangolo d'output...cosa sarebbe ?


    'better.exe': Loaded 'D:\Documents and Settings\Gianni\Documenti\Visual Studio 2008\Projects\better\Debug\better.exe', Symbols loaded.
    'better.exe': Loaded 'D:\WINDOWS\system32\ntdll.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\mscoree.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\kernel32.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\advapi32.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\rpcrt4.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\secur32.dll'
    'better.exe': Loaded 'D:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc 8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\msvcr90d.dll'
    'better.exe': Loaded 'D:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc 8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\msvcm90d.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\ole32.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\msvcrt.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\gdi32.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\user32.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\shlwapi.dll'
    'better.exe': Loaded 'D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msc orwks.dll'
    'better.exe': Loaded 'D:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9 a1e18e3b_8.0.50727.3053_x-ww_b80fa8ca\msvcr80.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\shell32.dll'
    'better.exe': Loaded 'D:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\comctl32.dll'
    'better.exe': Loaded 'D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Cul ture.dll'
    'better.exe': Unloaded 'D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Cul ture.dll'
    'better.exe': Loaded 'D:\WINDOWS\assembly\NativeImages_v2.0.50727_32\ms corlib\9adb89fa22fd5b4ce433b5aca7fb1b07\mscorlib.n i.dll'
    'better.exe' (Managed): Loaded 'D:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a 5c561934e089\mscorlib.dll'
    'better.exe' (Managed): Loaded 'd:\Documents and Settings\Gianni\Documenti\Visual Studio 2008\Projects\better\Debug\better.exe', Symbols loaded.
    'better.exe': Loaded 'D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msc orjit.dll'
    'better.exe': Loaded 'D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\dia symreader.dll'
    'better.exe': Loaded 'D:\WINDOWS\system32\rsaenh.dll'
    'better.exe' (Managed): Loaded 'D:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc 8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\msvcm90d.dll'
    'better.exe': Loaded 'D:\WINDOWS\assembly\NativeImages_v2.0.50727_32\Sy stem\aa7926460a336408c8041330ad90929d\System.ni.dl l'
    'better.exe' (Managed): Loaded 'D:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a 5c561934e089\System.dll'
    The thread 'Win32 Thread' (0x338) has exited with code 0 (0x0).
    The thread 'Win32 Thread' (0xc90) has exited with code 0 (0x0).
    The program '[3708] better.exe: Managed' has exited with code 0 (0x0).
    The program '[3708] better.exe: Native' has exited with code 0 (0x0).

  7. #7
    Nulla di che, ti sta dicendo le dll che carica il tuo programma, i simboli caricati durante il debug e così via. Probabilmente non vedi alcun risultato perché il programma parte e termina così velocemente che non vedi la finestra, imposta un breakpoint sull'ultima istruzione oppure metti prima della fine un
    codice:
    cout<<"Premere Invio per uscire... ";
    cin.sync();
    cin.ignore();
    Per inciso, ad occhio sembrerebbe che tu abbia creato un progetto managed, mentre devi creare un progetto C++ nativo.
    Amaro C++, il gusto pieno dell'undefined behavior.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.