Thread: Problem compiling a program

  1. #1
    Registered User
    Join Date
    Dec 2019
    Posts
    2

    Problem compiling a program

    Hi everyone.

    I was recently doing some stuff and needed a program to complete it. Homever, I need to compile the program by myself. I tried, but looks like it failed to import the libraries. I'm using MinGW's compiler and Visual Studio Code. Here's a piece of info from the log:

    Code:
    [Running] cd "k:\_Dos Navigator with runtimes\brandy-master\brandy-master" && gcc brandy.c -o brandy && "k:\_Dos Navigator with runtimes\brandy-master\brandy-master"brandy
    c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Note\AppData\Local\Temp\ccdSpifQ.o:brandy.c:(.text+0x5e6): undefined reference to `maketables'
    c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Note\AppData\Local\Temp\ccdSpifQ.o:brandy.c:(.text+0x605): undefined reference to `enigma'
    c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Note\AppData\Local\Temp\ccdSpifQ.o:brandy.c:(.text+0xbcb): undefined reference to `maketables'
    c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Note\AppData\Local\Temp\ccdSpifQ.o:brandy.c:(.text+0xc0e): undefined reference to `enigma'
    c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Note\AppData\Local\Temp\ccdSpifQ.o:brandy.c:(.text+0x1242): undefined reference to `maketables'
    c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\Note\AppData\Local\Temp\ccdSpifQ.o:brandy.c:(.text+0x1294): undefined reference to `enigma'
    collect2.exe: error: ld returned 1 exit status
    
    [Done] exited with code=1 in 1.223 seconds
    I'm a complete noob in any variant of C. Please help me!
    Last edited by Salem; 12-26-2019 at 02:15 PM. Reason: Removed crayola

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,798
    So what do the symbols 'maketables' and 'enigma' mean to you?

    > gcc brandy.c -o brandy
    You're assuming the entire program resides in a single file brandy.c

    Something like might work - list the names of ALL your source files.
    gcc brandy.c maketables.c enigma.c -o brandy
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Dec 2019
    Posts
    2
    Thanks! Needed to patch a file for it to work, but I got it compiled.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Libcurl program compiling problem
    By Quang-vip in forum C Programming
    Replies: 5
    Last Post: 03-13-2018, 10:12 AM
  2. Problem compiling a c program
    By tcpurvis in forum C Programming
    Replies: 8
    Last Post: 02-18-2011, 03:18 PM
  3. Problem Compiling Program
    By wco5002 in forum C++ Programming
    Replies: 13
    Last Post: 11-06-2007, 12:56 PM
  4. Problem Running Program After Compiling
    By kristentx in forum C++ Programming
    Replies: 13
    Last Post: 09-12-2007, 10:46 AM
  5. Can somebody tell me why this program isn't compiling?
    By caduardo21 in forum Windows Programming
    Replies: 2
    Last Post: 01-25-2005, 08:40 AM

Tags for this Thread