473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

undefined reference to main error in SDL

Iam working with graphics.I wrote a pgogram in turbo c for graphics.I need to run on Freebsd system, so installed SDL and trying.when i give make in sdl_image folder
/usr/lib/crt1.o undefined reference to main error is giving

i tried to located crt1.c,i found 5 places,i modified all the files by adding
i
program found with main like this:
extern int main(int,char **,char **);
......
....
.....
exit(main(argc,argv,env));
here i added after commenting the extern int main line
in main(int argc,chart **,chart **)
{
}
still same error,someone help me please,iam stucked
Nov 24 '06 #1
1 3714
Banfa
9,065 Expert Mod 8TB
1. You shouldn't edit crt1.c, you shouldn't need to edit it either. It is part of the start-up code for your system. Additionally crt1.c may only be there for reference, I doubt it is compiled when you create your program you will still be using the pre-compile binary that was from the original source code.

2. The unresolved reference to main you are getting indicates that you program does not contain the function

int main(int argc, char ** argp)
{
...
}

This function should appear in your code somewhere and is the standard entry point for any C/C++ program.
Nov 24 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dom | last post by:
I'm new to c++. Just started learning it 24 hours ago. Am running into a compile problem. Please, no one waste the effort telling me to google it. I've been researching it for quite a while with no...
10
by: PCHOME | last post by:
Hi! Would someone please help me thess C error(in gcc on Linux)? The compiler continues to give me: readLP.o: In function `Input_Problem': readLP.o(.text+0x0): multiple definition of...
10
by: siroregano | last post by:
Hello- I've got a nice C program written that uses libsndfile (#include <sndfile.h>) to convert my raw data into a properly-formatted wav file. The program is composed of a single .c file that...
8
by: pavan734 | last post by:
Hello, Please excuse me as Iam not posting this to correct group. I have a parser code obtained from flex command. I have many other files. When I compile them Iam getting a message like:...
2
by: zapr | last post by:
I am trying to compile on Mac OS X 10.4 my C program. I am stuck at the link phase where I get (gcc 4.01): $ gcc -s -Os -Wall -fprofile-arcs -fpack-struct -fno-common -ffast-math -ffloat-store...
1
by: ice8595 | last post by:
Hi there, I'm relatively new at C++ and I'm wondering if I can get some help on this error I'm having. I'm trying to run this sample code I have that should be correct. All of my files compile...
8
by: wdh3rd | last post by:
I'm still new at C and can't solve this problem. I've looked through the FAQ and on the Web, but am not having luck. I'm getting an "undefined reference" error as well as a "Id returned 1 exit...
1
by: taiyang902 | last post by:
i program under linux ,and using kdevelop c/c++. the code follow, #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <iostream> #include <cstdlib> using namespace std;
8
by: Soneji | last post by:
Hello all! ( again ) Once more, I have a problem that seems unsolvable by me. I'm getting the, seemingly common, "undefined reference" linking error. I've tried quite a few things, but...
8
Motoma
by: Motoma | last post by:
Good evening everyone. I am starting to re-explore C++, and I wanted to build a singleton class. Unfortunately, when I set things up as I do in PHP, it doesn't work out for me. I hope that the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.